mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Only check depedencies once in validate.php (#11316)
* Only check depedencies once in validate.php * Update librenms-service.py
This commit is contained in:
@@ -68,7 +68,7 @@ class Laravel
|
|||||||
|
|
||||||
public static function isBooted()
|
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()
|
public static function enableQueryDebug()
|
||||||
|
@@ -68,13 +68,13 @@ class Dependencies extends BaseValidation
|
|||||||
$dep_check = shell_exec($validator->getBaseDir() . '/scripts/composer_wrapper.php install --no-dev --dry-run');
|
$dep_check = shell_exec($validator->getBaseDir() . '/scripts/composer_wrapper.php install --no-dev --dry-run');
|
||||||
preg_match_all('/Installing ([^ ]+\/[^ ]+) \(/', $dep_check, $dep_missing);
|
preg_match_all('/Installing ([^ ]+\/[^ ]+) \(/', $dep_check, $dep_missing);
|
||||||
if (!empty($dep_missing[0])) {
|
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]);
|
$result->setList("Dependencies", $dep_missing[1]);
|
||||||
$validator->result($result);
|
$validator->result($result);
|
||||||
}
|
}
|
||||||
preg_match_all('/Updating ([^ ]+\/[^ ]+) \(/', $dep_check, $dep_outdated);
|
preg_match_all('/Updating ([^ ]+\/[^ ]+) \(/', $dep_check, $dep_outdated);
|
||||||
if (!empty($dep_outdated[0])) {
|
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]);
|
$result->setList("Dependencies", $dep_outdated[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
14
validate.php
14
validate.php
@@ -106,20 +106,6 @@ if (!file_exists('vendor/autoload.php')) {
|
|||||||
// init autoloading
|
// init autoloading
|
||||||
require_once 'vendor/autoload.php';
|
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 = new Validator();
|
||||||
$validator->validate(array('dependencies'));
|
$validator->validate(array('dependencies'));
|
||||||
if ($validator->getGroupStatus('dependencies') == ValidationResult::FAILURE) {
|
if ($validator->getGroupStatus('dependencies') == ValidationResult::FAILURE) {
|
||||||
|
Reference in New Issue
Block a user