|
|
|
@ -579,33 +579,38 @@ class FileManager |
|
|
|
|
Database::query($query); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Like in Java, creates the directory named by this abstract pathname, |
|
|
|
|
* including any necessary but nonexistent parent directories. |
|
|
|
|
* |
|
|
|
|
* @author Hugues Peeters <peeters@ipm.ucl.ac.be> |
|
|
|
|
* @author Christophe Gesche <gesche@ipm.ucl.ac.be> |
|
|
|
|
* |
|
|
|
|
* @param string $path - path to create |
|
|
|
|
* @param string $mode - directory permission (default is '770') |
|
|
|
|
* |
|
|
|
|
* @return boolean TRUE if succeeds FALSE otherwise |
|
|
|
|
*/ |
|
|
|
|
function mkdirs($path, $mode = '0770') { |
|
|
|
|
if (file_exists($path)) { |
|
|
|
|
return false; |
|
|
|
|
} else { |
|
|
|
|
FileManager :: mkdirs(dirname($path), $mode); |
|
|
|
|
//mkdir($path, $mode); |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} //end class FileManager |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* DEPRECATED FUNCTIONS */ |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Like in Java, creates the directory named by this abstract pathname, |
|
|
|
|
* including any necessary but nonexistent parent directories. |
|
|
|
|
* |
|
|
|
|
* @author Hugues Peeters <peeters@ipm.ucl.ac.be> |
|
|
|
|
* @author Christophe Gesche <gesche@ipm.ucl.ac.be> |
|
|
|
|
* |
|
|
|
|
* @param string $path - path to create |
|
|
|
|
* @param string $mode - directory permission (default is '770') |
|
|
|
|
* |
|
|
|
|
* @return boolean TRUE if succeeds FALSE otherwise |
|
|
|
|
*/ |
|
|
|
|
function mkdirs($path, $mode = '0770') { |
|
|
|
|
if (file_exists($path)) { |
|
|
|
|
return false; |
|
|
|
|
} else { |
|
|
|
|
FileManager :: mkdirs(dirname($path), $mode); |
|
|
|
|
//mkdir($path, $mode); |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @deprecated 06-FEB-2010. The function mkdir() is able to create directories recursively. |
|
|
|
|
* @link http://php.net/manual/en/function.mkdir.php |
|
|
|
|