@param string $save_path
'/path', 'N;/path', or 'N;octal-mode;/path

@param string $name

@return bool

@throws \InvalidArgumentException
768309
public function open($save_path, $name)
    {
        $this->name = $name;

        if (!$save_path) {
            throw new \InvalidArgumentException("Invalid argument \$save_path '$save_path'");
        }

        $count = substr_count($save_path, ';');
        if ($count > 2) {
            throw new \InvalidArgumentException("Invalid argument \$save_path '$save_path'");
        }

        if ($count) {
            $pieces = explode(';', $save_path);
            $save_path = array_pop($pieces);
        }

        if (!is_dir($save_path)) {
            mkdir($save_path, 0777, true);
        }

        $this->path = rtrim($save_path, '/\\');
        if (!is_writable($this->path)) {
            throw new \InvalidArgumentException("\$save_path is not writable '$save_path'");
        }

        return true;
    }
1186920
public function createFile($attribute, $path, $name)
    {
        $handlerCreateFile = $this->fileOption($attribute, 'createFile');
        $file = $handlerCreateFile($path, $name);
        if ($file) {
            $storage = $this->fileStorage($attribute);
            $contents = file_get_contents($path);
            $handlerTemplatePath = $this->fileOption($attribute, 'templatePath');
            if ($storage->write($handlerTemplatePath($file), $contents)) {
                $this->setState($attribute, $file);
                $this->owner->{$attribute} = $file->id;
                return $file;
            }
        } // @codeCoverageIgnore
        return false; // @codeCoverageIgnore
    }
964299
public function savePath($path = null)
    {
        if ($path === null) {
            return session_save_path();
        }
        if ($this->isOpen) {
            throw new \InvalidArgumentException('The session has already been opened.');
        }
        if (!is_string($path)) {
            throw new \InvalidArgumentException('Session path must be null or a string');
        }
        if (!is_dir($path)) {
            throw new \InvalidArgumentException("Path not found: {$path}");
        }
        session_save_path($path);
    }
908994
public function upload($name)
    {
        // When $_FILES[$name]['name'] empty

        if ( empty($_FILES[$name]['name']) )
        {
            $this->error($this->errors['empty'], 0, true);

            return false;
        }

        $this->files = $_FILES[$name];

        // When the directory is not exist.
        if( !file_exists($this->savePath) )
        {
            $this->error($this->errors['not_exist'], 0, true);

            return false;
        }

        // When the directory is not written
        if( !is_writable($this->savePath) )
        {
            $this->error($this->errors['unwritable'], 0, true);

            return false;
        }

        return $this->moveFile();
    }
1193551
public function open($save_path, $session_name)
    {
        $this->key = $this->getKey('KEY_' . $session_name);
        return parent::open($save_path, $session_name);
    }
939749
public function open(string $savePath, string $name)
    {
        if ($this->isProxy) {
            $this->redis = $this->getRedisProxy($savePath);
        } else {
            $this->redis = $this->getRedisPool($savePath);
        }
        $this->savePath    = $savePath;
        $this->sessionName = $name;
        return true;
    }
870093
public function saveThumb($path = '', $filename = '')
    {

        if (empty($this->filename)) return false;
        try {
            $save_name = (empty($path) ? $this->path : $path);
            $save_name = "$save_name/" . (empty($filename) ? 'th_' . $this->filename : $filename);
            $this->imagemagik->writeImage($save_name);
        } catch (\ImagickException $e) {
            throw $e;
        }

        return $this->open($save_name);
    }
473905
protected function getPathArgument($name, $realpath = true, $command = null)
    {
        if (null == $command) {
            $command = $this->getParseResult()->command;
        }
        $path = isset($command->args[$name]) ? $command->args[$name] : \getcwd();

        if (!$this->isAbsolute($path)) { // not an absolute path
            $path = \getcwd() . '/./' . $path;
        }

        if ($realpath) {
            $path = realpath($path);
        }

        return $path;
    }
849184
protected function getPath($file_name, $path='controller'){
        if($path == "controller"){
            return './app/Http/Controllers/Admin/' . $file_name . '.php';

        } elseif($path == "model"){
            return './app/'.$file_name.'.php';

        } elseif($path == "seed"){
            return './database/seeds/'.$file_name.'.php';

        } elseif($path == "view-index"){
            return './resources/views/admin/'.$file_name.'/index.blade.php';

        } elseif($path == "view-edit"){
            return './resources/views/admin/'.$file_name.'/edit.blade.php';

        } elseif($path == "view-show"){
            return './resources/views/admin/'.$file_name.'/show.blade.php';

        } elseif($path == "view-create"){
            return './resources/views/admin/'.$file_name.'/create.blade.php';

        }
    }
