Files
canary/bin/autoload.php
Joey Kimsey bfe2aee6ee rename p2
2025-02-03 12:30:25 -05:00

43 lines
1.2 KiB
PHP

<?php
/**
* autoload.php
*
* Uses the Hermes autoloader if it has been defined.
*
* @version 1.0.7
* @author Joey Kimsey <Joey@thetempusproject.com>
* @link https://TheTempusProject.com/libraries/Canary
* @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';