<?php
namespace ARCHM;

class DBLoader {

    public function __construct() {
        $this->initialize_database();
    }

    /**
     * Initialize the database table.
     *
     * @since 1.0
     * @author Siam Maruf
     */
    // phpcs:ignore PHPCompatibility.FunctionDeclarations.NewReturnTypeDeclarations.voidFound
    private function initialize_database(): void {
        $database = new \ARCHM\Features\ActivityLogDB();
        $database->create_table();

        // Create analytics cache table (Pro feature)
        if ( function_exists('master_archive_pro') && class_exists('\ARCHM_PRO\Features\AnalyticsCacheTable') ) {
            $cache_table = \ARCHM_PRO\Features\AnalyticsCacheTable::get_instance();
            $cache_table->create_table();
        }
    }
}
