gmoore Posted January 12, 2013 Posted January 12, 2013 (edited) This is just incase you wanted to move files outside of root (libs in this example which I just did to my version): config.php (Add) // Core base directory $webCoreDir="../core/"; index.php (Modify) include "config/config.php"; include $webCoreDir . "libs/hooks.php"; include $webCoreDir . "libs/common.php"; include $webCoreDir . "libs/template.php"; include $webCoreDir . "libs/roles.php"; // Loads the include when needed to avoid loading all if not required // It's also now possible to catch wrongly written class names function __autoload ($className) { global $webCoreDir; $classes = array("Database" => $webCoreDir . "libs/db.php", "UserStat" => $webCoreDir . "libs/stats.php", "Item" => $webCoreDir . "libs/items.php", "Ajax" => $webCoreDir . "libs/ajax.php"); if (isset($classes[$className])) include $classes[$className]; else { $bt = debug_backtrace(); $f = array_shift($bt); engine_error_handling(0, "Class $className not defined", $f["file"], $f["line"], null); } } Then move the libs directory up and over to Core and it runs like a champ. Directory Structure I use: core --lib www --(everything else) Greg Edited January 12, 2013 by gmoore Quote
gmoore Posted January 12, 2013 Author Posted January 12, 2013 (edited) Soon, my module out of roots ideas. AND the all desired CORE modules and SPECIAL modules. Like the special bus lol. G Edited January 12, 2013 by gmoore Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.