From 7f07cf283bde3d8a90d90e2310d83df7de75710a Mon Sep 17 00:00:00 2001 From: root Date: Mon, 24 Feb 2020 10:35:22 +0800 Subject: [PATCH] add config for composer-mirror --- config.php | 89 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 config.php diff --git a/config.php b/config.php new file mode 100644 index 0000000..550ec21 --- /dev/null +++ b/config.php @@ -0,0 +1,89 @@ + 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'; + * + * 其余的可这里查找: + */ + '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, +];