| 1 |
<?php |
| 2 |
|
| 3 |
defined( 'ABSPATH' ) || exit; |
| 4 |
|
| 5 |
use FluentBooking\Framework\Foundation\Application; |
| 6 |
use FluentBooking\App\Hooks\Handlers\ActivationHandler; |
| 7 |
use FluentBooking\App\Hooks\Handlers\DeactivationHandler; |
| 8 |
|
| 9 |
return function ($file) { |
| 10 |
|
| 11 |
$app = new Application($file); |
| 12 |
|
| 13 |
register_activation_hook($file, function () use ($app) { |
| 14 |
($app->make(ActivationHandler::class))->handle(); |
| 15 |
}); |
| 16 |
|
| 17 |
register_deactivation_hook($file, function () use ($app) { |
| 18 |
($app->make(DeactivationHandler::class))->handle(); |
| 19 |
}); |
| 20 |
|
| 21 |
require_once(FLUENT_BOOKING_DIR . 'boot/action_scheduler_loader.php'); |
| 22 |
|
| 23 |
add_action('plugins_loaded', function () use ($app) { |
| 24 |
do_action('fluent_booking/loaded', $app); |
| 25 |
}); |
| 26 |
}; |
| 27 |
|