PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / 1.3.26
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler v1.3.26
1.6.5 1.6.4 1.6.3 1.6.2 1.6.1 1.6.0 1.5.4 1.5.5 1.5.3 1.5.2 1.5.1 1.5.0 1.4.2 1.4.1 1.4.0 1.3.28 1.3.27 1.3.26 1.3.25 1.3.23 1.3.22 1.3.21 1.3.20 1.3.19 trunk All 48 releases
fluent-cart / app / Hooks / Handlers / ActivationHandler.php

ActivationHandler.php in FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler 1.3.26, at app/Hooks/Handlers/ActivationHandler.php

39 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FluentCart\App\Hooks\Handlers;
4
5 use FluentCart\Api\StoreSettings;
6 use FluentCart\Database\DBMigrator;
7
8 class ActivationHandler
9 {
10 public StoreSettings $storeSettings;
11
12 public function handle($network_wide = false)
13 {
14 DBMigrator::migrateUp($network_wide);
15 $this->storeSettings = new StoreSettings();
16 $this->dispatch();
17
18 $this->registerWpCron();
19 }
20
21 public function dispatch()
22 {
23
24 }
25
26 public function registerWpCron()
27 {
28 $fiveMinutesHook = 'fluent_cart/scheduler/five_minutes_tasks';
29 $hourlyHook = 'fluent_cart/scheduler/hourly_tasks';
30 $dailyHook = 'fluent_cart/scheduler/daily_tasks';
31
32 if (function_exists('as_schedule_recurring_action')) {
33 as_schedule_recurring_action(time(), (60 * 5), $fiveMinutesHook, [], 'fluent-cart', true);
34 as_schedule_recurring_action(time(), (60 * 60), $hourlyHook, [], 'fluent-cart', true);
35 as_schedule_recurring_action(time(), (60 * 60 * 24), $dailyHook, [], 'fluent-cart', true);
36 }
37 }
38 }
39