safeLoad(); } public static function setDebug() { // debug if (Config::get('debug') == "true") { define("DEBUG", true); } } public static function setTimezone() { // config time zone date_default_timezone_set(Config::get('timeZone')); } public static function bootDb() { // Init Eloquent ORM Connection $capsule = new Capsule; $capsule->addConnection(Config::getDbConfig(), 'default'); if (Config::get('enable_log')=='true') { $capsule->addConnection(Config::getLogDbConfig(), 'log'); } $capsule->bootEloquent(); self::bootPaginator(); } private static function bootPaginator() { $factoryResolver = function () { return new PaginationViewFactory(); }; Paginator::viewFactoryResolver($factoryResolver); LengthAwarePaginator::viewFactoryResolver($factoryResolver); $pathResolver = function () { $uri = isset($_SERVER['REQUEST_URI']) ? (string) $_SERVER['REQUEST_URI'] : '/'; $path = parse_url($uri, PHP_URL_PATH); return $path === null || $path === false || $path === '' ? '/' : $path; }; Paginator::currentPathResolver($pathResolver); LengthAwarePaginator::currentPathResolver($pathResolver); } }