Added third-party dependency theseer\Autoload

Added third-party dependency theseer\DirectoryScanner
Added warning if one or more components failed to load
Added more error-handling to autoload.php
Updated autoload.php
Updated .gitignore
Updated Makefile
Fixed namepsaces and added requirement theseer\DirectoryScanner for theseer\Autoload
Updated version.json
This commit is contained in:
Netkas 2022-09-22 16:47:23 -04:00
parent a1ce77a455
commit 2b5c2b6829
47 changed files with 4599 additions and 67 deletions

View file

@ -8,7 +8,7 @@
* before proceeding to improve performance.
*/
if(defined('NCC_INIT') == false)
if(!defined('NCC_INIT'))
{
$third_party_path = __DIR__ . DIRECTORY_SEPARATOR . 'ThirdParty' . DIRECTORY_SEPARATOR;
$target_files = [
@ -22,14 +22,29 @@
$third_party_path . 'Symfony' . DIRECTORY_SEPARATOR . 'Uid' . DIRECTORY_SEPARATOR . 'autoload_spl.php',
$third_party_path . 'Symfony' . DIRECTORY_SEPARATOR . 'Filesystem' . DIRECTORY_SEPARATOR . 'autoload_spl.php',
$third_party_path . 'Symfony' . DIRECTORY_SEPARATOR . 'Yaml' . DIRECTORY_SEPARATOR . 'autoload_spl.php',
$third_party_path . 'theseer' . DIRECTORY_SEPARATOR . 'Autoload' . DIRECTORY_SEPARATOR . 'autoload_spl.php',
$third_party_path . 'theseer' . DIRECTORY_SEPARATOR . 'DirectoryScanner' . DIRECTORY_SEPARATOR . 'autoload_spl.php',
];
$init_success = true;
foreach($target_files as $file)
{
if(!file_exists($file))
{
trigger_error('Cannot find file ' . $file, E_USER_WARNING);
$init_success = false;
continue;
}
require_once($file);
}
if(\ncc\ncc::initialize() == false)
if(!$init_success)
{
trigger_error('One or more NCC components are missing/failed to load, NCC runtime may not be stable.', E_USER_WARNING);
}
if(!\ncc\ncc::initialize())
{
trigger_error('NCC Failed to initialize', E_USER_WARNING);
}