HEX
Server: LiteSpeed
System: Linux node612.namehero.net 4.18.0-553.121.1.lve.el8.x86_64 #1 SMP Thu Apr 30 16:40:41 UTC 2026 x86_64
User: dfwparty (1186)
PHP: 8.3.31
Disabled: NONE
Upload Files
File: /home/dfwparty/www/wp-content/mu-plugins/wp-toolkit/Common/Installation.php
<?php
// Copyright 1999-2026. WebPros International GmbH. All rights reserved.

namespace Webpros\WptkWpPlugin\WpToolkit\Common;

use Webpros\WptkWpPlugin\WpToolkit\Common\Services\ApiTokenParser;

class Installation
{
    /**
     * @var int|null
     */
    private $installationId;

    /**
     * @var Installation|null
     */
    private static $instance = null;

    private function __construct()
    {
        try {
            $token = (new ApiTokenParser())->parse(ApiTokenParser::getTokenFromConfig());
            $this->installationId = $token->getInstallationId();
        } catch (\RuntimeException $e) {
            $this->installationId = null;
        }
    }

    /**
     * @return Installation
     */
    public static function getInstance()
    {
        if (self::$instance === null) {
            self::$instance = new self();
        }

        return self::$instance;
    }

    /**
     * @return int|null
     */
    public function getInstallationId()
    {
        return $this->installationId;
    }
}