repo-storage 使用程式碼託管平臺(github|gitee)做自己 ‘私有’ 的 ‘物件儲存’
github 地址
功能
- 支援github(jsdelivr加速)/gitee
- 已實現 上傳 、刪除、檔案獲取 介面
使用
$entity = \Hzz\StorageEntity::create('github',"對應github平臺的token");
$_data = [
'owner' => "",
'repo' => "",
'path' => "",
'file' => "",
'sha' => "",
];
$date["owner"] = "hezhizheng";
$date["repo"] = "static-image-hosting";
$date["path"] = "files";
$date["file"] = "/xxxpath/1.png";
$res = $entity->put($date);
$date["owner"] = "hezhizheng";
$date["repo"] = "static-image-hosting";
$date["path"] = "files";
$date["file"] = "20210317170512_6051c64896104.png";
$date["sha"] = "213231fd035a1ea05e5ccaba94cfa4d1acd6e81d";
$entity->delete($date);
$date["owner"] = "hezhizheng";
$date["repo"] = "static-image-hosting";
$date["path"] = "files";
$entity->get($date);
本作品採用《CC 協議》,轉載必須註明作者和本文連結