Opened 16 years ago
Closed 16 years ago
#10304 closed defect (bug) (fixed)
WP_Filesystem fixes
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 2.9 | Priority: | normal |
Severity: | normal | Version: | 2.8 |
Component: | Filesystem API | Keywords: | |
Focuses: | Cc: |
Description
Fixes and improvements to the WP_Filesystem classes as discussed in #10170:
- Remove settings for default permission and use
FS_CHMOD_FILE
andFS_CHMOD_DIR
- Do chmod after creating directories to ensure proper permissions
Attachments (1)
Change History (8)
#2
follow-up:
↓ 4
@
16 years ago
Do chmod after creating directories to ensure proper permissions
Note: This was fixed for the Direct Class in #10170, It shouldnt be an issue in the other classes due to the original problem being php's mkdir() and umasks.
#4
in reply to:
↑ 2
@
16 years ago
Replying to dd32:
Note: This was fixed for the Direct Class in #10170, It shouldn't be an issue in the other classes due to the original problem being php's mkdir() and umasks.
Yes, that exists in the other classes except in WP_Filesystem_SSH2 where it would need some testing.
Are we removing WP_Filesystem_Base::gethchmod()
or are we going to fix it. It seems it needs the permissions as decimal int to work properly.
Replying to Denis-de-Bernardy:
Do we get this in 2.8.1 too, or is it going to be 2.9-only material?
It would need more testing and may introduce some plugins incompatibilities as the setDefaultPermissions()
method is gone. Don't think there will be enough time to test it properly for 2.8.1.
#5
@
16 years ago
Functions worthwhile removing:
- setDefaultPermissions()
- find_base_dir() - Deprecated in 2.7
- get_base_dir() - Deprecated in 2.7
- gethchmod() - Not used within core, If a plugin needs it, It might as well add it itself so it knows it works.
- Remove some vals from dirlist() that reference gethchmod() (or a variant of it if returned from 3rd-party items already)
- Should make getchmod() return 0xxx for all classes under all OS's.
- Also should consider removing any methods from Direct which are not supported by the FTP's, Theres a heap of those.. Just so people dont rely on it and find it doesnt work.
- rmdir() should be redirected to delete() is almost all cases.
- SSH2 needs investigating with regard to using the ssh file wrapper, and maybe a fallback case in there for systems where that cant be used - #10195
Merged 10170.2.patch and 10170.2.diff but kept the $mode optional in $this->chmod. As we have the constants with the proper permissions may as well set them there.
mkdir
in WP_Filesystem_SSH2 will need more testing, mainly forssh2_sftp_mkdir()
with different permissions.