10 lines
1.3 KiB
PHP
10 lines
1.3 KiB
PHP
<?php
|
|
$app=(static fn($p)=>require $p)(__DIR__.'/portal-workflow-upgrade-runtime.php');
|
|
$plan=json_decode(file_get_contents(dirname(__DIR__).'/storage/app/private/investmoz-v2/portal-audit/workflow-upgrade-latest.json'),true,512,JSON_THROW_ON_ERROR);
|
|
foreach([App\Services\OpportunityResourceInstallation::MIGRATION,App\Services\PortalProfileInstallation::MIGRATION,'2026_10_10_050000_extend_organization_country']as$m)throw_unless(Illuminate\Support\Facades\DB::table('migrations')->where('migration',$m)->exists(),RuntimeException::class,'Exact installed dependencies required');
|
|
throw_unless(Illuminate\Support\Facades\DB::table('portal_superuser_pair')->where('id',1)->exists(),RuntimeException::class,'Synthetic clone bootstrap required');
|
|
$file=$plan['source'].'/.env';$text=file_get_contents($file);
|
|
foreach(['PORTAL_PROFILE_ACCESS_ENABLED','PORTAL_OPPORTUNITY_DASHBOARD_ACCESS_ENABLED','PORTAL_OPPORTUNITY_SPECIALIZED_DRAFTS_ENABLED']as$key){$text=preg_replace('/^'.$key.'=.*$/m',$key.'=true',$text,1,$n);throw_unless($n===1,RuntimeException::class,'Unique clone flag required');}
|
|
file_put_contents($file,$text);
|
|
echo json_encode(['result'=>'clone_base_workflow_enabled','target'=>$plan['target'],'COUNTRY02_preserved'=>true,'other_packages_enabled'=>false,'active_writes'=>0]);
|