PluginProbe
Independent Analytics – WordPress Analytics Plugin / 1.9
Independent Analytics – WordPress Analytics Plugin v1.9
2.15.5 2.15.4 2.15.3 2.15.2 2.15.1 2.15.0 2.14.10 trunk 1.1 1.10 1.10.1 1.11 1.12 1.13 1.14 1.15 1.16 1.17 1.17.1 1.17.2 1.17.3 1.17.4 1.18 1.18.1 1.19.0 All 120 releases
independent-analytics / inc / migrations / migration_job.php
migration_job.php
38 lines 748 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace IAWP;
4
5 class Migration_Job extends WP_Async_Request
6 {
7 /**
8 * @var string
9 */
10 protected $action = 'iawp_database_migration';
11
12 /**
13 * Handle
14 *
15 * Override this method to perform any actions required
16 * during the async request.
17 *
18 * @return void
19 */
20 protected function handle(): void
21 {
22 Migration::create_or_migrate();
23 }
24
25 /**
26 * Dispatch a migration job if the database is out of date and no migration is currently running
27 *
28 * @return void
29 */
30 public static function maybe_dispatch(): void
31 {
32 if (Migration::should_migrate()) {
33 $migration_job = new self();
34 $migration_job->dispatch();
35 }
36 }
37 }
38