PluginProbe ʕ •ᴥ•ʔ
Backup Migration / 2.1.7
Backup Migration v2.1.7
2.1.7 2.1.6 2.1.5.2 trunk 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.6.1 1.4.7 1.4.8 1.4.9 1.4.9.1 2.0.0 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.5.1
backup-backup / includes / cron / bootstrap.php
backup-backup / includes / cron Last commit date
tasks 2 weeks ago bootstrap.php 2 weeks ago class-abstract-task.php 2 weeks ago class-task-manager.php 2 weeks ago handler.php 2 weeks ago
bootstrap.php
42 lines
1 <?php
2
3 /**
4 * Background Task Bootstrap
5 *
6 * Loads the task infrastructure and registers every concrete task.
7 * This file is required from three call-sites in backup-backup.php:
8 *
9 * init hook → TaskManager::boot() (normal page loads)
10 * activation hook → TaskManager::on_activation() (plugin activated)
11 * deactivation hook → TaskManager::on_deactivation() (plugin deactivated)
12 *
13 * After requiring this file, call whichever lifecycle method is appropriate.
14 * The file itself performs no side-effects beyond loading and registering so
15 * it is safe to require_once from any call-site.
16 *
17 * ── Adding a new task ────────────────────────────────────────────────────────
18 *
19 * 1. Create `includes/cron/tasks/YourTask.php` extending AbstractTask.
20 * 2. Add the two lines below (require_once + register call).
21 * 3. Done – no other file needs to change.
22 *
23 * ─────────────────────────────────────────────────────────────────────────────
24 */
25
26 // Exit on direct access
27 if (!defined('ABSPATH')) exit;
28
29 // ── Infrastructure ────────────────────────────────────────────────────────────
30
31 require_once __DIR__ . '/class-abstract-task.php';
32 require_once __DIR__ . '/class-task-manager.php';
33
34 // ── Task registration ─────────────────────────────────────────────────────────
35
36 use BMI\Plugin\CRON\TaskManager;
37 use BMI\Plugin\CRON\Tasks\ScheduleKeepaliveTask;
38
39 require_once __DIR__ . '/tasks/class-schedule-keepalive-task.php';
40
41 TaskManager::register(new ScheduleKeepaliveTask());
42