17 lines
2.6 KiB
PHP
17 lines
2.6 KiB
PHP
<?php
|
|
$source='C:/Users/macbook/.config/investmoz/parques-QA-20261016/restored-source';
|
|
require dirname(__DIR__,2).'/vendor/autoload.php';
|
|
foreach(Dotenv\Dotenv::parse(file_get_contents($source.'/.env'))as$k=>$v)if($v!==null){putenv($k.'='.$v);$_ENV[$k]=$_SERVER[$k]=$v;}
|
|
foreach(['APP_BASE_PATH'=>$source,'APP_CONFIG_CACHE'=>$source.'/bootstrap/cache/config.php','APP_ROUTES_CACHE'=>$source.'/bootstrap/cache/routes-v7.php']as$k=>$v){putenv($k.'='.$v);$_ENV[$k]=$_SERVER[$k]=$v;}
|
|
$loader=require $source.'/vendor/autoload.php';$loader->setPsr4('App\\',$source.'/app');$map=[];
|
|
foreach($loader->getClassMap()as$class=>$file)if(str_starts_with($class,'App\\')){$p=$source.'/app/'.str_replace('\\','/',substr($class,4)).'.php';if(is_file($p))$map[$class]=$p;}$loader->addClassMap($map);
|
|
$app=require $source.'/bootstrap/app.php';$app->useStoragePath($source.'/storage');$app->usePublicPath($source.'/public');
|
|
(new Illuminate\Foundation\Bootstrap\LoadEnvironmentVariables)->bootstrap($app);(new Illuminate\Foundation\Bootstrap\LoadConfiguration)->bootstrap($app);
|
|
$c=config('database.connections.'.config('database.default'));
|
|
if($c['driver']!=='pgsql'||!empty($c['url'])||$c['host']!=='127.0.0.1'||(int)$c['port']!==55441||$c['database']!=='parks_operational_restore_final_20261016_test'||$app->configurationIsCached())throw new RuntimeException('Isolated QA required before providers');
|
|
$pdo=new PDO('pgsql:host=127.0.0.1;port=55441;dbname='.$c['database'],'postgres','');if($pdo->query('SELECT current_database()')->fetchColumn()!==$c['database']||(int)$pdo->query('SELECT inet_server_port()')->fetchColumn()!==55441)throw new RuntimeException('Actual QA identity');
|
|
$app->afterBootstrapping(Illuminate\Foundation\Bootstrap\LoadConfiguration::class,function()use($source){config(['app.env'=>'testing','inertia.ssr.enabled'=>false,'suitecrm.enabled'=>false,'investmoz_ai.enabled'=>false,'portal.notifications_enabled'=>false,'portal.profile_access_enabled'=>true,'portal.profile_administration_enabled'=>true,'existing-business.enabled'=>true,'existing-business.compatibility_shadow'=>false,'filesystems.disks.local.root'=>$source.'/storage/app/private','session.driver'=>'file','session.files'=>$source.'/storage/framework/sessions','view.compiled'=>$source.'/storage/framework/views','cache.default'=>'array']);});
|
|
$app->make(Illuminate\Contracts\Console\Kernel::class)->bootstrap();
|
|
if(!str_starts_with(str_replace('\\','/',(new ReflectionClass(App\Models\ExistingBusiness::class))->getFileName()),$source.'/app/'))throw new RuntimeException('Private QA source required');
|
|
$target=['database'=>$c['database'],'port'=>55441];
|