|
|
@ -102,8 +102,8 @@ class ModuleController extends Controller |
|
|
|
{ |
|
|
|
{ |
|
|
|
$needed_manifest = []; |
|
|
|
$needed_manifest = []; |
|
|
|
// check installed extension |
|
|
|
// check installed extension |
|
|
|
if (class_exists('\ZipArchive')) { |
|
|
|
if (!extension_loaded('zip')) { |
|
|
|
\Yii::$app->session->setFlash('danger', \Yii::t('main', 'ZipArchive php extension not installed')); |
|
|
|
\Yii::$app->session->setFlash('danger', \Yii::t('main', 'PHP extension "zip" not installed, Need ZipArchive class')); |
|
|
|
return $this->redirect(['search']); |
|
|
|
return $this->redirect(['search']); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -143,7 +143,7 @@ class ModuleController extends Controller |
|
|
|
if (!file_exists($module_path)) { |
|
|
|
if (!file_exists($module_path)) { |
|
|
|
mkdir($module_path); |
|
|
|
mkdir($module_path); |
|
|
|
} |
|
|
|
} |
|
|
|
FileHelper::copyDirectory(\Yii::getAlias('@runtime/_module'), $module_path); |
|
|
|
FileHelper::copyDirectory(\Yii::getAlias('@runtime/_module/' . $needed_manifest['git_name'] . '-master'), $module_path); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
\Yii::$app->session->setFlash('danger', \Yii::t('main', 'Error module archive')); |
|
|
|
\Yii::$app->session->setFlash('danger', \Yii::t('main', 'Error module archive')); |
|
|
|
return $this->redirect(['search']); |
|
|
|
return $this->redirect(['search']); |
|
|
|