45 lines
1.2 KiB
PHP
45 lines
1.2 KiB
PHP
<?php
|
|
/**
|
|
* bin/autoload.php
|
|
*
|
|
* Uses the Hermes autoloader if it has been defined.
|
|
*
|
|
* @version 1.0.5
|
|
* @author Joey Kimsey <Joey@thetempusproject.com>
|
|
* @link https://TheTempusProject.com/libraries/Hermes
|
|
* @license https://opensource.org/licenses/MIT [MIT LICENSE]
|
|
*/
|
|
namespace TheTempusProject\Hermes;
|
|
|
|
use TheTempusProject\Hermes\Classes\Autoloader;
|
|
|
|
if ( !defined( 'HERMES_ROOT_DIRECTORY' ) ) {
|
|
define( 'HERMES_ROOT_DIRECTORY', dirname( __DIR__ ) . DIRECTORY_SEPARATOR );
|
|
}
|
|
|
|
if ( ! defined('HERMES_CONFIG_DIRECTORY' ) ) {
|
|
define('HERMES_CONFIG_DIRECTORY', HERMES_ROOT_DIRECTORY . 'config' . DIRECTORY_SEPARATOR);
|
|
}
|
|
|
|
if ( ! defined('HERMES_CONSTANTS_LOADED' ) ) {
|
|
require_once HERMES_CONFIG_DIRECTORY . 'constants.php';
|
|
}
|
|
|
|
if ( ! class_exists( 'TheTempusProject\Hermes\Classes\Autoloader' ) ) {
|
|
require_once HERMES_CLASSES_DIRECTORY . 'autoloader.php';
|
|
}
|
|
|
|
$autoloader = new Autoloader;
|
|
$autoloader->setRootFolder( HERMES_ROOT_DIRECTORY );
|
|
$autoloader->addNamespace(
|
|
'TheTempusProject\Hermes\Classes',
|
|
'classes'
|
|
);
|
|
$autoloader->addNamespace(
|
|
'TheTempusProject\Hermes\Functions',
|
|
'functions'
|
|
);
|
|
$autoloader->register();
|
|
|
|
define( 'HERMES_AUTOLOADED', true );
|