verifyInstall(); \Cron::setDisablePreventOverlapping(); \Cron::setLogger((new CronLog())->getLogger()->getLogger()); \Event::listen(StatementPrepared::class, function ($event) { $event->statement->setFetchMode(\PDO::FETCH_ASSOC); }); $preg_arr = [ '/\/business\/(.*?)\//', '/\/andaCallback\/(.*?)\//', '/\/eplusCallback\/(.*?)\//', '/\/outside\/(.*?)\//', ]; foreach ($preg_arr as $v){ preg_match($v,request()->getRequestUri(),$match); if ($match[1]) { request()->offsetSet('i',$match[1]); break; } } //$preg = '/\/business\/(.*?)\//'; // preg_match($preg,request()->getRequestUri(),$match); // if ($match[1]) { // request()->offsetSet('i',$match[1]); // } } /** * Register any application services. * * @return void */ public function register() { //微信接口不输出错误 if (strpos(request()->getRequestUri(), '/api.php') >= 0) { error_reporting(0); } // if ($this->app->environment() !== 'production') { // $this->app->register(\Orangehill\Iseed\IseedServiceProvider::class); // $this->app->register(\Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class); // // DB::listen(function ($sql) { // foreach ($sql->bindings as $i => $binding) { // if ($binding instanceof \DateTime) { // $sql->bindings[$i] = $binding->format('\'Y-m-d H:i:s\''); // } else { // if (is_string($binding)) { // $sql->bindings[$i] = "'$binding'"; // } // } // } // // Insert bindings into query // $query = str_replace(array('%', '?'), array('%%', '%s'), $sql->sql); // $query = vsprintf($query, $sql->bindings); // // Save the query to file // (new SqlLog())->getLogger()->getLogger()->addInfo($query);; // }); // } //增加模板扩展tpl \View::addExtension('tpl', 'blade'); //配置表 $this->app->singleton('options', OptionRepository::class); $this->app->singleton('siteSetting', SiteSetting::class); $this->app->singleton('siteSettingCache', SiteSettingCache::class); $this->app->singleton('SystemSetting', SystemSetting::class); $this->app->singleton('WqUniSetting', WqUniSetting::class); /** * 设置 */ $this->app->bind('setting', function() { return new Setting(); }); $this->app->bind('captcha', Captcha::class); $this->app->singleton('Log.trace', function () { return new TraceLog(); }); } private function verifyInstall() { if (config('app.framework') == 'platform' && !file_exists(base_path().'/bootstrap/install.lock') && !strpos(request()->path(), 'install')) { response()->json([ 'result' => 0, 'msg' => '', 'data' => ['status' => -4] ], 200, ['charset' => 'utf-8'])->send(); exit; } } }