Files
canary/Bin/autoload.php
2024-08-20 06:26:09 -04:00

43 lines
1.2 KiB
PHP

<?php
/**
* autoload.php
*
* Uses the Hermes autoloader if it has been defined.
*
* @version 3.0
* @author Joey Kimsey <Joey@thetempusproject.com>
* @link https://TheTempusProject.com/TempusDebugger
* @license https://opensource.org/licenses/MIT [MIT LICENSE]
*/
namespace TheTempusProject\Canary;
use TheTempusProject\Hermes\Classes\Autoloader;
if ( !defined( 'CANARY_ROOT_DIRECTORY' ) ) {
define( 'CANARY_ROOT_DIRECTORY', dirname( __DIR__ ) . DIRECTORY_SEPARATOR );
}
if ( ! defined('CANARY_CONFIG_DIRECTORY' ) ) {
define('CANARY_CONFIG_DIRECTORY', CANARY_ROOT_DIRECTORY . 'Config' . DIRECTORY_SEPARATOR);
}
if ( ! defined('CANARY_CONSTANTS_LOADED' ) ) {
require_once CANARY_CONFIG_DIRECTORY . 'constants.php';
}
if ( class_exists( 'TheTempusProject\Hermes\Classes\Autoloader' ) ) {
$Autoloader = new Autoloader;
$autoloader->setRootFolder( CANARY_ROOT_DIRECTORY );
$autoloader->addNamespace(
'TheTempusProject\Canary\Classes',
'Classes'
);
$autoloader->addNamespace(
'TheTempusProject\Canary',
'Bin'
);
$Autoloader->register();
define( 'CANARY_AUTOLOADED', true );
}
require_once 'Canary.php';