PluginProbe
Fluent Booking – The Ultimate Appointments Scheduling, Events Booking, Events Calendar Solution / trunk
Fluent Booking – The Ultimate Appointments Scheduling, Events Booking, Events Calendar Solution vtrunk
2.4.0 2.3.0 2.2.5 2.2.0 2.1.2 2.1.1 trunk 1.10.0 1.10.01 1.10.02 1.5.0 1.5.01 1.5.02 1.5.1 1.5.10 1.5.20 1.5.21 1.5.22 1.5.23 1.5.24 1.5.25 1.6.0 1.7.0 1.7.1 1.7.2 All 33 releases
fluent-booking / app / Hooks / Handlers / ActivationHandler.php

ActivationHandler.php in Fluent Booking – The Ultimate Appointments Scheduling, Events Booking, Events Calendar Solution trunk, at app/Hooks/Handlers/ActivationHandler.php

43 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 FluentBooking\App\Hooks\Handlers;
4
5 use FluentBooking\Framework\Foundation\Application;
6 use FluentBooking\Database\DBMigrator;
7 use FluentBooking\Database\DBSeeder;
8
9 class ActivationHandler
10 {
11 protected $app = null;
12
13 public function __construct(Application $app)
14 {
15 $this->app = $app;
16 }
17
18 public function handle($network_wide = false)
19 {
20 DBMigrator::run($network_wide);
21 DBSeeder::run();
22
23 $this->registerWpCron();
24
25 update_option('fluent_booking_db_version', FLUENT_BOOKING_DB_VERSION, 'no');
26 }
27
28 public function registerWpCron()
29 {
30 $fiveMinutesHook = 'fluent_booking_five_minutes_tasks';
31 $dailyHook = 'fluent_booking/daily_tasks';
32
33 if(function_exists('\as_schedule_recurring_action')) {
34 if (!\as_next_scheduled_action($fiveMinutesHook)) {
35 \as_schedule_recurring_action(time(), (60 * 5), $fiveMinutesHook, [], 'fluent-booking', true);
36 }
37 if (!\as_next_scheduled_action($dailyHook)) {
38 \as_schedule_recurring_action(time(), (60 * 60 * 24), $dailyHook, [], 'fluent-booking', true);
39 }
40 }
41 }
42 }
43