public function createDir($path)
    {
        $directory = $this->getPath($path);
        if (!is_dir($directory)) {
            if (file_exists($directory)) {
                throw new RuntimeException(
                    $directory . ' is not a directory.'
                );
            }

            if (!mkdir($directory, 0777, true)) {
                throw new RuntimeException(
                    $directory . ' can not be created.'
                );
            }
        }

        return true;
    }
public function createDir($path)
    {
        $directory = $this->getPath($path);
        if (!is_dir($directory)) {
            if (file_exists($directory)) {
                throw new RuntimeException(
                    $directory . ' is not a directory.'
                );
            }

            if (!mkdir($directory, 0777, true)) {
                throw new RuntimeException(
                    $directory . ' can not be created.'
                );
            }
        }

        return true;
    }
public function createDir ( $ path ) { $ directory = $ this -> getPath ( $ path ) ; if ( ! is_dir ( $ directory ) ) { if ( file_exists ( $ directory ) ) { throw new RuntimeException ( $ directory . ' is not a directory.' ) ; } if ( ! mkdir ( $ directory , 0777 , true ) ) { throw new RuntimeException ( $ directory . ' can not be created.' ) ; } } return true ; }
Create a directory if it does not exist.

@param string $path

@return bool

@throws RuntimeException When the directory can not be created.
Create a directory if it does not exist .