Prado\IO\TTarFileExtractor::_dirCheck PHP Method

_dirCheck() protected method

Check if a directory exists and create it (including parent dirs) if not.
protected _dirCheck ( string $p_dir ) : boolean
$p_dir string directory to check
return boolean true if the directory exists or was created
    protected function _dirCheck($p_dir)
    {
        if (@is_dir($p_dir) || $p_dir == '') {
            return true;
        }
        $p_parent_dir = dirname($p_dir);
        if ($p_parent_dir != $p_dir && $p_parent_dir != '' && !$this->_dirCheck($p_parent_dir)) {
            return false;
        }
        if (!@mkdir($p_dir, PRADO_CHMOD)) {
            $this->_error("Unable to create directory '{$p_dir}'");
            return false;
        }
        chmod($p_dir, PRADO_CHMOD);
        return true;
    }