public static function mkdirs($dir, $mode = 0777, $recursive = true)
    {
        if (($dir === null) || $dir === '') {
            return false;
        }
        if (is_dir($dir) || $dir === '/') {
            return true;
        }
        if (self::mkdirs(dirname($dir), $mode, $recursive)) {
            return mkdir($dir, $mode);
        }
        return false;
    }
public static function mkdirs($dir, $mode = 0777, $recursive = true)
    {
        if (($dir === null) || $dir === '') {
            return false;
        }
        if (is_dir($dir) || $dir === '/') {
            return true;
        }
        if (self::mkdirs(dirname($dir), $mode, $recursive)) {
            return mkdir($dir, $mode);
        }
        return false;
    }
public static function mkdirs ( $ dir , $ mode = 0777 , $ recursive = true ) { if ( ( $ dir === null ) || $ dir === '' ) { return false ; } if ( is_dir ( $ dir ) || $ dir === '/' ) { return true ; } if ( self :: mkdirs ( dirname ( $ dir ) , $ mode , $ recursive ) ) { return mkdir ( $ dir , $ mode ) ; } return false ; }
Utility function to recursive directory creation

@param  string  $dir
@param  integer $mode
@param  boolean $recursive
@return boolean
Utility function to recursive directory creation