sumanpoudel / egnyte
使用 League filesystem 的 Egnyte 文件系统 API
v1.0.6
2021-11-04 14:49 UTC
Requires
- php: >=7.0.0
- ext-json: *
- guzzlehttp/guzzle: ~6.0
- league/flysystem: ^1.0
Requires (Dev)
- phpunit/phpunit: ~4.0
README
我在为 Laravel 的 Egnyte 项目工作,没有找到合适的解决方案,因此决定自己编写。受到了 Yespbs\Egnyte 的启发。
安装
通过 Composer
$ composer require sumanpoudel/egnyte
使用方法
$client = new \Suman\Egnyte\Model\File(EgnyteDomain, OAuthToken); $adapter = new \Suman\Egnyte\EgnyteAdapter($client); $filesystem = new Filesystem($adapter); //to get the content of the file $fileContents = $filesystem->get('/Shared/file.jpg'); //to check file exists $fileContents = $filesystem->has('file.jpg'); //upload the file $fileContents = $filesystem->put(fileLocation, contents_of_file); //move the file $fileContents = $filesystem->move(originalLocation, newLocation); //delete the file/folder $fileContents = $filesystem->delete(location_of_file_or_folder); // see the usrl below for more functions https://flysystem.thephpleague.com/v2/docs/usage/filesystem-api/
测试
$ phpunit
鸣谢
许可协议
MIT 许可协议 (MIT)。有关更多信息,请参阅许可文件。