Skip to content

[Filesystem] fileperms(): stat failed #23312

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

Closed
axzx opened this issue Jun 28, 2017 · 5 comments
Closed

[Filesystem] fileperms(): stat failed #23312

axzx opened this issue Jun 28, 2017 · 5 comments

Comments

@axzx
Copy link
Contributor

axzx commented Jun 28, 2017

Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no
Symfony version 3.3.2

My code:

$fs = new \Symfony\Component\Filesystem\Filesystem();
$fs->copy('http://lorempixel.com/900/900/', 'var/cache/image.jpg');

I got a warning message:

09:40:03 DEBUG [php] Warning: fileperms(): stat failed for http://lorempixel.com/900/900/
[
"exception" => Symfony\Component\Debug\Exception\SilencedErrorContext {
-severity: E_WARNING,
trace: {
/home/project/vendor/symfony/symfony/src/Symfony/Component/Filesystem/Filesystem.php:72: {
: // Like cp, preserve executable permission bits,
: @chmod($targetFile, fileperms($targetFile) | (fileperms($originFile) & 0111));,
:
}
}
}
]

@xabbuh
Copy link
Member

xabbuh commented Jun 30, 2017

Can you please give #23340 a try?

@axzx
Copy link
Contributor Author

axzx commented Jun 30, 2017

I copied your code and paste it into Symfony 3.3.2.
Works well, no longer displays a warning.

@nicolas-grekas
Copy link
Member

there is no issue: that line is at DEBUG level, reporting a SilencedErrorContext - which means everything is fine, that's just a log line!

@axzx
Copy link
Contributor Author

axzx commented Jul 3, 2017

@nicolas-grekas But annoys when loading DataFixtures

@nicolas-grekas
Copy link
Member

OK, see #23398

fabpot added a commit that referenced this issue Jul 5, 2017
…s-grekas)

This PR was merged into the 2.7 branch.

Discussion
----------

[Filesystem] Dont copy perms when origin is remote

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

Commits
-------

7b44221 [Filesystem] Dont copy perms when origin is remote
@fabpot fabpot closed this as completed Jul 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants