flux-eco / source-downloader
由 fluxlabs 开发的 flux-capacitor 应用组件
1.1.1
2022-04-03 04:36 UTC
Requires
- php: >=7.4
- ext-curl: *
- ext-json: *
- ext-yaml: *
- flux-eco/dot-env: >=0.0.1
- flux-eco/shell-executor: >=0.0.1
README
此组件支持软件源代码的下载,例如用于构建 Docker 容器
用法
sourceList.yaml
- sourceType: tar-gz
directoryPath: /var/www
directoryName: ilias
url: https://github.com/ILIAS-eLearning/ILIAS/releases/download/v7.7/ILIAS-7.7.tar.gz
- sourceType: git
url: https://github.com/fluxapps/SrContainerObjectMenu.git
directoryPath: /var/www/ilias/Customizing/global/plugins/Services/UIComponent/UserInterfaceHook
directoryName: SrContainerObjectMenu
tag: v2.5.7
.env
SOURCE_DOWNLOADER_SOURCE_LIST_FILE_PATH=sourceList.yaml
SOURCE_DOWNLOADER_VOLUME_PATH=/tmp
SOURCE_DOWNLOADER_GIT_FULL_CLONE=0
面向对象的使用
<?php
require_once __DIR__ . '/../vendor/autoload.php';
use FluxEco\SourceDownloader;
use FluxEco\DotEnv;
DotEnv\Api::new()->load(__DIR__);
$sourceListFile = getenv(SourceDownloader\Env::SOURCE_LIST_FILE_PATH);
$volumePath = getenv(SourceDownloader\Env::VOLUME_PATH);
$gitGetFullClone = getenv(SourceDownloader\Env::GIT_FULL_CLONE);
$api = SourceDownloader\Api::new($gitGetFullClone);
$api->downloadSources($sourceListFile, $volumePath);
函数式使用
<?php
require_once __DIR__ . '/../vendor/autoload.php';
fluxy\loadDotEnv(__DIR__);
fluxy\downloadSources(
fluxy\getEnvSourceDownloaderSourceListFilePath(),
fluxy\getEnvSourceDownloaderVolumePath(),
fluxy\getEnvSourceDownloaderGitFullClone()
);
贡献 💜
请 ...
- ... 在 https://git.fluxlabs.ch 注册账户
- ... 创建拉取请求 🔥
调整建议 / 错误报告 🐾
请 ...
- ... 在 https://git.fluxlabs.ch 注册账户
- ... 向我们请求服务水平协议: support@fluxlabs.ch 😘
- ... 阅读并创建问题