Download the PHP package yangweijie/think-filesystem-driver-github without Composer
On this page you can find all versions of the php package yangweijie/think-filesystem-driver-github. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download yangweijie/think-filesystem-driver-github
More information about yangweijie/think-filesystem-driver-github
Files in yangweijie/think-filesystem-driver-github
Download yangweijie/think-filesystem-driver-github
More information about yangweijie/think-filesystem-driver-github
Files in yangweijie/think-filesystem-driver-github
Vendor yangweijie
Package think-filesystem-driver-github
Short Description github think-filesystem 驱动
License Apache-2.0
Package think-filesystem-driver-github
Short Description github think-filesystem 驱动
License Apache-2.0
Please rate this library. Is it a good library?
Informations about the package think-filesystem-driver-github
think-filesystem-driver-github
ThinkPHP 的github 文件系统驱动,可以将一个仓库作为文件库
安装
composer require yangweijie/think-filesystem-driver-github
使用
配置 token 需 开发着自己去 github 里 配置
'github'=>[
'type'=>'github',
'branch'=>'main', // main 可以不配,master 等可以配置一下
'token'=>Env::get('filesystem.GITHUB_ACCESS_TOKEN', ''),
'username'=>'username',
'repository'=>'repository',
'hostIndex' => 'jsdelivr', // 目前支持 github 、 jsdelivr 、 fastgit
],
本地文件上传
$file = public_path().'favicon.ico';
$githubDisk = Filesystem::disk('github');
if(!$githubDisk->has('favicon.ico')){
$ret = $githubDisk->put('favicon.ico', file_get_contents($file));
}
$url = $githubDisk->url('favicon.ico');
// https://cdn.jsdelivr.net/gh/username/repository@main/favicon.ico
表单上传
// 获取表单上传文件 例如上传了001.jpg
$file = request()->file('image');
// 上传到本地服务器
$savename = \think\facade\Filesystem::disk('github')->putFile( 'topic', $file);
All versions of think-filesystem-driver-github with dependencies
PHP Build Version
Package Version
Requires
topthink/framework Version
^6.0 | ^8.0
yangweijie/filesystem-github Version *
topthink/think-filesystem Version *
yangweijie/filesystem-github Version *
topthink/think-filesystem Version *
The package yangweijie/think-filesystem-driver-github contains the following files
Loading the files please wait ....