Gaufrette\Adapter\Ftp::ensureDirectoryExists PHP Method

ensureDirectoryExists() protected method

Ensures the specified directory exists. If it does not, and the create parameter is set to TRUE, it tries to create it.
protected ensureDirectoryExists ( string $directory, boolean $create = false )
$directory string
$create boolean Whether to create the directory if it does not exist
    protected function ensureDirectoryExists($directory, $create = false)
    {
        if (!$this->isDir($directory)) {
            if (!$create) {
                throw new \RuntimeException(sprintf('The directory \'%s\' does not exist.', $directory));
            }
            $this->createDirectory($directory);
        }
    }