808103
protected function _mkdir($path, $name) {
		return $this->make($path, $name, 'directory') ? $this->_joinPath($path, $name) : false;
	}
297334
public function open($save_path, $name)
	{
		$this->database = RedisDatabase::connect('default');
		$this->database->connect();
	}
401897
protected function findInPaths($name, array $paths)
    {
        foreach ($paths as $path) {
            foreach ($this->getPossibleViewFiles($name) as $fileName) {
                $viewPath = $path .DS .$fileName;

                if ($this->files->exists($viewPath)) {
                    return $viewPath;
                }
            }
        }

        throw new \InvalidArgumentException("View [$name] not found.");
    }
443182
protected function search( $name, $path, $root ) {

    // check root existance and then try to find the original full named class file
    $path = ltrim( implode( DIRECTORY_SEPARATOR, $path ) . DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR );
    if( $this->read( $name, $path, $root ) ) return true;
    else {

      // try to tokenize the class name (based on camel or TitleCase) to support for nested classes
      $tmp = $this->explode( $name );
      foreach( $tmp as $name ) if( $this->read( $name, $path, $root ) ) {
        return true;
      }

      return false;
    }
  }
735332
protected function _mkfile($path, $name) {
		$path = $path.DIRECTORY_SEPARATOR.$name;
		
		if (($fp = @fopen($path, 'w'))) {
			@fclose($fp);
			@chmod($path, $this->options['fileMode']);
			return $path;
		}
		return false;
	}
1172045
public function create($name, $path, $table = null, $create = false)
    {
        $path = $this->getPath($name, $path);

        // First we will get the stub file for the migration, which serves as a type
        // of template for the migration. Once we have those we will populate the
        // various place-holders, save the file, and run the post create event.
        $stub = $this->getStub($table, $create);

        $this->files->put($path, $this->populateStub($name, $stub, $table));

        $this->firePostCreateHooks();

        return $path;
    }
896141
public function save($name = null, $path = null)
	{
		$parameters = [];

		/**
		 * @var mixed   $name Имя, под которым файл следует сохранить в папку «Загрузки»
		 */
		if (is_string($name))
		{
			$parameters['name'] = $name;
		}
		else if ($name instanceof Closed)
		{
			$parameters['name'] = substr(strrchr($name->getPath(), '/'), 1);
		}

		/**
		 * @var string  $path (необязательный)
		 * Путь внутри публичной папки. Следует указать, если в значении параметра public_key передан
		 * ключ публичной папки, в которой находится нужный файл.
		 * Путь в значении параметра следует кодировать в URL-формате.
		 */
		if (is_string($path))
		{
			$parameters['path'] = $path;
		}
		else if ($this->getPath() !== null)
		{
			$parameters['path'] = $this->getPath();
		}

		/**
		 * Если к моменту ответа запрос удалось обработать без ошибок, API отвечает кодом 201 Created и возвращает
		 * ссылку на сохраненный файл в теле ответа (в объекте Link).
		 * Если операция сохранения была запущена, но еще не завершилась, Яндекс.Диск отвечает кодом 202 Accepted.
		 */
		$response = $this->client->send((new Request($this->uri->withPath($this->uri->getPath()
			.'public/resources/save-to-disk')
		                                                       ->withQuery(http_build_query([
					'public_key' => $this->getPublicKey()
				] + $parameters, null, '&')), 'POST')));

		if ($response->getStatusCode() == 202 || $response->getStatusCode() == 201)
		{
			$response = json_decode($response->getBody(), true);

			if (isset($response['operation']))
			{
				$response['operation'] = $this->client->getOperation($response['operation']);
				$this->emit('operation', $response['operation'], $this, $this->client);
				$this->client->emit('operation', $response['operation'], $this, $this->client);

				return $response['operation'];
			}

			if (isset($response['href']))
			{
				parse_str((new Uri($response['href']))->getQuery(), $path);

				if (isset($path['path']))
				{
					return $this->client->getResource($path['path']);
				}
			}
		}

		return false;
	}
289280
protected function findInPaths($name, $paths)
    {
        foreach ((array) $paths as $path) {
            foreach ($this->getPossibleViewFiles($name) as $file) {
                if (is_file($viewPath = $path . '/' . $file)) {
                    return $viewPath;
                }
            }
        }

        throw new InvalidArgumentException("View [$name] not found.");
    }