public function makeDirectory( $mode = NULL )
    {
        $mode = $mode ? $mode : 0777;

        if ( file_exists($this->path) ){
            if ( is_file($this->path) ){
                throw new MakeDirectoryException($this);
            }
            return;
        }

        $parent_dir = $this->getParent();

        if ( !$parent_dir->exists() ){
            $parent_dir->makeDirectory( $mode );
        }

        $res = @mkdir( $this->path, $mode );
        if ( $res === FALSE ){
            throw new MakeDirectoryException($this);
        }
    }
public function makeDirectory( $mode = NULL )
    {
        $mode = $mode ? $mode : 0777;

        if ( file_exists($this->path) ){
            if ( is_file($this->path) ){
                throw new MakeDirectoryException($this);
            }
            return;
        }

        $parent_dir = $this->getParent();

        if ( !$parent_dir->exists() ){
            $parent_dir->makeDirectory( $mode );
        }

        $res = @mkdir( $this->path, $mode );
        if ( $res === FALSE ){
            throw new MakeDirectoryException($this);
        }
    }
public function makeDirectory ( $ mode = NULL ) { $ mode = $ mode ? $ mode : 0777 ; if ( file_exists ( $ this -> path ) ) { if ( is_file ( $ this -> path ) ) { throw new MakeDirectoryException ( $ this ) ; } return ; } $ parent_dir = $ this -> getParent ( ) ; if ( ! $ parent_dir -> exists ( ) ) { $ parent_dir -> makeDirectory ( $ mode ) ; } $ res = @ mkdir ( $ this -> path , $ mode ) ; if ( $ res === FALSE ) { throw new MakeDirectoryException ( $ this ) ; } }
Create empty directory

@param string $mode                  File mode.If this parameter is set NULL, 0777 will be applied.

@return void

@throws MakeDirectoryException
Create empty directory