<?php
declare(strict_types=1);$_SERVER['HTTP_HOST']='customer-fast5.invalid';$_SERVER['HTTP_PLATFORM']='POC';$_SERVER['REQUEST_METHOD']='GET';$_SERVER['REQUEST_URI']='/api/yingjiduo.Sports/record';$_SERVER['SCRIPT_NAME']='/index.php';require __DIR__.'/app.php';require __DIR__.'/data.php';ck(file_exists($runtime.'/preflight-ready.json')&&file_exists($runtime.'/expected-DTO.json')&&!file_exists($runtime.'/guard-attempt.json'),'Warm and frozen oracle, one token only');saveOnce('guard-attempt.json',['actor'=>actor(),'at'=>date('c')]);$app=coreApp('GUARD');require_once $root.'/app/api/common.php';$files=readNative('AI','SELECT logo_image_id FROM yoshop_store WHERE store_id=?',[10001]);$snap=json_decode(file_get_contents($runtime.'/source-snapshot.json'),true);$ids=['0',(string)($files[0]['logo_image_id']??0),(string)(json_decode(file_get_contents($runtime.'/old-marked-user.json'),true)['user_fullrows'][0]['avatar_id']??0)];foreach($snap['files'] as $f)$ids[]=(string)$f['file_id'];saveOnce('tenant-file-lease.json',['allowed_file_ids'=>array_values(array_unique($ids))]);$token='CDXFAST5READ11_'.$lane.'_'.bin2hex(random_bytes(24));saveOnce('tokens.json',['U1'=>$token]);$version=json_decode(file_get_contents($runtime.'/auth-version.json'),true)['password_version'];ck(\think\facade\Cache::set($token,['user'=>['user_id'=>actor()['user_id']],'password_version'=>$version,'login_type'=>'thirdparty'],1800),'Only one original owned Auth token');$u=\app\api\model\User::getUserByToken($token);ck($u&&(int)$u['user_id']===actor()['user_id']&&(int)$u['store_id']===10001,'Actual source Auth');$c=new \app\api\controller\yingjiduo\Sports($app);saveOnce('guard.json',['actor'=>actor(),'original_API_auth'=>true,'original_store_controller'=>true,'HTTP'=>0,'DMLDDL'=>0]);echo json_encode(['lane'=>$lane,'Auth'=>1,'HTTP'=>0,'DMLDDL'=>0]),"\n";
