PHP 8.0.30
Preview: Database.php Size: 856 B
//home/certprox/template.certproxywizard.com/wp-content/plugins/hostinger-reach/src/Setup/Database.php

<?php

namespace Hostinger\Reach\Setup;

use Hostinger\Reach\Admin\Database\DatabaseTable;

if ( ! defined( 'ABSPATH' ) ) {
    die;
}

class Database {

    /** @var DatabaseTable[] */
    private array $tables;

    public function __construct( array $tables ) {
        $this->tables = $tables;
    }

    public function init(): void {
        $db_version_option = HOSTINGER_REACH_PLUGIN_SLUG . '-db-version';
        $database_version  = get_option(
            $db_version_option,
            ''
        );

        if ( $database_version !== HOSTINGER_REACH_DB_VERSION ) {
            $this->create_tables();
            update_option( $db_version_option, HOSTINGER_REACH_DB_VERSION, false );
        }
    }

    private function create_tables(): void {
        foreach ( $this->tables as $table ) {
            $table->create();
        }
    }
}

Directory Contents

Dirs: 0 × Files: 5

Name Size Perms Modified Actions
1.20 KB lrw-r--r-- 2026-06-10 16:30:29
Edit Download
26.55 KB lrw-r--r-- 2026-06-10 16:30:29
Edit Download
882 B lrw-r--r-- 2026-06-10 16:30:29
Edit Download
856 B lrw-r--r-- 2026-06-10 16:30:29
Edit Download
1.34 KB lrw-r--r-- 2026-06-10 16:30:29
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).