Added warning if one or more components failed to load

This commit is contained in:
Netkas 2022-09-22 17:28:34 -04:00
parent c41f7281bf
commit bf8c63f6b5

View file

@ -26,18 +26,25 @@
$third_party_path . 'theseer' . DIRECTORY_SEPARATOR . 'DirectoryScanner' . 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) foreach($target_files as $file)
{ {
if(!file_exists($file)) if(!file_exists($file))
{ {
trigger_error('Cannot find file ' . $file, E_USER_WARNING); trigger_error('Cannot find file ' . $file, E_USER_WARNING);
$init_success = false;
continue; continue;
} }
require_once($file); 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); trigger_error('NCC Failed to initialize', E_USER_WARNING);
} }