Only check depedencies once in validate.php (#11316)

* Only check depedencies once in validate.php

* Update librenms-service.py
This commit is contained in:
Tony Murray
2020-03-23 09:05:18 -05:00
committed by GitHub
parent 8c5e03423c
commit 67f3d889b9
3 changed files with 3 additions and 17 deletions

View File

@@ -68,7 +68,7 @@ class Laravel
public static function isBooted()
{
return !empty(app()->isAlias('Illuminate\Foundation\Application')) && app()->isBooted();
return function_exists('app') && !empty(app()->isAlias('Illuminate\Foundation\Application')) && app()->isBooted();
}
public static function enableQueryDebug()

View File

@@ -68,13 +68,13 @@ class Dependencies extends BaseValidation
$dep_check = shell_exec($validator->getBaseDir() . '/scripts/composer_wrapper.php install --no-dev --dry-run');
preg_match_all('/Installing ([^ ]+\/[^ ]+) \(/', $dep_check, $dep_missing);
if (!empty($dep_missing[0])) {
$result = ValidationResult::fail("Missing dependencies!", "composer install --no-dev");
$result = ValidationResult::fail("Missing dependencies!", $validator->getBaseDir() . '/scripts/composer_wrapper.php install --no-dev');
$result->setList("Dependencies", $dep_missing[1]);
$validator->result($result);
}
preg_match_all('/Updating ([^ ]+\/[^ ]+) \(/', $dep_check, $dep_outdated);
if (!empty($dep_outdated[0])) {
$result = ValidationResult::fail("Outdated dependencies", "composer install --no-dev");
$result = ValidationResult::fail("Outdated dependencies", $validator->getBaseDir() . '/scripts/composer_wrapper.php install --no-dev');
$result->setList("Dependencies", $dep_outdated[1]);
}

View File

@@ -106,20 +106,6 @@ if (!file_exists('vendor/autoload.php')) {
// init autoloading
require_once 'vendor/autoload.php';
$dep_check = shell_exec('php scripts/composer_wrapper.php install --no-dev --dry-run');
preg_match_all('/Installing ([^ ]+\/[^ ]+) \(/', $dep_check, $dep_missing);
if (!empty($dep_missing[0])) {
print_fail("Missing dependencies!", "./scripts/composer_wrapper.php install --no-dev");
$pre_checks_failed = true;
print_list($dep_missing[1], "\t %s\n");
}
preg_match_all('/Updating ([^ ]+\/[^ ]+) \(/', $dep_check, $dep_outdated);
if (!empty($dep_outdated[0])) {
print_fail("Outdated dependencies", "./scripts/composer_wrapper.php install --no-dev");
print_list($dep_outdated[1], "\t %s\n");
}
$validator = new Validator();
$validator->validate(array('dependencies'));
if ($validator->getGroupStatus('dependencies') == ValidationResult::FAILURE) {