Make folder

@param string $path

@return bool
331799
public static function mkDir($path)
    {
        if (file_exists($path)) {
            return false;
        }

        $umask = umask();
        $res = @mkdir($path, Constants::FILESYSTEM_DIR_PERMISSIONS_DEFAULT, true);
        if ($res === false) {
            throw new RuntimeException('Can not create directory "' . $path . '" - no permissions.');
        }
        umask($umask);

        return $res;
    }
1260846
public function createFolder($path)
    {
        $pathinfo = pathinfo($path);

        $parentDir = ($pathinfo['dirname'] != '.') ? $pathinfo['dirname'] : '';
        $url = self::BASE_URI.$this->getFolderUrl($parentDir).'children';

        $folder = new Folder();
        $folder->name = $pathinfo['basename'];

        return $this->getResponse('POST', $url, json_encode($folder), ['Content-Type' => 'application/json']);
    }
676471
public function makeDir($path, $auto_mkdir = false) {/*{{{*/
        $headers = array('Folder' => 'true');
        if ($auto_mkdir) $headers['Mkdir'] = 'true';
        return $this->_do_request('PUT', $path, $headers);
    }
85671
public static function create(string $path): self
    {
        if (!is_dir($path)) {
            if (is_writeable(dirname($path))) {
                if (mkdir($path)) {
                    return new static($path);
                }
                throw new FolderException('Creating folder ('.$path.') failed');
            }
            throw new FolderException('Cannot create folder, because the directory ('.dirname($path).') is not accessible',
                FolderException::NOT_WRITEABLE);
        }
        throw new FolderException('Cannot create folder, because the folder path ('.$path.') already exists', FolderException::ALREADY_EXIST);
    }
1367537
public function createFile($path)
    {
        $node = $this->at($path);
        if ($node !== null && $node->type == 'dir') {
            return false;
        }

        $node = $this->at(dirname($path));
        if (null === $node) {
            return false;
        }

        $this->at($path, (object) [
            'type' => 'file',
            'perms' => 0664,
            'content' => ''
        ]);
        return true;
    }
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.");
            }
        }
    }
808967
public static function mkdir($path)
    {
        $path = Yii::getAlias($path);
        $path = rtrim(trim($path), '/');
        if (!file_exists($path)) {
            mkdir($path, 0777, true);
            Yii::warning('Created dir:  ' . $path . '/', 'file');

            return true;
        }

        return false;
    }
608367
public function getFolder($path = '')
    {
        if (!array_key_exists($path,$this->folders)) {

            $this->folders[$path] = false;

            $url = 'files';
            $path = trim($path, '/');
            if ($path != '') {
                $url .= '/' . $path;
            }

            $response = $this->getClient()->get($url);
            $json = $response->json();

            if ($json) {

                if ($this->publicUrl != false) {
                    $files = [];
                    foreach ($json['files'] as $file) {
                        $file['urls']['default'] = $this->publicUrl . '/' . $file['id'];
                        $files[] = $file;
                    }
                    $json['files'] = $files;
                }
                $folder = new Folder($path, $json);


                $this->folders[$path] = $folder;
            }

        }

        return $this->folders[$path];
    }
340352
public static function makeFileDirs($path) {
        //必须考虑 "/" 和 "\" 两种目录分隔符
        $files = preg_split('/[\/|\\\]/s', $path);
        $_dir = '';
        foreach ($files as $value) {
            $_dir .= $value.DIRECTORY_SEPARATOR;
            if ( !file_exists($_dir) ) {
                mkdir($_dir);
            }
        }
        return true;
	}
862739
public static function folder($path, $relative = false)
		{
		    $path = Paths::make($path, $relative);
		    return rtrim($path, '/') . '/';
		}
1256208
protected function createCacheDirectory($path): bool
    {
        if (
            !$path
            ||
            $path === '/'
            ||
            $path === '.'
            ||
            $path === '\\'
        ) {
            return false;
        }

        // if the directory already exists, just return true
        if (\is_dir($path) && \is_writable($path)) {
            return true;
        }

        // if more than one level, try parent first
        if (\dirname($path) !== '.') {
            $return = $this->createCacheDirectory(\dirname($path));
            // if creating parent fails, we can abort immediately
            if (!$return) {
                return false;
            }
        }

        $mode_dec = \intval($this->fileMode, 8);
        $old_umask = \umask(0);

        /** @noinspection PhpUsageOfSilenceOperatorInspection */
        if (!@\mkdir($path, $mode_dec) && !\is_dir($path)) {
            $return = false;
        } else {
            $return = true;
        }

        if (\is_dir($path) && !\is_writable($path)) {
            $return = \chmod($path, $mode_dec);
        }

        \umask($old_umask);

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

        return $this;
    }
32368
public static function mkdir(string $path)
    {
        if (!is_dir($path))
        {
            mkdir($path, self::$dir_mode, true);
        }
    }
745130
public function createFolder($path) : bool
	{
		$path = $this->normalizePath($path);
		
		// Check if the path contains folders we dont want to create
		if (str_contains($path, $this->folderPathExcludeList)) {
			return true;
		}
		
		$this->folderPath = '/sites/'.$this->siteName.'/Shared%20Documents';
		
		$requestUrl = $this->siteUrl.'/sites/'.$this->siteName.'/_api/Web/folders';
		
		$this->requestHeaders['Content-Type'] = 'application/json;odata=verbose';
		
		$folderAttributes = [
			'__metadata' => [
				'type' => 'SP.Folder',
			],
			'ServerRelativeUrl' => $this->folderPath.$path,
		];
		
		$options = [
			'headers' => $this->requestHeaders,
			'body' => json_encode($folderAttributes)
		];
		
		$response = $this->send('POST', $requestUrl, $options);
		
		return $response->getStatusCode() === 200 ? true : false;
	}
126111
protected function createDirectory($path)
    {
        if (!File::isDirectory($path)) {
            File::makeDirectory($path, 0777, true, true);
        }

        return $this;
    }
307395
public function addFolder(string $path): self
    {
        Arr::unShift($this->folders, $path);

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

        return $path;
    }