| @@ 56-65 (lines=10) @@ | ||
| 53 | * @param string $path |
|
| 54 | * @return bool |
|
| 55 | */ |
|
| 56 | public static function writable($path) |
|
| 57 | { |
|
| 58 | $path = Normalize::diskFullPath($path); |
|
| 59 | ||
| 60 | if (!self::exist($path)) { |
|
| 61 | return false; |
|
| 62 | } |
|
| 63 | ||
| 64 | return is_writable($path); |
|
| 65 | } |
|
| 66 | ||
| 67 | /** |
|
| 68 | * Check is file executable |
|
| @@ 32-41 (lines=10) @@ | ||
| 29 | * @param string $path |
|
| 30 | * @return bool |
|
| 31 | */ |
|
| 32 | public static function writable($path) |
|
| 33 | { |
|
| 34 | $path = Normalize::diskFullPath($path); |
|
| 35 | ||
| 36 | if (!self::exist($path)) { |
|
| 37 | return false; |
|
| 38 | } |
|
| 39 | ||
| 40 | return (is_dir($path) && is_writable($path)); |
|
| 41 | } |
|
| 42 | ||
| 43 | /** |
|
| 44 | * Create directory with recursive support. |
|
| @@ 49-58 (lines=10) @@ | ||
| 46 | * @param int $chmod |
|
| 47 | * @return bool |
|
| 48 | */ |
|
| 49 | public static function create($path, $chmod = 0755) |
|
| 50 | { |
|
| 51 | $path = Normalize::diskFullPath($path); |
|
| 52 | ||
| 53 | if (self::exist($path)) { |
|
| 54 | return false; |
|
| 55 | } |
|
| 56 | ||
| 57 | return @mkdir($path, $chmod, true); |
|
| 58 | } |
|
| 59 | ||
| 60 | /** |
|
| 61 | * Remove directory recursive. |
|