more changes to support composer usage

This commit is contained in:
Joey Kimsey
2024-08-09 02:05:53 -04:00
parent 6cf4594622
commit 508c25c111
6 changed files with 141 additions and 145 deletions

View File

@ -16,8 +16,14 @@ use TheTempusProject\Hermes\Classes\Autoloader;
use TheTempusProject\Houdini\Classes\Template;
use TheTempusProject\Houdini\Classes\Views;
// Basic constants needed for loading files
define( 'APP_ROOT_DIRECTORY', dirname( __DIR__ ) . DIRECTORY_SEPARATOR );
define( 'VENDOR_DIRECTORY', APP_ROOT_DIRECTORY . 'vendor' . DIRECTORY_SEPARATOR );
define( 'CONFIG_DIRECTORY', APP_ROOT_DIRECTORY . 'app' . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR );
// App Constants
if ( ! defined( 'TEMPUS_PROJECT_CONSTANTS_LOADED' ) ) {
require_once CONFIG_DIRECTORY . 'constants.php';
}
// Determine which autoloader to sue
if ( file_exists( VENDOR_DIRECTORY . 'autoload.php' ) ) {
@ -99,7 +105,7 @@ function ttp_autoload() {
require_once( $currentFolder );
break;
case 'config':
if (file_exists($currentFolder . 'constants.php')) {
if ( file_exists( $currentFolder . 'constants.php' ) ) {
require_once( $currentFolder . 'constants.php' );
}
break;
@ -110,22 +116,7 @@ function ttp_autoload() {
define('TEMPUS_PROJECT_AUTOLOADED', true);
}
require_once 'bin/tempus_project.php';
function sideLoad() {
// Basic constants needed for loading files
if ( ! defined( 'APP_ROOT_DIRECTORY' ) ) {
define( 'APP_ROOT_DIRECTORY', dirname( __DIR__ ) . DIRECTORY_SEPARATOR );
}
if ( ! defined( 'CONFIG_DIRECTORY' ) ) {
define( 'CONFIG_DIRECTORY', APP_ROOT_DIRECTORY . 'app' . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR );
}
// App Constants
if ( ! defined( 'TEMPUS_PROJECT_CONSTANTS_LOADED' ) ) {
require_once CONFIG_DIRECTORY . 'constants.php';
}
// Hermes Constants
if ( ! defined( 'HERMES_CONSTANTS_LOADED' ) ) {
if ( defined( 'HERMES_CONFIG_DIRECTORY' ) ) {
@ -179,4 +170,6 @@ function sideLoad() {
}
define( 'VENDOR_AUTOLOADED', false );
}
}
require_once 'bin/tempus_project.php';