mirror of
https://github.com/tuna/tunasync-scripts.git
synced 2025-04-20 12:42:50 +00:00
add config for composer-mirror
This commit is contained in:
parent
f6b1cff277
commit
7f07cf283b
89
config.php
Normal file
89
config.php
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* copy config.default.php to config.php
|
||||||
|
*/
|
||||||
|
|
||||||
|
return (object)[
|
||||||
|
|
||||||
|
/**
|
||||||
|
* distdir 用于存储 zip 包
|
||||||
|
*/
|
||||||
|
'distdir' => getenv("TUNASYNC_WORKING_DIR") . '/dist/',
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 指向 mirrorUrl 对应的 web 实际目录
|
||||||
|
*/
|
||||||
|
'cachedir' => getenv("TUNASYNC_WORKING_DIR") . '/index/',
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 程序运行过程中,生成的一些存储文件,比如都已经采集过哪些,做为下次增量的判断依据
|
||||||
|
*/
|
||||||
|
'dbdir' => getenv("TUNASYNC_WORKING_DIR") . '/db/',
|
||||||
|
|
||||||
|
/**
|
||||||
|
* packagistUrl:官方采集源
|
||||||
|
*/
|
||||||
|
'packagistUrl' => getenv('TUNASYNC_UPSTREAM_URL'), //'https://packagist.org',
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 镜像包发布站点, packages.json 入口根域名
|
||||||
|
*/
|
||||||
|
'mirrorUrl' => 'https://mirror.tuna.tsinghua.edu.cn/packagist/index',
|
||||||
|
|
||||||
|
/**
|
||||||
|
* .json 中 dist 分发 zip 包的CDN域名
|
||||||
|
*/
|
||||||
|
'distUrl' => 'https://mirror.tuna.tsinghua.edu.cn/packagist/dist',
|
||||||
|
|
||||||
|
/**
|
||||||
|
* cloudDisk: 注意是 object,不是 array,内部的参数是 array
|
||||||
|
* 使用 Flyststem Adapter, 第三方云存储的封装类
|
||||||
|
*
|
||||||
|
* 使用又拍云:
|
||||||
|
* 'adapter' => 'ZenCodex\\Support\\Flysystem\\Adapter\\UpyunAdapter';
|
||||||
|
* 先安装扩展包: composer require zencodex/flysystem-upyun
|
||||||
|
*
|
||||||
|
* 使用七牛云:
|
||||||
|
* 'adapter' => 'Overtrue\\Flysystem\\Qiniu\\QiniuAdapter';
|
||||||
|
* 先安装扩展包: composer require overtrue/flysystem-qiniu
|
||||||
|
*
|
||||||
|
* 测试状态,可以使用空适配器:
|
||||||
|
* 'adapter' => 'League\\Flysystem\\Adapter\\NullAdapter';
|
||||||
|
*
|
||||||
|
* 其余的可这里查找: <https://github.com/thephpleague/flysystem>
|
||||||
|
*/
|
||||||
|
'cloudDisk' => (object)[
|
||||||
|
'adapter' => 'League\\Flysystem\\Adapter\\NullAdapter',
|
||||||
|
'config' => [
|
||||||
|
'operator' => 'composer',
|
||||||
|
'password' => '',
|
||||||
|
'bucket' => '',
|
||||||
|
'uploadType' => 'BLOCK',
|
||||||
|
],
|
||||||
|
'bucketMap' => [
|
||||||
|
'json' => 'mirror-json',
|
||||||
|
'zip' => 'mirror-dist',
|
||||||
|
]
|
||||||
|
],
|
||||||
|
|
||||||
|
/**
|
||||||
|
* guzzle 采集时的超时时间
|
||||||
|
*/
|
||||||
|
'timeout' => 3600,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 清理过期包时,判断过期的间隔时间,单位分钟
|
||||||
|
*/
|
||||||
|
'expireMinutes' => 20,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 最大并发数,越大采集效率越高
|
||||||
|
*/
|
||||||
|
'maxConnections' => 500,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* isPrefetch:早期建立初始数据源时,利用又拍云的直接下载文件任务接口,可忽略
|
||||||
|
*/
|
||||||
|
'isPrefetch' => false,
|
||||||
|
];
|
Loading…
x
Reference in New Issue
Block a user