mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-21 05:48:41 +00:00
File/directory create permission test
This commit is contained in:
parent
111494c1cc
commit
cc0e737182
|
|
@ -289,6 +289,10 @@ class Directory extends FileAbstract implements DirectoryInterface
|
|||
public static function create(string $path, string $permission = '0644', bool $recursive = false) : bool
|
||||
{
|
||||
if (!file_exists($path)) {
|
||||
if(!is_writable($path)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
mkdir($path, $permission, $recursive);
|
||||
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -315,6 +315,10 @@ class File extends FileAbstract implements FileInterface
|
|||
Directory::create(dirname($path), '0644', true);
|
||||
}
|
||||
|
||||
if(!is_writable($path)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
touch($path);
|
||||
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user