dirs)){ try { if(is_readable($value)) { require_once $value; return; } else { throw new \Exception("I can't load '$value' file! Please check system permissions."); } } catch (\Exception $e) { exit($e->getMessage()); } } if(file_exists($tryMagicOne = DIR_APP_MODULAR. implode("/", $namespace).".php")){ try { if(is_readable($tryMagicOne)) { require_once $tryMagicOne; return; } else { throw new \Exception("I can't load '$tryMagicOne' file! Please check system permissions."); } } catch (\Exception $e) { exit($e->getMessage()); } } $prefix = array_shift($namespace); if(file_exists($tryMagicOne = DIR_APP_MODULAR. implode("/", $namespace).".php")){ try { if(is_readable($tryMagicOne)) { require_once $tryMagicOne; return; } else { throw new \Exception("I can't load '$tryMagicOne' file! Please check system permissions."); } } catch (\Exception $e) { exit($e->getMessage()); } } return; }); //require_once(DIR_SYSTEM . 'engine/legacy.php');