/** * @return Autoloader */ public static function instance() { if (!isset(self::$instance)) { self::$instance = new self(); } return self::$instance; }
<?php error_reporting(E_ALL); ini_set('display_errors', 1); define('__ROOT__', './'); if (file_exists(__ROOT__ . 'config/env_set.php')) { include_once 'env_set.php'; } else { define('APP_ENV', 'PROD'); } require_once 'config.php'; require_once 'autoload.php'; require_once 'inc/helpers.php'; $appPath = "app/"; $language = "eng"; // default b7_Autoloader::instance()->addSearchDir($appPath . "models")->addSearchDir($appPath . "models/lib")->addSearchDir($appPath . "controllers")->addSearchDir($appPath . "stores")->registerPrepend(); require_once "languages/" . $language . ".php"; // Only run first time // require_once 'setup.php';