#!/usr/bin/env php [--apply]\nSans --apply, aucune donnée métier n’est écrite.\n", ); exit(2); } if ($apply) { fwrite(STDERR, 'IMPORT RÉEL demandé. Tapez exactement IMPORTER ASM3 pour continuer : '); if (trim((string) fgets(STDIN)) !== 'IMPORTER ASM3') { fwrite(STDERR, "Import annulé.\n"); exit(3); } } try { Migrations::run($root . '/migrations'); $result = Asm3AnimalImporter::run($source, DB::pdo(), $apply); echo json_encode($result, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES), "\n"; } catch (Throwable $e) { fwrite(STDERR, "Échec : {$e->getMessage()}\n"); exit(1); }