# booktics/1.0.3/trunk/base/booktics.php

Booktics – Appointment Booking Calendar for Service Businesses, version 1.0.3. 191 lines.

- Page: https://pluginprobe.com/plugins/booktics/1.0.3/code/trunk/base/booktics.php
- Raw: https://pluginprobe.com/plugins/booktics/1.0.3/raw/trunk/base/booktics.php
- Modified: 2025-07-10T04:07:52+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/booktics/1.0.3/code/trunk/base/booktics.php#L10-L20`.

```php
<?php
/**
 * Booktics Main Class
 *
 * @package Booktics/Booktics
 */

namespace Booktics;

use Booktics\Container\Container;

/**
 * Class Booktics
 */
class Booktics {

    /**
     * Plugin version.
     *
     * @var string
     */
    public $version;

    /**
     * Plugin file.
     *
     * @var string
     */
    public $plugin_file;

    /**
     * Plugin directory.
     *
     * @var string
     */
    public $plugin_directory;

    /**
     * @var string
     */
    public $build_url;

    /**
     * Plugin base name.
     *
     * @var string
     */
    public $basename;

    /**
     * Plugin text directory path.
     *
     * @var string
     */
    public $text_domain_directory;

    /**
     * Plugin text directory path.
     *
     * @var string
     */
    public $template_directory;

    /**
     * Plugin assets directory path.
     *
     * @var string
     */
    public $assets_url;

    /**
     * Plugin url.
     *
     * @var string
     */
    public $plugin_url;

    /**
     * Container that holds all the services.
     *
     * @var Container
     */
    public $container;

    /**
     * Booktics Constructor.
     */
    public function __construct() {
        $this->init();
        add_action( 'init', array( $this, 'init_classes' ) );
    }

    /**
     * Initialize the plugin.
     *
     * @return void
     */
    protected function init(): void {
        $this->version               = '1.0.1';
        $this->plugin_file           = BOOKTICS_FILE;
        $this->plugin_directory      = BOOKTICS_DIR;
        $this->basename              = plugin_basename( $this->plugin_file );
        $this->text_domain_directory = $this->plugin_directory . '/languages';
        $this->template_directory    = $this->plugin_directory . '/templates';
        $this->plugin_url            = plugins_url( '', $this->plugin_file );
        $this->assets_url            = $this->plugin_url . '/assets';
        $this->build_url             = $this->plugin_url . '/build';
        register_activation_hook(
            $this->plugin_file, array(
				$this,
				'activate',
            )
        );
        register_deactivation_hook(
            $this->plugin_file, array(
				$this,
				'deactivate',
            )
        );
    }

    /**
     * Init classes
     *
     * @return  void
     */
    public function init_classes() {
        if ( ! session_id() ) {
            session_start();
        }
        $service_provider = $this->get_container()->get( 'global' );

        // Initilize Plugin Banner Notice.
        Plugin_Notice::run();
    }

    /**
     * Get container
     *
     * @return  Container
     */
    public function get_container() {
        return booktics_container();
    }

    /**
     * Initializes the Booktics class.
     *
     * Checks for an existing WeMeal instance
     * and if it doesn't find one, creates it.
     *
     * @return Booktics
     */
    public static function instance(): Booktics {
        static $instance = false;

        if ( ! $instance ) {
            $instance = new self();
        }

        return $instance;
    }

    /**
     * Trigger plugin activation class
     *
     * @return void
     */
    public function activate() {
        Activate::handle();
    }

    /**
     * Trigger plugin deactivation
     *
     * @return void
     */
    public function deactivate() {
        Deactivate::handle();
    }

    /**
     * returns assets url
     *
     * @return string
     */
    public static function assets_url(): string {
        return trailingslashit( plugins_url( '', BOOKTICS_FILE ) . '/assets' );
    }
}

```
