|
|
|
@ -102,8 +102,8 @@ class ModuleController extends Controller
|
|
|
|
|
{ |
|
|
|
|
$needed_manifest = []; |
|
|
|
|
// check installed extension |
|
|
|
|
if (class_exists('\ZipArchive')) { |
|
|
|
|
\Yii::$app->session->setFlash('danger', \Yii::t('main', 'ZipArchive php extension not installed')); |
|
|
|
|
if (!extension_loaded('zip')) { |
|
|
|
|
\Yii::$app->session->setFlash('danger', \Yii::t('main', 'PHP extension "zip" not installed, Need ZipArchive class')); |
|
|
|
|
return $this->redirect(['search']); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -143,7 +143,7 @@ class ModuleController extends Controller
|
|
|
|
|
if (!file_exists($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 { |
|
|
|
|
\Yii::$app->session->setFlash('danger', \Yii::t('main', 'Error module archive')); |
|
|
|
|
return $this->redirect(['search']); |
|
|
|
|