Files
ESBSC-CONVOC/tests/v4_export.php
T
2026-11-11 09:24:28 +01:00

9 lines
898 B
PHP

<?php
require dirname(__DIR__).'/bootstrap.php';
if(getenv('ESBSC_TEST_DATABASE')!=='1')exit('Base jetable requise');
$out=$argv[1]??sys_get_temp_dir();$share=json_decode(file_get_contents(sys_get_temp_dir().'/v4-share.json'),true);$share['branding']=App\ClubSettings::branding();
foreach($share['groups'] as &$g)$g['players']=array_map(fn($i)=>['DUPONT Alex','MARTIN Camille','DUPUIS-DESCHAMPS Jean-Baptiste','LE GALL Émilien'][$i%4],range(0,13));unset($g);
file_put_contents($out.'/v4-share.json',json_encode($share));file_put_contents($out.'/v4-convocations.pdf',App\ConvocationExport::pdf($share));file_put_contents($out.'/v4-convocations.xlsx',App\ConvocationExport::xlsx($share));
$raw=base64_decode($share['branding']['logo_pdf']);if(!str_starts_with($raw,"\xff\xd8"))throw new RuntimeException('Normalisation JPEG invalide');
echo "Exports V4 : PDF, Excel et logo normalisé produits.\n";