Create a new folder on FTP server.

@param string    $dir           Folder to create on server (relative or absolute path).

@throws FtpException If folder creation failed.
355259
public function mkdir($dir) {
		$this->connectIfNeeded();
		$this->handle->mkdir($dir);
		$this->onFolderCreated(new Event(['sender' => $this, 'data' => $dir]));
	}
925365
public function loadPhpFiles($dir)
    {
        $files = Finder::create()->files()->name('*.php')->in($dir);
        foreach ($files as $file) {
            $this->loadFile($file->getRealpath());
        }

    }
529864
public static function createDir($dir)
    {
        try {
            if (!is_dir($dir) && @mkdir($dir, 0775, true) === false) {
                throw new \Exception(t('Can\'t create directory ') . $dir);
            }
        } catch (\Exception $e) {
            Logger::log($e->getMessage(), LOG_WARNING);
            if (!file_exists(dirname($dir))) {
                throw new GeneratorException($e->getMessage() . $dir);
            }
        }
    }
83528
private function createDir($path)
    {
        if (!is_dir($path)) {
            $success = mkdir($path, 0775, true);
            if (!$success) {
                throw new \Exception("Cannot create folder {$path}. Check file system permissions.");
            }
        }
    }
1056870
public function setDir($dir) {
        if (false === in_array($dir, DataTablesEnumerator::enumDirs())) {
            $dir = self::DATATABLES_DIR_ASC;
        }
        $this->dir = strtoupper($dir);
        return $this;
    }
861893
public function createFolder(Folder $folder)
	{
		// validating folder before creation
		foreach ($this->folderUploadFilters as $filter) {
			$filter->validateFolder($folder);
		}

		$this->createBothFoldersInFileSystem($folder);
	}
484579
protected function createDirectory($directory)
    {
        $umask = umask(0);
        $created = mkdir($directory, 0777, true);
        umask($umask);

        if (!$created) {
            throw new StorageException(StorageException::DIRECTORY_COULD_NOT_BE_CREATED, [$directory]);
        }
    }
180568
protected function createDirectory($directory)
    {
        if (!$this->files->isDirectory($directory)) {
            $this->files->makeDirectory($directory, 0755, true);
        }
    }
889157
public function setCacheDir($dir)
    {
        $this->cacheDir = $dir;

        if (!is_dir($this->cacheDir)) {
            $this->createDir($this->cacheDir);
        }
    }
536490
public function rmdir($dir)
    {
        return ($this->isConnected() === true) ? ftp_rmdir($this->getConnection(), $dir) : false;
    }
1101805
protected function doChangeDir($dir)
    {
        $connection = $this->connection;

        return $this->retry(function () use ($connection, $dir) {
            $res = @ftp_chdir($connection, $dir);

            if (false === $res) {
                throw new \RuntimeException("Changing directory failed: ".$dir);
            }
        });
    }
1261626
protected function makeDir($directory)
	{
		if ( ! $this->files->isDirectory($this->getPath($directory)))
		{
			$this->files->makeDirectory($this->getPath($directory), 0777, true);
		}
	}
496975
public function setAuthDir($dir)
    {
        if (!file_exists($dir)) {
            throw new \Exception('Auth directory is not exists!');
        }

        if (!is_dir($dir)) {
            throw new \Exception('Auth directory is not exists!');
        }

        if ($this->security && $this->security->getKey()) {
            throw new \Exception('Auth directory must be set before key sets!');
        }

        $this->authDir = $dir;
        $this->security->setPath($dir);
    }
382247
public function setProjectDirectory(string $dir): Application
    {
        if (is_dir($dir)) {
            $this->projectDir = $dir;
        }

        return $this;
    }
642340
private function _createFile($dir, $name, $ext)
    {
        if (!empty($this->rootDir)) {
            if (!file_exists($this->_getFileDir($dir))) {
                mkdir($this->_getFileDir($dir), 0777, true);
            }
            if (!file_exists($this->_getFilePath($dir, $name, $ext))) {
                if (file_put_contents($this->_getFilePath($dir, $name, $ext), '') === false) {
                    throw new \Exception("Could not create $ext for {$this->username}.");
                }
            }
        }
    }
726096
protected function makeDirectory($dir)
    {
        $dir          = new PhingFile($dir);
        $relativePath = str_replace($this->getProject()->getBaseDir(), "", $dir->getAbsolutePath());
        if ($dir === null) {
            throw new BuildException(
                "dir attribute is required",
                $this->getLocation()
            );
        }

        if ($dir->isFile()) {
            throw new BuildException(
                "Unable to create directory as a file already exists with that name: .".$relativePath
            );
        }

        if (!$dir->exists()) {
            $result = $dir->mkdirs(0777 - umask());
            if (!$result) {
                if ($dir->exists()) {
                    $this->log("A different process or task has already created .".$relativePath);
                    return;
                }

                $msg = "Directory ".$dir->getAbsolutePath(
                )." creation was not successful for an unknown reason";
                throw new BuildException($msg, $this->getLocation());
            }

            $this->log("Created dir: .".$relativePath);
        } else {
            $this->log("Directory exists: .".$relativePath);
        }
    }
695423
public function setDir($dir)
    {
        if (empty($dir) || !@is_dir($dir)) {
            throw new PageCacheException(__METHOD__ . ': ' . (string)$dir . ' in constructor is not a directory');
        }

        // Check for trailing slash and add it if not exists
        if (mb_substr($dir, -1, 1) !== DIRECTORY_SEPARATOR) {
            $dir .= DIRECTORY_SEPARATOR;
        }

        $this->dir = $dir;
    }