elFinder\elFinderVolumeDriver::mkdir PHP Method

mkdir() public method

Create directory and return dir info
Author: Dmitry (dio) Levashov
public mkdir ( string $dst, string $name ) : array | false
$dst string destination directory
$name string directory name
return array | false
    public function mkdir($dst, $name)
    {
        if ($this->commandDisabled('mkdir')) {
            return $this->setError(elFinder::ERROR_PERM_DENIED);
        }
        if (!$this->nameAccepted($name)) {
            return $this->setError(elFinder::ERROR_INVALID_NAME);
        }
        if (($dir = $this->dir($dst)) == false) {
            return $this->setError(elFinder::ERROR_TRGDIR_NOT_FOUND, '#' . $dst);
        }
        if (!$dir['write']) {
            return $this->setError(elFinder::ERROR_PERM_DENIED);
        }
        $path = $this->decode($dst);
        $dst = $this->_joinPath($path, $name);
        $stat = $this->stat($dst);
        if (!empty($stat)) {
            return $this->setError(elFinder::ERROR_EXISTS, $name);
        }
        $this->clearcache();
        return ($path = $this->_mkdir($path, $name)) ? $this->stat($path) : false;
    }