Skip to content

[FileSystem] Windows fix #16987

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 18, 2016
Merged

[FileSystem] Windows fix #16987

merged 1 commit into from
Feb 18, 2016

Conversation

flip111
Copy link
Contributor

@flip111 flip111 commented Dec 12, 2015

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #16783
License MIT
Doc PR
  • Fixes edge case on windows where PHP does not generate a PHP Warning but instead returns a wrong result https://bugs.php.net/bug.php?id=71103
  • Improved error reporting on unlink used in remove()

@flip111 flip111 force-pushed the patch-2 branch 3 times, most recently from 41a16e2 to 413294e Compare December 12, 2015 18:19
@@ -100,6 +100,10 @@ public function mkdir($dirs, $mode = 0777)
public function exists($files)
{
foreach ($this->toIterator($files) as $file) {
if ('\\' === DIRECTORY_SEPARATOR AND strlen((string) $file) > 258) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

YOu should use && instead of AND (same below)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, why is the cast to string required?

@wouterj
Copy link
Member

wouterj commented Dec 12, 2015

Status: Needs Work

* Fixes edge case on windows where PHP does not generate a PHP Warning but instead returns a wrong result https://bugs.php.net/bug.php?id=71103
* Improved error reporting on `unlink` used in `remove()`
@@ -157,7 +161,8 @@ public function remove($files)
}
} else {
if (true !== @unlink($file)) {
throw new IOException(sprintf('Failed to remove file %s', $file));
$error = error_get_last();
throw new IOException(sprintf('Failed to remove file "%s": %s.', $file, $error['message']));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usually, this kind of changes are considered as new features, to me moved to a PR on the master branch IMO

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not really, we do improve exception messages in patch releases.

@Tobion
Copy link
Contributor

Tobion commented Dec 21, 2015

These changes are not correct as some functions work with length 259 while others don't. See https://bugs.php.net/bug.php?id=70943

@flip111
Copy link
Contributor Author

flip111 commented Dec 22, 2015

@Tobion this PR only addresses the file_exists and is_readable functions and does not interfere with other functions.

@fabpot
Copy link
Member

fabpot commented Jan 25, 2016

What's the status of this PR?

@flip111
Copy link
Contributor Author

flip111 commented Jan 25, 2016

ready to merge

@fabpot
Copy link
Member

fabpot commented Jan 25, 2016

@flip111 AND should be changed to &&

@fabpot
Copy link
Member

fabpot commented Feb 18, 2016

Thank you @flip111.

@fabpot fabpot merged commit 0d5f7e2 into symfony:2.3 Feb 18, 2016
fabpot added a commit that referenced this pull request Feb 18, 2016
This PR was merged into the 2.3 branch.

Discussion
----------

[FileSystem] Windows fix

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

* Fixes edge case on windows where PHP does not generate a PHP Warning but instead returns a wrong result https://bugs.php.net/bug.php?id=71103
* Improved error reporting on `unlink` used in `remove()`

Commits
-------

0d5f7e2 Update FileSystem
@fabpot
Copy link
Member

fabpot commented Feb 18, 2016

1f22290

This was referenced Feb 28, 2016
@fabpot fabpot mentioned this pull request Feb 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants