|
@@ -154,6 +154,7 @@ class PackageClass
|
|
"repoName" => $pkg->getName(),
|
|
"repoName" => $pkg->getName(),
|
|
"version" => $pkg->getPrettyVersion(),
|
|
"version" => $pkg->getPrettyVersion(),
|
|
"cacheDir" => $cacheDir,
|
|
"cacheDir" => $cacheDir,
|
|
|
|
+ "toolDir" => $config['tool-dir'],
|
|
"ossHost" => $config['oss-host'],
|
|
"ossHost" => $config['oss-host'],
|
|
"moduleName" => $moduleName,
|
|
"moduleName" => $moduleName,
|
|
"commonDir" => $commonDir,
|
|
"commonDir" => $commonDir,
|
|
@@ -166,6 +167,7 @@ class PackageClass
|
|
//下载包module文件
|
|
//下载包module文件
|
|
private static function fetchModuleFiles($packageInfo)
|
|
private static function fetchModuleFiles($packageInfo)
|
|
{
|
|
{
|
|
|
|
+ $toolDir = $packageInfo['toolDir'];
|
|
$cacheDir = $packageInfo['cacheDir'];
|
|
$cacheDir = $packageInfo['cacheDir'];
|
|
$repoName = $packageInfo['repoName'];
|
|
$repoName = $packageInfo['repoName'];
|
|
$version = $packageInfo['version'];
|
|
$version = $packageInfo['version'];
|
|
@@ -182,7 +184,7 @@ class PackageClass
|
|
logInfo($repoName,"fetching module file -- ",$fileName);
|
|
logInfo($repoName,"fetching module file -- ",$fileName);
|
|
|
|
|
|
//下载文件到缓存区
|
|
//下载文件到缓存区
|
|
- $filePath = downloadToDir($ossHost,$repoName,$version,$fileName,$cacheDir);
|
|
|
|
|
|
+ $filePath = downloadToDir($toolDir,$ossHost,$repoName,$version,$fileName,$cacheDir);
|
|
if(! $filePath ){
|
|
if(! $filePath ){
|
|
logError($repoName,"fetch module file failed",$fileName);
|
|
logError($repoName,"fetch module file failed",$fileName);
|
|
return false;
|
|
return false;
|
|
@@ -190,7 +192,7 @@ class PackageClass
|
|
|
|
|
|
// 解压文件
|
|
// 解压文件
|
|
if( isZipFile($fileName) ){
|
|
if( isZipFile($fileName) ){
|
|
- if(! unzipFile($filePath,$moduleDir)) {
|
|
|
|
|
|
+ if(! unzipFile($toolDir,$filePath,$moduleDir)) {
|
|
logError($repoName,"unzip module file failed",$fileName);
|
|
logError($repoName,"unzip module file failed",$fileName);
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
@@ -202,9 +204,10 @@ class PackageClass
|
|
//下载包common文件
|
|
//下载包common文件
|
|
private static function fetchCommonFiles($packageInfo)
|
|
private static function fetchCommonFiles($packageInfo)
|
|
{
|
|
{
|
|
|
|
+ $toolDir = $packageInfo['toolDir'];
|
|
$cacheDir = $packageInfo['cacheDir'];
|
|
$cacheDir = $packageInfo['cacheDir'];
|
|
$repoName = $packageInfo['repoName'];
|
|
$repoName = $packageInfo['repoName'];
|
|
- $version = $packageInfo['version'];
|
|
|
|
|
|
+ $version = $packageInfo['version'];
|
|
$commonDir = $packageInfo['commonDir'];
|
|
$commonDir = $packageInfo['commonDir'];
|
|
$ossHost = $packageInfo['ossHost'];
|
|
$ossHost = $packageInfo['ossHost'];
|
|
$commonFiles = $packageInfo['helper']['common-files'];
|
|
$commonFiles = $packageInfo['helper']['common-files'];
|
|
@@ -215,7 +218,7 @@ class PackageClass
|
|
$fileName = $fileInfo['name'];
|
|
$fileName = $fileInfo['name'];
|
|
logInfo($repoName,"fetching common file -- ",$fileName);
|
|
logInfo($repoName,"fetching common file -- ",$fileName);
|
|
//下载文件到缓存区
|
|
//下载文件到缓存区
|
|
- $filePath = downloadToDir($ossHost,$repoName,$version,$fileName,$cacheDir);
|
|
|
|
|
|
+ $filePath = downloadToDir($toolDir,$ossHost,$repoName,$version,$fileName,$cacheDir);
|
|
if(! $filePath ){
|
|
if(! $filePath ){
|
|
logError($repoName,"fetch common file failed",$fileName);
|
|
logError($repoName,"fetch common file failed",$fileName);
|
|
continue;
|
|
continue;
|
|
@@ -223,7 +226,7 @@ class PackageClass
|
|
|
|
|
|
// 解压文件
|
|
// 解压文件
|
|
if( isZipFile($fileName) ){
|
|
if( isZipFile($fileName) ){
|
|
- if(! unzipFile($filePath,$commonDir)) {
|
|
|
|
|
|
+ if(! unzipFile($toolDir,$filePath,$commonDir)) {
|
|
logError($repoName,"unzip common file failed",$fileName);
|
|
logError($repoName,"unzip common file failed",$fileName);
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
@@ -242,7 +245,6 @@ class PackageClass
|
|
$ossHost = $packageInfo['ossHost'];
|
|
$ossHost = $packageInfo['ossHost'];
|
|
$configFiles = $packageInfo['helper']['config-files'];
|
|
$configFiles = $packageInfo['helper']['config-files'];
|
|
if(! $configFiles){
|
|
if(! $configFiles){
|
|
- logInfo($repoName,'no config files defined. skip.');
|
|
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
foreach($configFiles as $fileInfo){
|
|
foreach($configFiles as $fileInfo){
|