/var/www/vhosts/ihelp.ro/httpdocs/vendor/robmorgan/phinx/app
Edit: /var/www/vhosts/ihelp.ro/httpdocs/vendor/robmorgan/phinx/app/web.php (3057B)
'getStatus',
'migrate' => 'getMigrate',
'rollback' => 'getRollback',
];
// Extract the requested command from the URL, default to "status".
$command = trim(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH), '/');
if (!$command) {
$command = 'status';
}
// Verify that the command exists, or list available commands.
if (!isset($routes[$command])) {
$commands = implode(', ', array_keys($routes));
header('Content-Type: text/plain', true, 404);
die("Command not found! Valid commands are: {$commands}.");
}
// Get the environment and target version parameters.
$env = $_GET['e'] ?? null;
$target = $_GET['t'] ?? null;
// Check if debugging is enabled.
$debug = !empty($_GET['debug']) && filter_var($_GET['debug'], FILTER_VALIDATE_BOOLEAN);
// Execute the command and determine if it was successful.
$output = call_user_func([$wrap, $routes[$command]], $env, $target);
$error = $wrap->getExitCode() > 0;
// Finally, display the output of the command.
header('Content-Type: text/plain', true, $error ? 500 : 200);
if ($debug) {
// Show what command was executed based on request parameters.
$args = implode(', ', [var_export($env, true), var_export($target, true)]);
echo "DEBUG: $command($args)" . PHP_EOL . PHP_EOL;
}
echo $output;