PHPackages                             php-sword/storage - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. php-sword/storage

ActiveLibrary[File &amp; Storage](/categories/file-storage)

php-sword/storage
=================

The phpSword Component.

v0.1.4(4y ago)3391Apache-2.0PHPPHP &gt;=7.0

Since Jan 6Pushed 4y agoCompare

[ Source](https://github.com/php-sword/storage)[ Packagist](https://packagist.org/packages/php-sword/storage)[ Docs](https://github.com/php-sword)[ RSS](/packages/php-sword-storage/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (8)Dependencies (1)Versions (8)Used By (0)

PHP-Sword Storage 0.1.0
=======================

[](#php-sword-storage-010)

> 多种方式的对象储存管理封装组件包，支持本地、Oss、PHP-Api方式自由切换。

主要特性
----

[](#主要特性)

- 采用`PHP7`强类型（严格模式）
- 支持更多的`PSR`规范
- 多种方式的自由切换

安装
--

[](#安装)

```
composer require php-sword/storage

```

文档
--

[](#文档)

全局单例注册

```
Storage::getInstance($config);
```

配置信息

```
$config = [

    //资源储存方式 local|alioss|api
    'drive' => 'api',

    //资源api服务器接口配置 -若res_type=local生效
    'dev_local' => [
        // 资源目录路径 以/结尾
        'public' => EASYSWOOLE_ROOT. '/Public/'
    ],

    //资源api服务器接口配置 -若res_type=api生效
    // 接口服务端代码：https://github.com/php-sword/storage/blob/main/tests/api.php
    'dev_api' => [
        'Host' => 'ac.youhost.cn',
        'Port' => 80,
        'Gateway' => '/api.php',
        'User' => 'xoshe',
        'Secret' => '***',
        'OutTime' => -1
    ],

    // 阿里oss配置 -若res_type=alioss生效
    'dev_alioss' => [
        'AccessKey'   => 'LTA***sZh',
        'Secret'      => 'NSc38*****fn7z5',
        'Endpoint'    => "http://oss-cn-chengdu.aliyuncs.com",
        'Bucket'      => '***'
    ],
];
```

使用

```
$storage = Storage::getInstance()->getObject();
$storage->upload(...);
```

若是采用api方式： 接口服务端代码：

参与开发
----

[](#参与开发)

> 直接提交PR或者Issue即可

版权信息
----

[](#版权信息)

本项目遵循Apache2.0开源协议发布，并提供免费使用。

本项目包含的第三方源码和二进制文件之版权信息另行标注。

更多细节参阅 [LICENSE.txt](LICENSE.txt)

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~40 days

Total

7

Last Release

1712d ago

PHP version history (2 changes)v0.0.2PHP ^7.0

v0.0.3PHP &gt;=7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/c57985f59dee65fb0bd442b0eea026e3acd3339ac5fb3f9035008cdf8b36cd62?d=identicon)[kyour-cn](/maintainers/kyour-cn)

---

Top Contributors

[![kyour-cn](https://avatars.githubusercontent.com/u/38110013?v=4)](https://github.com/kyour-cn "kyour-cn (11 commits)")

---

Tags

phpstorageswooleSWORD

### Embed Badge

![Health badge](/badges/php-sword-storage/health.svg)

```
[![Health](https://phpackages.com/badges/php-sword-storage/health.svg)](https://phpackages.com/packages/php-sword-storage)
```

###  Alternatives

[rsd/seafile-php-sdk

This is a PHP package for accessing Seafile Web API

3589.1k](/packages/rsd-seafile-php-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
