From 1b93ccb270d0a16791854afe351e8801b0546a4b Mon Sep 17 00:00:00 2001 From: Ibrahim BinAlshikh Date: Thu, 19 Dec 2024 01:50:42 +0300 Subject: [PATCH] Update App.php --- webfiori/framework/App.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/webfiori/framework/App.php b/webfiori/framework/App.php index 9be2ad6b..9a267d30 100644 --- a/webfiori/framework/App.php +++ b/webfiori/framework/App.php @@ -287,7 +287,8 @@ private static function getRoot() { //Following lines of code assumes that the class exist on the folder: //\vendor\webfiori\framework\webfiori\framework //Its used to construct the folder at which index file will exist at - $vendorPath = '\vendor\webfiori\framework\webfiori\framework'; + $DS = DIRECTORY_SEPARATOR; + $vendorPath = $DS.'vendor'.$DS.'webfiori'.$DS.'framework'.$DS.'webfiori'.$DS.'framework'; $rootPath = substr(__DIR__, 0, strlen(__DIR__) - strlen($vendorPath)); return $rootPath; } @@ -362,7 +363,7 @@ public static function initiate(string $appFolder = 'app', string $publicFolder /** * Path to WebFiori's core library. */ - define('WF_CORE_PATH', ROOT_PATH.DS.'vendor\webfiori\framework\webfiori\framework'); + define('WF_CORE_PATH', ROOT_PATH.DS.'vendor'.DS.'webfiori'.DS.'framework'.DS.'webfiori'.DS.'framework'); } self::initAutoLoader(); self::checkStandardLibs(); @@ -607,7 +608,8 @@ private static function initAutoLoader() { * Initialize autoloader. */ if (!class_exists('webfiori\framework\autoload\ClassLoader',false)) { - require_once WF_CORE_PATH.DIRECTORY_SEPARATOR.'autoload'.DIRECTORY_SEPARATOR.'ClassLoader.php'; + $autoloader = WF_CORE_PATH.DIRECTORY_SEPARATOR.'autoload'.DIRECTORY_SEPARATOR.'ClassLoader.php'; + require_once $autoloader; } self::$AU = ClassLoader::get();