public static createFolders ( string $dirPath ) : boolean | ||
$dirPath | string | path do diretorio a ser criado |
return | boolean |
public static function createFolders($dirPath)
{
//monta a arvore de diretórios necessária e estabelece permissões de acesso
self::createFolder($dirPath);
foreach (self::$ambientes as $ambiente) {
$folder = $dirPath . DIRECTORY_SEPARATOR . $ambiente;
self::createFolder($folder);
foreach (self::$subdirs as $subdir) {
$folder = $dirPath . DIRECTORY_SEPARATOR . $ambiente . DIRECTORY_SEPARATOR . $subdir;
self::createFolder($folder);
}
}
return true;
}
/** * zFolderMTest * @param string $path * @return array */ protected static function zFolderMTest($path = '') { $aResp = array('status' => true, 'msg' => ''); if ($path != '') { try { FilesFolders::createFolders($path); } catch (RuntimeException $e) { $aResp = array('status' => false, 'msg' => $e->getMessage()); } } return $aResp; }