src/Alchemy/Component/Cerberus/Console/Cerberus.php
public static function createDir($strPath, $rights = 0777)
    {
        $folderPath = array($strPath);
        $oldumask = umask(0);

        while (!@is_dir(dirname(end($folderPath)))
            && dirname(end($folderPath)) != "/"
            && dirname(end($folderPath)) != "."
            && dirname(end($folderPath)) != ""
        ) {
            array_push($folderPath, dirname(end($folderPath)));
        }

        while ($parentFolderPath = array_pop($folderPath)) {
            if (!@is_dir($parentFolderPath)) {
                if (!@mkdir($parentFolderPath, $rights)) {
                    throw new \RuntimeException("Runtime Error: Can't create folder: $parentFolderPath");
                }
            }
        }

        umask($oldumask);
    }
public static function createDir($strPath, $rights = 0777)
    {
        $folderPath = array($strPath);
        $oldumask = umask(0);

        while (!@is_dir(dirname(end($folderPath)))
            && dirname(end($folderPath)) != "/"
            && dirname(end($folderPath)) != "."
            && dirname(end($folderPath)) != ""
        ) {
            array_push($folderPath, dirname(end($folderPath)));
        }

        while ($parentFolderPath = array_pop($folderPath)) {
            if (!@is_dir($parentFolderPath)) {
                if (!@mkdir($parentFolderPath, $rights)) {
                    throw new \RuntimeException("Runtime Error: Can't create folder: $parentFolderPath");
                }
            }
        }

        umask($oldumask);
    }
public static function createDir ( $ strPath , $ rights = 0777 ) { $ folderPath = array ( $ strPath ) ; $ oldumask = umask ( 0 ) ; while ( ! @ is_dir ( dirname ( end ( $ folderPath ) ) ) && dirname ( end ( $ folderPath ) ) != "/" && dirname ( end ( $ folderPath ) ) != "." && dirname ( end ( $ folderPath ) ) != "" ) { array_push ( $ folderPath , dirname ( end ( $ folderPath ) ) ) ; } while ( $ parentFolderPath = array_pop ( $ folderPath ) ) { if ( ! @ is_dir ( $ parentFolderPath ) ) { if ( ! @ mkdir ( $ parentFolderPath , $ rights ) ) { throw new \ RuntimeException ( "Runtime Error: Can't create folder: $parentFolderPath" ) ; } } } umask ( $ oldumask ) ; }
Creates a directory recursively
@param  string $strPath path
@param  integer $rights right for new directory
@throws \RuntimeException
Creates a directory recursively