Skip to content

Commit

Permalink
Feat: check php function requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
fahrim committed Jan 8, 2023
1 parent 3dec1d5 commit cdadf07
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Config/installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
'JSON',
'cURL',
],
'php-function' => [
'apache_get_modules',
],
'apache' => [
'mod_rewrite',
],
Expand Down
12 changes: 12 additions & 0 deletions src/Helpers/RequirementsChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,18 @@ public function check(array $requirements)
}
}
break;
// check php function requirements
case 'php-function':
foreach ($requirements[$type] as $requirement) {
$results['requirements'][$type][$requirement] = true;

if (! function_exists($requirement)) {
$results['requirements'][$type][$requirement] = false;

$results['errors'] = true;
}
}
break;
// check apache requirements
case 'apache':
foreach ($requirements[$type] as $requirement) {
Expand Down

0 comments on commit cdadf07

Please sign in to comment.