Skip to content

Commit

Permalink
Added php-zip extension as a requirement and added requirement check.
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Skrypnyk committed Dec 10, 2019
1 parent afd86e3 commit d222dc6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
},
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"ext-zip": "*"
},
"require-dev": {
"drupal/pathauto": "~1.0"
}
Expand Down
11 changes: 11 additions & 0 deletions minisite.install
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,17 @@ function minisite_requirements($phase) {
$requirements['minisite_asset']['severity'] = REQUIREMENT_ERROR;
$requirements['minisite_asset']['value'] = t('Unable to create');
}

$requirements['minisite_archiver'] = [
'title' => t('Minisite archiver library'),
'severity' => REQUIREMENT_OK,
'value' => t('Present'),
];
if (!class_exists(\ZipArchive::class)) {
$requirements['minisite_archiver']['description'] = t('ZipArchive is required to extract Minisite assets from uploaded archives. Please install php-zip extension.');
$requirements['minisite_asset']['severity'] = REQUIREMENT_ERROR;
$requirements['minisite_asset']['value'] = t('Absent');
}
}

return $requirements;
Expand Down

0 comments on commit d222dc6

Please sign in to comment.