<?php
// Only approved local development / inherited nonproduction endpoints.
$lane=getenv('CITY_LANE');
if($lane==='B')return array_replace_recursive(['type'=>'mysql','hostport'=>3306,'charset'=>'utf8','prefix'=>'ydy_'], require '/workspace/zhct/zhctproject/store/application/config/local/database.php');
if($lane!=='C'||getenv('POC_HOST')!=='127.0.0.1'||getenv('POC_PORT')!=='5237'||getenv('POC_SCHEMA')!=='ZHCT_APP')throw new RuntimeException('Approved endpoint required');
$cfg=require getenv('CITY_PARENT').'/application/database.php';
foreach(['hostname'=>'HOST','hostport'=>'PORT','database'=>'SCHEMA','username'=>'USER','password'=>'PASSWORD'] as $key=>$suffix)$cfg[$key]=getenv('POC_'.$suffix);
$cfg['type']='app\\cores\\database\\Dm';$cfg['prefix']='ydy_';
if(isset($cfg['ai_zhct'])){
    if(getenv('POC_AI_HOST')!=='127.0.0.1'||getenv('POC_AI_PORT')!=='5238')throw new RuntimeException('Approved secondary endpoint required');
    foreach(['hostname'=>'HOST','hostport'=>'PORT','database'=>'SCHEMA','username'=>'USER','password'=>'PASSWORD'] as $key=>$suffix)$cfg['ai_zhct'][$key]=getenv('POC_AI_'.$suffix);
    $cfg['ai_zhct']['type']=$cfg['type'];$cfg['ai_zhct']['prefix']='yoshop_';
}
return $cfg;
