xinningsu/flysystem-baidu-bos
Composer 安装命令:
composer require xinningsu/flysystem-baidu-bos
包简介
Flysystem adapter for BOS(Baidu Object Storage), 百度对象存储 Flysystem 适配器。
关键字:
README 文档
README
Flysystem adapter for BOS(Baidu Object Storage), 百度对象存储 Flysystem 适配器。
Installation
composer require xinningsu/flysystem-baidu-bos
Examples
require 'vendor/autoload.php'; // Instantiate $client = new \Sulao\BaiduBos\Client([ 'access_key' => 'access key', 'secret_key' => 'secret key', 'bucket' => 'bucket', 'region' => 'region', 'options' => ['connect_timeout' => 10] // Optional, guzzle request options ]); $adapter = new \Sulao\Flysystem\BaiduBos\BaiduBosAdapter($client); $filesystem = new \League\Flysystem\Filesystem($adapter, ['disable_asserts' => true]); // Write a new file. $filesystem->write('file.txt', 'contents'); // Write a new file using a stream. $filesystem->writeStream('file.txt', fopen('/resource.txt', 'r')); // Create a file or update if exists. $filesystem->put('file.txt', 'contents'); // Create a file or update if exists using a stream. $filesystem->putStream('file.txt', fopen('/resource.txt', 'r')); // Update an existing file. $filesystem->update('file.txt', 'contents'); // Update an existing file using a stream. $filesystem->updateStream('file.txt', fopen('/resource.txt', 'r')); // Read a file. $content = $filesystem->read('file.txt'); // Retrieves a read-stream for a path. $stream = $filesystem->readStream('file.txt'); // Check whether a file exists. $has = $filesystem->has('file.txt'); // Copy a file. $filesystem->copy('file.txt', 'file2.txt'); // Rename a file. $filesystem->rename('file.txt', 'file2.txt'); // Delete a file. $filesystem->delete('file.txt'); // Get a file's metadata. $meta = $filesystem->getMetadata('file.txt'); // Get a file's size. $size = $filesystem->getSize('file.txt'); // Get a file's mime-type. $mimeType = $filesystem->getMimetype('file.txt'); // Get a file's timestamp. $ts = $filesystem->getTimestamp('file.txt'); // Set the visibility for a file. $filesystem->setVisibility('file.txt', 'public'); // Get a file's visibility. $visibility = $filesystem->getVisibility('file.txt'); // Delete a directory. $filesystem->deleteDir('test/'); // Create a directory. $filesystem->createDir('test/'); // List contents of a directory. $lists = $filesystem->listContents('test/', true);
Integration
Reference
- https://github.com/thephpleague/flysystem
- https://github.com/xinningsu/baidu-bos
- https://cloud.baidu.com/doc/BOS/index.html
License
xinningsu/flysystem-baidu-bos 适用场景与选型建议
xinningsu/flysystem-baidu-bos 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.1k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2021 年 03 月 04 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「Flysystem」 「baidu」 「bos」 「flysystem adapter」 「百度」 「对象存储」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 xinningsu/flysystem-baidu-bos 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 xinningsu/flysystem-baidu-bos 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 xinningsu/flysystem-baidu-bos 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Backblaze B2 Cloud Storage for Laravel 5. Original by Paul Olthof (@hpolthof) continued by @bringyourownideas
Virtual Filesystem Storage Adapter for Laravel
Adds Silverstripe Flysystem support for using the Azure Blob adapter
Flysystem adapter for OneDrive or SharePoint
This is a Flysystem adapter for the Aliyun OSS.
baidubce php sdk bos package
统计信息
- 总下载量: 2.1k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 8
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-03-04