PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.1.0
GiveWP – Donation Plugin and Fundraising Platform v4.1.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
52 lines 1.2 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\Framework\Migrations\MigrationsRegister;
6 use Give\Helpers\Hooks;
7 use Give\MigrationLog\Helpers\Assets;
8 use Give\MigrationLog\Helpers\Environment;
9 use Give\MigrationLog\Migrations\CreateMigrationsTable;
10 use Give\MigrationLog\Migrations\MigrateCompletedMigrations;
11 use Give\ServiceProviders\ServiceProvider;
12
13 /**
14 * Class MigrationLogServiceProvider
15 * @package Give\MigrationLog
16 *
17 * @since 2.10.0
18 */
19 class MigrationLogServiceProvider implements ServiceProvider
20 {
21 /**
22 * @inheritdoc
23 */
24 public function register()
25 {
26 global $wpdb;
27
28 $wpdb->give_migrations = "{$wpdb->prefix}give_migrations";
29
30 give()->singleton(MigrationLogRepository::class);
31 give()->singleton(MigrationLogFactory::class);
32 }
33
34 /**
35 * @inheritdoc
36 */
37 public function boot()
38 {
39 give(MigrationsRegister::class)->addMigrations(
40 [
41 CreateMigrationsTable::class,
42 MigrateCompletedMigrations::class,
43 ]
44 );
45
46 // Hook up
47 if (Environment::isMigrationsPage()) {
48 Hooks::addAction('admin_enqueue_scripts', Assets::class, 'enqueueScripts');
49 }
50 }
51 }
52