#!/usr/bin/env php connect(); $command = $argv[1] ?? 'check'; if ($command === 'apply') { if (($argv[2] ?? '') !== '--yes') { fwrite(STDERR, "Refusing schema mutation without: apply --yes\n"); exit(2); } \classes\account_deletion_schema_bootstrap::apply(); } if (!in_array($command, ['check', 'apply'], true)) { fwrite(STDERR, "Usage: scripts/account-deletion-schema.php check|apply --yes\n"); exit(2); } $status = \classes\account_deletion_schema_bootstrap::check(); fwrite(STDOUT, json_encode($status, JSON_UNESCAPED_SLASHES) . PHP_EOL); exit($status['ready'] ? 0 : 1);