CFile::createDir PHP Method

createDir() public method

Creates empty directory defined either through {@link set} or through the $directory parameter.
public createDir ( integer | string $permissions = 492, null | string $directory = null ) : boolean | CFile
$permissions integer | string Access permissions for the directory
$directory null | string Parameter used to create directory other than supplied by {@link set} method of the CFile
return boolean | CFile Updated the current CFile object on success, 'False' on fail.
    public function createDir($permissions = 0754, $directory = null)
    {
        if ($directory === null) {
            $dir = $this->_realpath;
        } else {
            $dir = $directory;
        }
        if (@mkdir($dir, $permissions, True)) {
            if (!$directory) {
                return $this->set($dir);
            } else {
                return True;
            }
        }
        $this->addLog('Unable to create empty directory "' . $dir . '"');
        return False;
    }