PHPackages                             hzz/repo-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. hzz/repo-storage

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

hzz/repo-storage
================

使用代码托管平台(github|coding|gitee)做自己 '私有' 的 '对象存储'

v2.0.2(4y ago)858MITPHPPHP ^7.2.5 || ^8.0

Since Sep 14Pushed 4y ago1 watchersCompare

[ Source](https://github.com/hezhizheng/repo-storage)[ Packagist](https://packagist.org/packages/hzz/repo-storage)[ RSS](/packages/hzz-repo-storage/feed)WikiDiscussions master Synced today

READMEChangelog (4)Dependencies (2)Versions (5)Used By (0)

repo-storage 使用代码托管平台(github|coding|gitee)做自己 '私有' 的 '对象存储'
-----------------------------------------------------------

[](#repo-storage-使用代码托管平台githubcodinggitee做自己-私有-的-对象存储)

> [github 地址](https://github.com/hezhizheng/repo-storage)

功能
--

[](#功能)

- 支持github(jsdelivr加速)/coding/gitee
- 已实现 上传 、删除、文件获取 接口

使用
--

[](#使用)

- 安装 `composer require "hzz/repo-storage @dev-master"`
- github token 获取 -&gt;
- gitee token 获取 -&gt; [https://gitee.com/profile/personal\_access\_tokens/new](https://gitee.com/profile/personal_access_tokens/new)
- Coding 开放平台 -&gt;

```
// 使用简单工厂模式调用
// gitee
// $entity = \Hzz\StorageEntity::create('gitee',"对应gitee平台的token");
$entity = \Hzz\StorageEntity::create('github',"对应github平台的token");

// 请求参数说明
$_data = [
    'owner' => "", // 用户名
    'repo' => "", // 仓库名称
    'path' => "", // 文件存储的路径
    'file' => "", // 上传时使用文件绝对路径或者base64，删除时使用仓库中对应的文件名
    'sha' => "",  // 删除文件的 sha 标识
];

// 上传
$data["owner"] = "hezhizheng";
$data["repo"] = "static-image-hosting";
$data["path"] = "files";
$data["file"] = "/xxxpath/1.png";
$res = $entity->put($data); // 文件访问地址 github为 $res['content']['cdn_url']  gitee 为 $res['content']['download_url']

// 删除
$data["owner"] = "hezhizheng";
$data["repo"] = "static-image-hosting";
$data["path"] = "files";
$data["file"] = "20210317170512_6051c64896104.png";
$data["sha"] = "213231fd035a1ea05e5ccaba94cfa4d1acd6e81d";
$entity->delete($data);

// 获取文件
$data["owner"] = "hezhizheng";
$data["repo"] = "static-image-hosting";
$data["path"] = "files";
$entity->get($data);

// 使用策略模式调用
$server = new \Hzz\StoreStrategy(new \Hzz\Github("对应github平台的token"));
$server->serve->get($data); $server->serve->put($data); $server->serve->delete($data);
```

详细用法可参考 [tests](./tests) 用例

License
-------

[](#license)

[MIT](./LICENSE.txt)

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

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 ~65 days

Total

4

Last Release

1557d ago

Major Versions

v1.0.0 → v2.0.02022-02-26

PHP version history (2 changes)v1.0.0PHP &gt;=7.0

v2.0.0PHP ^7.2.5 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/6e26dde6f13786901a1c998d31595d608171890d030caf51bb0dadee392dd961?d=identicon)[hezhizheng](/maintainers/hezhizheng)

---

Top Contributors

[![hezhizheng](https://avatars.githubusercontent.com/u/18096449?v=4)](https://github.com/hezhizheng "hezhizheng (26 commits)")

---

Tags

file-storagegithub-apiobject-storagephp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/hzz-repo-storage/health.svg)

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

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.3k543.5M2.6k](/packages/aws-aws-sdk-php)[google/cloud

Google Cloud Client Library

1.2k16.7M57](/packages/google-cloud)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k38](/packages/neuron-core-neuron-ai)[craftcms/cms

Craft CMS

3.6k3.6M3.0k](/packages/craftcms-cms)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M46](/packages/tencentcloud-tencentcloud-sdk-php)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k13](/packages/tempest-framework)

PHPackages © 2026

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