HEX
Server: LiteSpeed
System: Linux server315.web-hosting.com 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: globfdxw (6114)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //home/globfdxw/www/wp-content/plugins/give/src/MigrationLog/MigrationLogServiceProvider.php
<?php

namespace Give\MigrationLog;

use Give\Framework\Migrations\MigrationsRegister;
use Give\Helpers\Hooks;
use Give\MigrationLog\Helpers\Assets;
use Give\MigrationLog\Helpers\Environment;
use Give\MigrationLog\Migrations\CreateMigrationsTable;
use Give\MigrationLog\Migrations\MigrateCompletedMigrations;
use Give\ServiceProviders\ServiceProvider;

/**
 * Class MigrationLogServiceProvider
 * @package Give\MigrationLog
 *
 * @since 2.10.0
 */
class MigrationLogServiceProvider implements ServiceProvider
{
    /**
     * @inheritdoc
     */
    public function register()
    {
        global $wpdb;

        $wpdb->give_migrations = "{$wpdb->prefix}give_migrations";

        give()->singleton(MigrationLogRepository::class);
        give()->singleton(MigrationLogFactory::class);
    }

    /**
     * @inheritdoc
     */
    public function boot()
    {
        give(MigrationsRegister::class)->addMigrations(
            [
                CreateMigrationsTable::class,
                MigrateCompletedMigrations::class,
            ]
        );

        // Hook up
        if (Environment::isMigrationsPage()) {
            Hooks::addAction('admin_enqueue_scripts', Assets::class, 'enqueueScripts');
        }
    }
}