<?php
require_once __DIR__.'/NativeGate.php';
defined('RUNTIME_PATH')||define('RUNTIME_PATH',__DIR__.'/runtime/');
require $root.'/external_stubs.php';
if(!function_exists('json')){function json($data=[],$code=200,array $header=[],$options=[]){return \think\Response::create($data,'json',$code,$header,$options);}}
require $root.'/thinkphp/base.php';\think\App::initCommon();
\think\Log::init(['type'=>'File','path'=>__DIR__.'/runtime/safe-log/','level'=>['no_raw_application_log']]);
\think\Config::set(['type'=>'File','path'=>__DIR__.'/cache/','prefix'=>'CDXNR11E2F7_'],'cache');\think\Config::set('redis',[]);
\think\Config::set($cfg,'database');\think\Db::clear();
$connection=\think\Db::connect();
if(NRGate::$deny)$native=new NRNoPdo();else{$nativeOptions=$options;$nativeOptions[PDO::ATTR_STATEMENT_CLASS]=['NRStatement'];$native=new NRPdo($dsn,$cfg['username'],$cfg['password'],$nativeOptions);}
foreach(['links'=>[0=>$native],'linkID'=>$native,'attrCase'=>PDO::CASE_LOWER]as $name=>$value){$reflection=new ReflectionProperty(\think\db\Connection::class,$name);$reflection->setAccessible(true);$reflection->setValue($connection,$value);}
\think\Loader::addNamespace('Overtrue\\Pinyin',$root.'/vendor/overtrue/pinyin/src');
