' : PHP_EOL; $topDir = dirname( __DIR__ ); // add a version check for php if (PHP_VERSION_ID < PHP_MINIMUM_VERSION) exit ('A version of PHP >= 7.4.1 is required to run Namaste.' . PHP_EOL); function gt(): string { return('[' . date("d/m/y@H:i:s", time()) . '] [ !]STRP: '); } // load the files stored in the common directory foreach(glob($topDir . '/common/*.php') as $filename) { try { /** @noinspection PhpIncludeInspection */ require_once($filename); } catch (ParseError $p) { echo gt() . 'Caught parse exception in ' . $filename . PHP_EOL; echo gt() . $p->getMessage() . PHP_EOL; exit(1); } } $classesDir = $topDir . DIR_CLASSES; $configDir = $topDir . DIR_CONFIG; $amqpLib = $topDir . DIR_LIB; $templateDir = $topDir . DIR_CLASSES . DIR_TEMPLATE; // load the auto-loaders (composer and namaste) try { /** @noinspection PhpIncludeInspection */ require($topDir . FILE_AUTOLOADER); } catch (ParseError $p) { echo gt() . 'Caught parse exception in ' . $filename . PHP_EOL; echo gt() . $p->getMessage() . PHP_EOL; exit(1); } if(file_exists($classesDir)) { Autoloader::register_directory($classesDir); Autoloader::register_directory($templateDir); } try { require_once $amqpLib . '/vendor/autoload.php'; } catch (ParseError $p) { echo gt() . 'Caught parse exception in ' . $filename . PHP_EOL; echo gt() . $p->getMessage() . PHP_EOL; exit(1); } use /** @noinspection PhpUnusedAliasInspection */ PhpAmqpLib\Connection\AMQPStreamConnection; use /** @noinspection PhpUnusedAliasInspection */ PhpAmqpLib\Channel\AMQPChannel; use /** @noinspection PhpUnusedAliasInspection */ PhpAmqpLib\Message\AMQPMessage; // load the base configuration if (!gasConfig::singleton($configDir . FILE_BASE_CONFIG, FILE_TYPE_XML)) exit(gt() . 'Failed to load config singleton...' . $eos); if (file_exists($configDir . FILE_ENV_CONFIG)) { gasConfig::addConfig($configDir . FILE_ENV_CONFIG, FILE_TYPE_XML); if (!gasConfig::$status) exit(gt() . 'Failed to load/layer env configuration...' . $eos); } // load the cache handler because it's fast if (!isset(gasCache::$available)) gasCache::singleton();