public function createPath($base, $path)
    {
        if (!is_dir($base) || !is_writable($base)) {
            return false;
        }

        if (empty($path)) {
            return false;
        }

        $pieces = explode(self::DS, $path);
        $dir = $base;
        foreach ($pieces as $directory) {
            if (empty($directory)) {
                // @codeCoverageIgnoreStart
                continue; // Handle the / from the exploded path
                // @codeCoverageIgnoreEnd
            }

            $singlePath = $dir . self::DS . $directory;
            if (!file_exists($singlePath) || !is_dir($singlePath)) {
                $create = @mkdir($singlePath);
                if ($create === false) {
                    // @codeCoverageIgnoreStart
                    return false;
                    // @codeCoverageIgnoreEnd
                }
            }
            $dir = $singlePath;
        }

        return true;
    }
public function createPath($base, $path)
    {
        if (!is_dir($base) || !is_writable($base)) {
            return false;
        }

        if (empty($path)) {
            return false;
        }

        $pieces = explode(self::DS, $path);
        $dir = $base;
        foreach ($pieces as $directory) {
            if (empty($directory)) {
                // @codeCoverageIgnoreStart
                continue; // Handle the / from the exploded path
                // @codeCoverageIgnoreEnd
            }

            $singlePath = $dir . self::DS . $directory;
            if (!file_exists($singlePath) || !is_dir($singlePath)) {
                $create = @mkdir($singlePath);
                if ($create === false) {
                    // @codeCoverageIgnoreStart
                    return false;
                    // @codeCoverageIgnoreEnd
                }
            }
            $dir = $singlePath;
        }

        return true;
    }
public function createPath ( $ base , $ path ) { if ( ! is_dir ( $ base ) || ! is_writable ( $ base ) ) { return false ; } if ( empty ( $ path ) ) { return false ; } $ pieces = explode ( self :: DS , $ path ) ; $ dir = $ base ; foreach ( $ pieces as $ directory ) { if ( empty ( $ directory ) ) { // @codeCoverageIgnoreStart continue ; // Handle the / from the exploded path // @codeCoverageIgnoreEnd } $ singlePath = $ dir . self :: DS . $ directory ; if ( ! file_exists ( $ singlePath ) || ! is_dir ( $ singlePath ) ) { $ create = @ mkdir ( $ singlePath ) ; if ( $ create === false ) { // @codeCoverageIgnoreStart return false ; // @codeCoverageIgnoreEnd } } $ dir = $ singlePath ; } return true ; }
Create a new path on top of a base directory
@param string $base
@param string $path
@return boolean
Create a new path on top of a base directory