PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 2.17.0
GiveWP – Donation Plugin and Fundraising Platform v2.17.0
4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 2.30.0 2.31.0 2.31.1 All 253 releases
give / src / MigrationLog / MigrationLogServiceProvider.php
MigrationLogServiceProvider.php
49 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Give\MigrationLog;
4
5 use Give\Helpers\Hooks;
6 use Give\MigrationLog\Helpers\Assets;
7 use Give\MigrationLog\Helpers\Environment;
8 use Give\ServiceProviders\ServiceProvider;
9 use Give\Framework\Migrations\MigrationsRegister;
10 use Give\MigrationLog\Migrations\CreateMigrationsTable;
11 use Give\MigrationLog\Migrations\MigrateCompletedMigrations;
12
13 /**
14 * Class MigrationLogServiceProvider
15 * @package Give\MigrationLog
16 *
17 * @since 2.10.0
18 */
19 class MigrationLogServiceProvider implements ServiceProvider {
20 /**
21 * @inheritdoc
22 */
23 public function register() {
24 global $wpdb;
25
26 $wpdb->give_migrations = "{$wpdb->prefix}give_migrations";
27
28 give()->singleton( MigrationLogRepository::class );
29 give()->singleton( MigrationLogFactory::class );
30 }
31
32 /**
33 * @inheritdoc
34 */
35 public function boot() {
36 give( MigrationsRegister::class )->addMigrations(
37 [
38 CreateMigrationsTable::class,
39 MigrateCompletedMigrations::class,
40 ]
41 );
42
43 // Hook up
44 if ( Environment::isMigrationsPage() ) {
45 Hooks::addAction( 'admin_enqueue_scripts', Assets::class, 'enqueueScripts' );
46 }
47 }
48 }
49