src/Generics/Util/Directory.php
public function create($recursive = false, $mode = 0755)
    {
        if ($this->exists()) {
            throw new DirectoryException("Directory {dir} already exists", array(
                'dir' => $this->path
            ));
        }
        
        if (mkdir($this->path, $mode, $recursive) === false) {
            throw new DirectoryException("Could not create the directory {dir}", array(
                'dir' => $this->path
            ));
        }
        $this->path = realpath($this->path);
    }
public function create($recursive = false, $mode = 0755)
    {
        if ($this->exists()) {
            throw new DirectoryException("Directory {dir} already exists", array(
                'dir' => $this->path
            ));
        }
        
        if (mkdir($this->path, $mode, $recursive) === false) {
            throw new DirectoryException("Could not create the directory {dir}", array(
                'dir' => $this->path
            ));
        }
        $this->path = realpath($this->path);
    }
Create a directory

@param boolean $recursive
Create also sub directories

@throws DirectoryException