diff --git a/LibreNMS/Util/Laravel.php b/LibreNMS/Util/Laravel.php index 21e393d930..9a5055e1b4 100644 --- a/LibreNMS/Util/Laravel.php +++ b/LibreNMS/Util/Laravel.php @@ -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() diff --git a/LibreNMS/Validations/Dependencies.php b/LibreNMS/Validations/Dependencies.php index ad68658619..89921cb98a 100644 --- a/LibreNMS/Validations/Dependencies.php +++ b/LibreNMS/Validations/Dependencies.php @@ -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]); } diff --git a/validate.php b/validate.php index b841cf69ca..546245e1fe 100755 --- a/validate.php +++ b/validate.php @@ -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) {