Make new directory.

@param array|string $paths
542644
protected function makeDir($paths = '')
    {
        foreach ((array) $paths as $path) {
            $path = $this->extensionPath($path);

            $this->filesystem->makeDirectory($path, 0755, true, true);
        }
    }
894988
protected function makeDirectory($path)
    {
        if (! $this->fileHelper->exists($path)) {
            $this->fileHelper->makeDirectory($path, 0777, true, true);
        }
    }
45790
public function addDirs($dirs) {
        if(!is_array($dirs)) {
            $dirs = array($dirs);
        }

        $this->dirs = array_merge($this->dirs, $dirs);
    }
979675
public function addTorrents($paths)
    {
        if (is_array($paths)) {
            $paths = implode(' ', $paths);
        }
        $this->execute('transmission-remote ' . $this->getAuthFlag() . ' -a ' . $paths);
    }
994657
protected function fixRelativePaths(array $paths)
    {
        $base = dirname($this->path);
        $base = ($base === '.') ? '' : "{$base}/";

        array_walk_recursive(
            $paths,
            function (&$path) use ($base) {
                $path = "{$base}{$path}";
            }
        );
        return $paths;
    }
1304083
public static function makeFromFiles(string ...$paths): ConfigCollection
    {
        $definitions = array_map(function (string $path): array {
            try {
                // Toml::parseFile might return void / null.
                $definitions = (array) Toml::parseFile($path);

                // See: Automattic/VIP-Coding-Standards#144 on Github.
                // phpcs:ignore WordPressVIPMinimum.Variables.VariableAnalysis.UnusedVariable
            } catch (ParseException $_parseException) {
                // Assume empty config.
                $definitions = [];
            }

            return $definitions;
        }, $paths);

        $mergedDefinitions = array_reduce($definitions, function (array $merged, array $definition): array {
            return self::arrayMergeRecursiveDistinct($merged, $definition);
        }, []);

        return new ConfigCollection($mergedDefinitions);
    }
1359761
public function sharedFilesAndDirs(array $paths = []): self
    {
        $this->sharedDirs = [];
        $this->sharedFiles = [];

        foreach ($paths as $path) {
            $this->validatePathIsRelativeToProject($path, __METHOD__);
            if (is_dir($this->localProjectDir.DIRECTORY_SEPARATOR.$path)) {
                $this->sharedDirs[] = rtrim($path, DIRECTORY_SEPARATOR);
            } else {
                $this->sharedFiles[] = $path;
            }
        }

        return $this;
    }
732467
public static function setPermission(array $paths)
    {
        foreach ($paths as $path => $permission) {
            echo "chmod('$path', $permission)...";
            if (is_dir($path) || is_file($path)) {
                try {
                    if (chmod($path, octdec($permission))) {
                        echo "done.\n";
                    };
                } catch (\Exception $e) {
                    echo $e->getMessage() . "\n";
                }
            } else {
                echo "file not found.\n";
            }
        }
    }
866269
private function createDir($path): void
    {
        if (! is_dir($path)) {
            mkdir($path, 0777, true);
            $this->info($path.' Has been created.');
        } else {
            $this->info($path.' Already created.');
        }
    }
684665
protected function autoCreateDirs(array $dirs): void
    {
        foreach ($dirs as $dir) {
            if (! $this->files->exists($dir) && ! empty($dir)) {
                $this->files->makeDirectory($dir, 0755, true);
            }
        }
    }
1153782
protected function makeDirectory(string $path): void
    {
        if (!$this->filesystem->isDirectory(dirname($path))) {
            $this->filesystem->makeDirectory(dirname($path), 0777, true, true);
        }
    }
1135916
public function addPath($path)
    {
        // just force to array
        settype($path, 'array');

        // loop through the path directories
        foreach ($path as $dir) {
            // no surrounding spaces allowed!
            $dir = trim($dir);

            // remove trailing slash
            if (substr($dir, -1) == DIRECTORY_SEPARATOR) {
                $dir = substr_replace($dir, '', -1);
            }

            // add to the top of the search dirs
            array_unshift($this->_paths, $dir);
        }
    }
1311988
public function setPaths(array $paths)
    {
        foreach ($paths as $value) {
            $this->ensureString(
                $value,
                'All the elements from array must be strings'
            );
        }

        $this->paths = $paths;

        return $this;
    }
496176
public function addSubdirectories(array $directories)
    {
        foreach ($directories as $dir) {
            $this->subdirs[$dir] = $dir;
        }

        return $this;
    }
204717
public function makeDirectory($path)
    {
        $this->fs[$path] = $this->newDir();
        $this->fs[$path]->setPath($path);
        return $this->fs[$path];
    }
796099
protected function createDirectory($filePath)
    {
        $parts = explode('/', $filePath);
        $file = array_pop($parts);
        $dir = '';
        foreach ($parts as $part) {
            if (!is_dir($dir .= "/$part")) {
                mkdir($dir);
            }
        }
    }
816436
public static function createFolder($path)
    {
        if (!file_exists($path)) {
            self::createFolder(dirname($path));
            mkdir($path, 0777);
        }
    }