Add validation for the existence of "config.php" and "vendor/autoload.php" in the index.php file

This commit is contained in:
Alex Tselegidis 2022-03-29 09:55:45 +02:00
parent 942cb3d46f
commit 2e81c0ea53

View file

@ -47,6 +47,11 @@
*
*/
if ( ! file_exists(__DIR__ . '/config.php'))
{
die('The root "config.php" file is missing, please copy "config-sample.php" to "config.php" and update it with your server data.');
}
require_once __DIR__ . '/config.php';
@ -60,6 +65,11 @@
*
*/
if ( ! file_exists(__DIR__ . '/vendor/autoload.php'))
{
die('The "vendor/autoload.php" file is missing, please install the Composer dependencies with "composer install" before using the app.');
}
require_once __DIR__ . '/vendor/autoload.php';
/*
@ -205,7 +215,6 @@ switch (ENVIRONMENT)
// $assign_to_config['name_of_config_item'] = 'value of config item';
// --------------------------------------------------------------------
// END OF USER CONFIGURABLE SETTINGS. DO NOT EDIT BELOW THIS LINE
// --------------------------------------------------------------------