Require a directory.

@param  string  $path
@return \Basset\Directory
438966
public function requireDirectory($path = null)
    {
        if ( ! is_null($path))
        {
            return $this->directory($path)->requireDirectory();
        }

        if ($iterator = $this->iterateDirectory($this->path))
        {
            return $this->processRequire($iterator);
        }

        return $this;
    }
119912
protected function makeDirectory($path): string
    {
        if (! $this->laravel['files']->isDirectory($path)) {
            $this->laravel['files']->makeDirectory($path, 0777, true, true);
        }

        return $path;
    }
180127
public function makeDirectory($path)
    {
        if ($this->files->isDirectory($path) === false) {
            $this->files->makeDirectory($path, 0777, true, true);
        }

        return $this;
    }
1340956
public function requireFile($path)
    {
        if (false == empty($this->basePath)) {
            return require "{$this->basePath}/{$this->localPath}/{$path}";
        }

        $code = $this->filesystem->read($this->localPath."/{$path}");

        return eval(str_replace('<?php ', '', $code));
    }
1179972
protected function makeDirectory($path)
    {
        if (!is_dir(dirname($path))) {
            mkdir(dirname($path), 0777, true);
        }

        return $path;
    }
644839
protected function makePath($path)
    {
        return $this->context->directory ? $this->context->directory.'/'.$path : $path;
    }
353690
public function setPath(string $path): self
    {
        $realpath = realpath($path);
        if ($path && $path === $realpath) {
            $this->path = $path . DIRECTORY_SEPARATOR;
        }

        return $this;
    }
204717
public function makeDirectory($path)
    {
        $this->fs[$path] = $this->newDir();
        $this->fs[$path]->setPath($path);
        return $this->fs[$path];
    }
262295
public function withPath($path)
    {
        if (!is_string($path)) {
            throw new \InvalidArgumentException('Invalid path provided; must be a string');
        }
        $path = $this->filterPath($path);

        $new = clone $this;
        $new->path = $path;

        return $new;
    }
402932
public static function get($path)
    {
        if (is_dir($path)) {
            return new filesystem\Directory($path);
        }
        return new filesystem\File($path);
    }
724699
public static function fromUnReadableFile($path)
    {
        if (! file_exists($path)) {
            return new self(sprintf('Invalid path provided, the path "%s" does not seem to exist', $path));
        }

        if (is_dir($path)) {
            return new self(sprintf('The provided path "%s" is a directory, and it cannot be read as a file', $path));
        }

        return new self(sprintf('The provided path "%s" is invalid', $path));
    }
339691
private function createPathIfNeeded($path)
	{
		return  !(!\is_dir($path) && !@\mkdir($path, 0777 & (~$this->umask), true) && !\is_dir($path));
	}
257673
public function setDirectory($path) {
        if (substr($path, -1) !== '/') {
            $path .= '/';
        }

        if (!file_exists($path)) {
            mkdir($path, 0777, true);

        } else if (!is_writable($path)) {
            chmod($path, 0777);
        }

        $this->_directory = $path;

        return $this;
    }
179947
protected function makeDirectories(string $path)
    {
        $directoryName = dirname($path);

        if (!$this->fileSystem->isDirectory($directoryName)) {
            $this->fileSystem->makeDirectory($directoryName, 0777, true);
        }
    }
1332717
public function directory($path = null)
    {
        if (null === $path) {
            return $this->plates->getDirectory();
        }

        return $this->plates->getDirectory().'/'.$path;
    }
594158
public function addPath($path)
	{
		$path = rtrim($path, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR;
		$this->finder->addPath($path);

		if ($this->environment)
		{
			$this->finder->addPath($path.$this->environment);
		}

		return $this;
	}
69192
public function withPath($path = __DIR__)
    {
        $before = get_declared_classes();

        $iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($path));
        foreach ($iterator as $item) {
            if (!$item->isDir() && substr($item->getPathname(), -4) == '.php') {
                require_once $item->getPathname();
            }
        }

        $after    = get_declared_classes();
        $commands = array_diff($after, $before);

        $this->withCommands($commands);

        return $this;
    }