<?php
namespace {
 if(!function_exists('http_post')){
 function http_post($param,$url,$json=false,$overtime=30,$header=[]){$case=\FoodGate::$case;$id=$case['own_id']??\FoodGate::$generatedId;$form=$param['form']??null;if(!is_array($param)||array_keys($param)!==['form']||!is_array($form)||(string)($form['id']??'')!==(string)$id||($form['name']??null)!==trim($case['params']['name']??'')||(int)($form['store_id']??0)!==10001||$url!=='http://127.0.0.1/aizhct/index.php?s=/api/dishes.foods/sync'||$json!==false||$header!==[]||!in_array($case['stage']??null,[1,6],true))throw new \RuntimeException('Only exact own AI type2 failed transport');($GLOBALS['FOOD_BUDGET'])('transport-spy',2);$GLOBALS['FOOD_TRANSPORT_SPY'][]=['api_type'=>2,'source_method'=>'AIApi::run(2,...)','params'=>$param,'url'=>$url,'json'=>$json,'timeout'=>$overtime,'headers'=>$header,'response'=>false,'mode'=>'explicit-failed-no-network'];return false;}
 }else{throw new \RuntimeException('Refuse preexisting transport override');}
}
namespace app\common {
 if(!class_exists(QwRobot::class,false)){
 class QwRobot {
  public static function pushMsg($params,$type=''){self::capture('pushMsg',[$params,$type]);return false;}
  public static function pushMsgFormat($params,$type=''){self::capture('pushMsgFormat',[$params,$type]);return false;}
  private static function capture($method,$args){$case=\FoodGate::$case;if(!in_array($case['stage']??null,[1,4,6],true))throw new \RuntimeException('Notification outside approved cases');($GLOBALS['FOOD_BUDGET'])('notification-spy',2);$GLOBALS['FOOD_NOTIFICATION_SPY'][]=['method'=>$method,'args'=>$args,'mode'=>'explicit-no-send'];}
 }
 }else{throw new \RuntimeException('Unexpected notification class loaded');}
}
