# fluent-booking/trunk/boot/app.php

Fluent Booking – The Ultimate Appointments Scheduling, Events Booking, Events Calendar Solution, version trunk. 58 lines.

- Page: https://pluginprobe.com/plugins/fluent-booking/trunk/code/boot/app.php
- Raw: https://pluginprobe.com/plugins/fluent-booking/trunk/raw/boot/app.php
- Modified: 2026-09-09T13:29:18+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/fluent-booking/trunk/code/boot/app.php#L10-L20`.

```php
<?php

defined( 'ABSPATH' ) || exit;

use FluentBooking\Framework\Foundation\Application;
use FluentBooking\App\Hooks\Handlers\ActivationHandler;
use FluentBooking\App\Hooks\Handlers\DeactivationHandler;
use FluentBooking\Database\DBMigrator;

return function ($file) {

    $app = new Application($file);

    register_activation_hook($file, function ($network_wide = false) use ($app) {
        // WordPress passes $network_wide; dropping it left every blog but the
        // activating one unmigrated and unscheduled on a network activation.
        ($app->make(ActivationHandler::class))->handle($network_wide);
    });

    register_deactivation_hook($file, function () use ($app) {
        ($app->make(DeactivationHandler::class))->handle();
    });

    require_once(FLUENT_BOOKING_DIR . 'boot/action_scheduler_loader.php');

    add_action('plugins_loaded', function () use ($app) {
        do_action('fluent_booking/loaded', $app);

        $currentDBVersion = get_option('fluent_booking_db_version');

        if (!$currentDBVersion || version_compare($currentDBVersion, FLUENT_BOOKING_DB_VERSION, '<')) {
            // plugins_loaded, so every request during an upgrade reaches this.
            if (!get_transient('fluent_booking_db_migration_lock')) {
                set_transient('fluent_booking_db_migration_lock', 1, 5 * MINUTE_IN_SECONDS);

                DBMigrator::run();

                // Stamped after the run: a failure mid-migration used to leave
                // the version current against a schema that never changed.
                update_option('fluent_booking_db_version', FLUENT_BOOKING_DB_VERSION, 'no');

                delete_transient('fluent_booking_db_migration_lock');
            }
        }

        if (defined('FLUENT_BOOKING_PRO_VERSION') && version_compare(FLUENT_BOOKING_MIN_PRO_VERSION, FLUENT_BOOKING_PRO_VERSION, '>')) {
            if (!current_user_can('manage_options')) {
                return;
            }
            add_filter('fluent_booking/dashboard_notices', function ($notices) {
                $updateUrl = admin_url('plugins.php?s=fluent-booking&plugin_status=all&fluent-booking-pro-check-update=' . time());
                $notices[] = '<div class="error">' . esc_html__('FluentBookingPro plugin needs to be updated to the latest version.', 'fluent-booking') . ' <a href="' . esc_url($updateUrl) . '">' . esc_html__('Click here to update', 'fluent-booking') . '</a></div>';
                return $notices;
            });
        }
    });
};

```
