Skip to content
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

[5.3] Added setUnixMode and getUnixMode to Filesystem #16560

Merged
merged 4 commits into from
Nov 29, 2016

Conversation

verwer
Copy link

@verwer verwer commented Nov 26, 2016

Added the possibility to set and get the Unix file permissions in Filesystem.

@sisve
Copy link
Contributor

sisve commented Nov 26, 2016

Could you show an example how this method will be called? This would only work if you first asserted that the filesystem wrapper you use is the locale filesystem, right? Anyone using S3 or Rackspace will get php errors about missing methods?

@GrahamCampbell
Copy link
Member

@sisve This component is not to be confused with flysytem.

@GrahamCampbell
Copy link
Member

totally different class, not even same interface: https://github.com/laravel/framework/blob/5.3/src/Illuminate/Filesystem/FilesystemAdapter.php

@taylorotwell
Copy link
Member

Why not just call the method chmod to avoid confusion?

@verwer
Copy link
Author

verwer commented Nov 27, 2016

@taylorotwell And then with two separate methods (setChmod and getChmod)? Or just one method that accepts two arguments? If only the first is filled, it's a getter, else a setter?

@GrahamCampbell GrahamCampbell changed the title Added setUnixMode and getUnixMode to Filesystem. [5.3] Added setUnixMode and getUnixMode to Filesystem Nov 27, 2016
@taylorotwell
Copy link
Member

I would just have one method.

@marktopper
Copy link
Contributor

$filesystem->chmod('file.txt'); // returns the chmod
$filesystem->chmod('file.txt', 777); // chmod 777 file.txt

Am I right @taylorotwell?

@verwer
Copy link
Author

verwer commented Nov 28, 2016

@taylorotwell @marktopper I just combined the two methods into one and renamed it to chmod.

@marktopper According to the PHP documentation you'll have to pass an octal value, so it would be:

$filesystem->chmod('file.txt', 0777);

@taylorotwell taylorotwell merged commit 77ac02a into laravel:5.3 Nov 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants