File tree 1 file changed +18
-0
lines changed
1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 16
16
use function getenv ;
17
17
use function getmyuid ;
18
18
use function in_array ;
19
+ use function is_dir ;
20
+ use function is_writable ;
21
+ use function mkdir ;
19
22
use function php_uname ;
20
23
use function posix_getuid ;
21
24
use function putenv ;
@@ -287,4 +290,19 @@ public static function isInteractive($fileDescriptor): bool
287
290
{
288
291
return function_exists ('posix_isatty ' ) && @posix_isatty ($ fileDescriptor );
289
292
}
293
+
294
+ /**
295
+ * Support the creation of hierarchical directories
296
+ *
297
+ * @param string $path
298
+ * @param int $mode
299
+ * @param bool $recursive
300
+ *
301
+ * @return bool
302
+ */
303
+ public static function mkdir (string $ path , int $ mode = 0775 , bool $ recursive = true ): bool
304
+ {
305
+ return (is_dir ($ path ) || !(!@mkdir ($ path , $ mode , $ recursive ) && !is_dir ($ path ))) && is_writable ($ path );
306
+ }
307
+
290
308
}
You can’t perform that action at this time.
0 commit comments