从 Stream 创建或更新文件

@param  string   $path
@param  resource $resource
@param  array    $config

@return bool
@throws \One\FileSystem\Exceptions\FileSystemException
494118
public function putStream(string $path, $resource, array $config = []): bool
    {
        $path = $this->normalizePath($path);
        $config = $this->prepareConfig($config);
        $this->rewindStream($resource);

        if (! $this->exists($path)) {
            return $this->getAdapter()->updateStream($path, $resource, $config);
        }

        return $this->getAdapter()->writeStream($path, $resource, $config);
    }
894591
public function handle($path, $localFilePath, array $config = [])
    {
        if (! method_exists($this->filesystem, 'getAdapter')) {
            return false;
        }

        if (! method_exists($this->filesystem->getAdapter(), 'putFile')) {
            return false;
        }

        $config = new Config($config);
        if (method_exists($this->filesystem, 'getConfig')) {
            $config->setFallback($this->filesystem->getConfig());
        }

        return (bool) $this->filesystem->getAdapter()->putFile($path, $localFilePath, $config);
    }
421502
public function phpConfigFile($path, array $config = [], $namespace = null)
    {
        $this->file($path)->text(Php\ConfigGenerator::generateText($config, $namespace));
    }
902421
public function writeStream($path, $resource, Config $config)
    {
        try{
            //获得一个临时文件
            $tmpfname       = FileFunction::getTmpFile();

            file_put_contents($tmpfname, $resource);

            $this->getOss()->uploadFile($this->bucket, $path, $tmpfname, $option = []);

            //删除临时文件
            FileFunction::deleteTmpFile($tmpfname);

            return true;
        }
        catch (OssException $e){

        }
        return false;
    }
1141113
public function copy($path, $newpath)
    {
        $this->writeStream(static::normalizerPath($newpath), $this->readStream(static::normalizerPath($path))['stream'], new Config() );

        return true;
    }
12443
protected function _load($config, $path, $prefix = '')
    {
        if (file_exists($path)) {
            $config->load($path, $prefix);
        }

        $localConfig = preg_replace('/(.*)\.ini$/', '$1.local.ini', $path);
        if (file_exists($localConfig)) {
            $config->load($localConfig, $prefix);
        }
    }
824454
public function writeStream($path, $resource, Config $config)
    {
        $options = $this->prepareUploadConfig($config);

        return $this->client->upload(
            $this->getBucket(),
            $path,
            stream_get_contents($resource, -1, 0),
            $options
        );
    }
766269
public function write($path, $contents, Config $config)
    {
        try {
            $this->getOss()->putObject($this->bucket, $path, $contents, $option = []);

            return true;
        }catch (OssException $e){

        }
        return false;
    }
1143288
public function write($path, $contents, Config $config)
    {
        return $this->update($path, $contents, $config);
    }
1194060
public function write($path, $contents, Config $config)
    {
        $options = $this->prepareUploadConfig($config);

        return $this->client->upload($this->getBucket(), $path, $contents, $options);
    }
234418
public function write($path, $contents, Config $config)
    {
        $location = $this->applyPathPrefix($path);
        $options = $this->getOptionsFromConfig($config);
        return $this->ossClient->putObject($this->bucket, $location, $contents, $options);
    }
1295127
public function write($path, $contents, Config $config)
    {
        return $this->getAdapter()->write($path, $contents, $config);
    }
111257
public function writeStream($path, $resource, \League\Flysystem\Config $config) {
			return $this->write($path, $resource, $config);
		}
518531
public function write($path, $contents, Config $config) {
        try {
            $mapping = $this->mapper->get($path);

            $file = null;

            if ($mapping) {
                $volume = $this->client->lookup($mapping['fid']);

                $file = new \stdClass();
                $file->url = $volume->url;
                $file->fid = $mapping['fid'];
            }

            $file = $this->client->upload($contents, basename($path), $file);

            if (!$file) {
                return false;
            }

            $this->mapper->store($path, $file->fid, mimetype_from_filename($path), $file->size);

            return $file->toArray();
        } catch (SeaweedFSException $e) {
            return false;
        }
    }
872779
public function writeStream($path, $resource, Config $config)
    {
        return $this->writeObject($path, $resource, $config);
    }
636071
public function write($path, $contents, array $config = [])
    {
        return $this->fileSystem->write($path, $contents, $config);
    }
1288311
public function createFileSystem(array $config)
    {
        if (isset($config[FileUploadConstants::LOCAL_PATH]) === false) {
            throw new InvalidConfigException(FileUploadConstants::LOCAL_PATH);
        }

        $localFilesystem = new Local($config[FileUploadConstants::LOCAL_PATH]);
        $filesystem = new Filesystem($localFilesystem);

        return $filesystem;
    }