<?php
final class kavehRTLlicense {
    private $className;
    private $filePath;
    private $fileHash;

    public function __construct($className) {
        if(!kavehTheme::isLocalEnvironment()){
            $this->className = $className;
            $this->filePath = __DIR__ . DIRECTORY_SEPARATOR . $className . '.php';
            $this->fileHash = @sha1_file($this->filePath);
        }
    }

    public function isActive() {
        if ($this->fileHash === '614693cc50ee5799e93c531901d1a14e9442023c' && file_exists($this->filePath)) {
            require_once $this->filePath;

            if (class_exists($this->className) && method_exists($this->className, 'isActive')) {
                $rtlLicenseClass = new $this->className();
                return $rtlLicenseClass->{'isActive'}() === true;
            }
        }

        return true;
    }
}
