Validate autoload first (#11785)

* Validate autoload first

* missed
This commit is contained in:
Tony Murray
2020-06-06 23:49:03 -05:00
committed by GitHub
parent f590e63d3a
commit d75d628a53

View File

@@ -21,15 +21,11 @@ chdir(__DIR__); // cwd to the directory containing this script
ini_set('display_errors', 1);
require_once 'includes/common.php';
require_once 'includes/functions.php';
require_once 'includes/dbFacile.php';
$options = getopt('g:m:s::h::');
if (isset($options['h'])) {
echo
"\n Validate setup tool
"\n Validate setup tool
Usage: ./validate.php [-g <group>] [-s] [-h]
-h This help section.
@@ -58,6 +54,17 @@ if (isset($options['h'])) {
exit;
}
// Check autoload
if (!file_exists('vendor/autoload.php')) {
print_fail('Composer has not been run, dependencies are missing', './scripts/composer_wrapper.php install --no-dev');
exit;
}
require_once 'vendor/autoload.php';
require_once 'includes/common.php';
require_once 'includes/functions.php';
require_once 'includes/dbFacile.php';
// Buffer output
ob_start();
@@ -98,15 +105,8 @@ if (strpos(`tail config.php`, '?>') !== false) {
$pre_checks_failed = true;
}
// Composer checks
if (!file_exists('vendor/autoload.php')) {
print_fail('Composer has not been run, dependencies are missing', './scripts/composer_wrapper.php install --no-dev');
exit;
}
// init autoloading
require_once 'vendor/autoload.php';
// Composer check
$validator = new Validator();
$validator->validate(array('dependencies'));
if ($validator->getGroupStatus('dependencies') == ValidationResult::FAILURE) {