Sets the path to the directory holding the factory class file.

@param string $directory The absolute directory path.

@return static The current instance.
429314
public function setDirectory($directory)
    {
        Assert::stringNotEmpty($directory, 'The factory directory must be a non-empty string. Got: %s');

        $this->directory = Path::canonicalize($directory);

        return $this;
    }
1295562
protected function createParentDirectory($directory)
    {
        if (! $this->files->isDirectory($directory)) {
            $this->files->makeDirectory($directory, 0755, true);
        }
    }
367309
public function addFolder(string $directory, string $alias = '')
	{
		$loader = $this->getRenderer()->getLoader();

		// This can only be reliably tested with a loader using the filesystem loader's API
		if (method_exists($loader, 'addPath'))
		{
			if ($alias === '')
			{
				$alias = FilesystemLoader::MAIN_NAMESPACE;
			}

			$loader->addPath($directory, $alias);
		}

		return $this;
	}
575816
public function setTemplatesDirectory($directory)
    {
        $this->templatesDirectory = rtrim($directory, DIRECTORY_SEPARATOR);
		$this->engine->setDirectory($this->getTemplatesDirectory());
    }
395922
protected function runDir($directory)
    {
        if (is_array($directory)) {
            return $this->recurseArg($directory, array($this, "runDir"));
        } else {
            $curdir = getcwd();
            chdir($this->phpci->buildPath);

            $phpunit = $this->phpci->findBinary('phpunit');

            $cmd = $phpunit . ' --tap %s "%s"';
            $success = $this->phpci->executeCommand($cmd, $this->args, $this->phpci->buildPath . $directory);
            chdir($curdir);
            return $success;
        }
    }
988259
private function createDirectory($dir)
    {
        if (file_exists($dir)) {
            return $this;
        }
        if (false === @mkdir($dir, 0777, true)) {
            throw new \RuntimeException(sprintf('Unable to create directory "%s"', $dir));
        }
        return $this;
    }
625978
public function createDirectory(string $id): Directory
    {
        $path = $this->getDirectoryPath($id);
        $this->filesystem->createDir($path);

        return $this->directories[$id] = new static($this->filesystem, $path, $this->format);
    }
1175420
protected function createDirectory($directory)
    {
        $isCreated = file_exists($directory) || is_dir($directory) || mkdir($directory, 0777, true);
        
        if (!$isCreated)
            throw new RuntimeException('Cannot create directory ":dir" for generated classed', ['dir' => $directory]);
        
        return $this;
    }
220138
protected function createFileLocator($directory)
    {
        if (!is_dir($directory) || !is_readable($directory)) {
            throw new \InvalidArgumentException(sprintf('Could not create procedure loader as directory does not exist or is not readable: "%s"', $directory));
        }

        return new FileLocator($directory);
    }
408599
public function setSeedsDir($dir)
    {
        $this->seeds_dir = (string)$dir;
        if (!empty($this->seeds_dir)) {
            $this->seedCacheOptions[\xPDO::OPT_CACHE_PATH] = $this->blender->getSeedsPath().$dir.'/';
            $this->historyCacheOptions[\xPDO::OPT_CACHE_PATH] = $this->blender->getHistoryPath().$dir.'/';
        }
        return $this;
    }
468648
public function move($directory, $name = null)
    {
        $this->dir($directory);

        $this->name($name);

        return $this;
    }
109833
public function removeDirectory(string $directory)
    {
        $search = rtrim(strtr($directory, '\\', '/'), '/');

        return $this->setDirectories(array_filter($this->getDirectories(), function ($item) use ($search) {
            return rtrim(strtr($item, '\\', '/'), '/') !== $search;
        }));
    }
511597
public function CreateProjectDirectory($dir) {
		$filepath = "{$this->ProjectRoot}/{$dir}";

		if(!file_exists($filepath)) @mkdir($filepath,0777,true);
		if(!file_exists($filepath)) throw new Exception("unable to create {$dir}");

		return $this;
	}
1221998
public static function autocreate_directory($directory)
    {
        if (!file_exists($directory)) {
            mkdir($directory, 0777, true);
        }

        if (!is_writable($directory)) {
            throw new \Exception("Directory \"{$directory}\" is not writable");
        }
    }
1309147
private function createDirectory($directory)
    {
        if (is_dir($directory)) {
            return;
        }

        if (false === @mkdir($directory, 0777, true)) {
            throw new \RuntimeException(sprintf('Could not create directory "%s".', $dir));
        }
    }
713906
public function setDirectory($directory)
    {
        if (!is_dir($directory) && !is_writable($directory)) {
            throw new FileCacheException(
                sprintf('The directory "%s" is not directory and not writable', $directory)
            );
        }

        if (is_null($directory) && !$this->getFilesystem()->mkdir($directory, 0777, true)) {
            throw new FileCacheException(
                sprintf('The directory "%s" not be null and directory not be created')
            );
        }

        $this->directory = realpath($directory);
    }
333982
public static function SetDirectory($dir) {
    if (!is_dir($dir)) {
      if (!@\mkdir($dir, 0700, TRUE)) {
        throw new \InvalidArgumentException("dir $dir does not exist and could not be created");
      }
    }

    self::$DIR = realpath($dir);
  }