HEX
Server: nginx/1.18.0
System: Linux test-ipsremont 5.4.0-214-generic #234-Ubuntu SMP Fri Mar 14 23:50:27 UTC 2025 x86_64
User: ips (1000)
PHP: 8.0.30
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/heifetz/heifetz-app/migration.php
<?php

declare(strict_types=1);

use Helpers\MigrationHelper;
use Helpers\Output;
use Migrations\AbstractMigration;

define('ROOT', realpath(__DIR__) . '/');
const PUBLIC_ROOT = ROOT . '/public';
const UPLOADS_DIR = ROOT . '/uploads';
const TEMP_DIR = ROOT . '/tmp';
date_default_timezone_set('Europe/Moscow');

require_once(ROOT . '/vendor/autoload.php');

require_once(ROOT . '/config.php');
/** @var object $_CONFIG */
require_once(ROOT . '/core/exceptions.php');
require_once(ROOT . '/core/dblib/dblib.php');
if ($_CONFIG->debug) {
    ini_set('display_errors', '1');
    error_reporting(E_ALL);
}
$argv ??= [];
array_shift($argv);
$migrationName = array_shift($argv);

Output::title('Миграции базы данных системы');

if (empty($migrationName)) {
    $newMigrations = MigrationHelper::getNewMigrations();
} else {
    $newMigrations = [str_replace(['migrations/', '.php'], ['Migrations\\', ''], $migrationName)];
}

if (empty($newMigrations)) {
    Output::log('База не требует обновления' . PHP_EOL);
    exit;
}

foreach ($newMigrations as $migrationClass) {
    /** @var AbstractMigration $migration */
    $migration = new $migrationClass();
    $migration->run();
}

Output::success('Миграция завершена');