3 lines
1012 B
PHP
3 lines
1012 B
PHP
<?php
|
|
$root='C:/Users/macbook/.config/investmoz/editorial-QA-20261018/source';require $root.'/vendor/autoload.php';$app=require $root.'/bootstrap/app.php';(new Illuminate\Foundation\Bootstrap\LoadEnvironmentVariables)->bootstrap($app);(new Illuminate\Foundation\Bootstrap\LoadConfiguration)->bootstrap($app);$c=config('database.connections.pgsql');if($c['database']!=='editorial_20261018_test'||(int)$c['port']!==55441||$c['host']!=='127.0.0.1'||!empty($c['url']))throw new RuntimeException('QA only');$path=config('session.files');if(!str_starts_with(str_replace('\\','/',$path),$root.'/storage/'))throw new RuntimeException('QA session path');$n=0;foreach(glob($path.'/*')as$file){if(!is_file($file))continue;$s=json_decode(file_get_contents($file),true);if(!is_array($s)||($s['portal']['mfa_actor']??null)!==(int)$argv[1])continue;$s['portal']['mfa_at']=time()-3600;file_put_contents($file,json_encode($s));$n++;}if(!$n)throw new RuntimeException('No QA sessions expired');echo 'QA sessions expired: '.$n;
|