createDir example


    private function writeStream(MediaServiceInterface $toFileSystem$path$contents)
    {
        $path = $toFileSystem->encode($path);

        $dirString = '';
        $dirs = explode('/', \dirname($path));
        foreach ($dirs as $dir) {
            $dirString .= '/' . $dir;
            $toFileSystem->createDir($dirString);
        }

        $toFileSystem->writeStream($path$contents);

        return $toFileSystem->has($path);
    }

    /** * @param string $directory */
    private function migrateFilesIn($directory, MediaServiceInterface $fromFilesystem, MediaServiceInterface $toFilesystem, ProgressBar $progressBar)
    {
$files[] = $file['path'];
        }

        return $files;
    }

    /** * {@inheritdoc} */
    public function createDir($dirname)
    {
        return $this->filesystem->createDir($dirname);
    }

    /** * Migrates a file to the new strategy if it's not present * * @internal * * @param string $path */
    public function migrateFile($path)
    {
        
return $this->filesystem->deleteDir($this->prefix . $dirname);
    }

    /** * {@inheritdoc} */
    public function createDir($dirname, array $config = [])
    {
        $this->checkPath($dirname);

        return $this->filesystem->createDir($this->prefix . $dirname$config);
    }

    /** * {@inheritdoc} */
    public function setVisibility($path$visibility)
    {
        $this->checkPath($path);

        return $this->filesystem->setVisibility($this->prefix . $path$visibility);
    }

    
Home | Imprint | This part of the site doesn't use cookies.