42 lines
1.1 KiB
PHP
42 lines
1.1 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 );
|
|
}
|