bug #11854 [FileSystem] Fix Throw Exception on copying from an unreadable file (Jérémy Derussé)

This PR was merged into the 2.6-dev branch.

Discussion
----------

[FileSystem] Fix Throw Exception on copying from an unreadable file

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        | NA

Two commits on `Filesystem::copy`  was merged on diffrentes branches c056a9c426 and cd5da9b3c8 but on the merge operation a `@fopen` was transformed to `fopen` . Thas why, actualy, travis is down on master branch (https://travis-ci.org/symfony/symfony/jobs/34427199#L434)

Commits
-------

b30317e Ignore warning on fopen
This commit is contained in:
Fabien Potencier 2014-09-05 07:17:16 +02:00
commit 43b10bc732

View File

@ -56,7 +56,7 @@ class Filesystem
}
// Stream context created to allow files overwrite when using FTP stream wrapper - disabled by default
if (false === $target = fopen($targetFile, 'w', null, stream_context_create(array('ftp' => array('overwrite' => true))))) {
if (false === $target = @fopen($targetFile, 'w', null, stream_context_create(array('ftp' => array('overwrite' => true))))) {
throw new IOException(sprintf('Failed to copy "%s" to "%s" because target file could not be opened for writing.', $originFile, $targetFile), 0, null, $originFile);
}