Phalcon\Logger\Adapter\Firelogger::checkPassword PHP Метод

checkPassword() защищенный Метод

Disables/enables the firelogger appropriately.
protected checkPassword ( ) : boolean
Результат boolean
    protected function checkPassword()
    {
        if (!isset($this->options['password'])) {
            $this->enabled = true;
            return true;
        }
        if (isset($_SERVER['HTTP_X_FIRELOGGERAUTH'])) {
            $clientHash = $_SERVER['HTTP_X_FIRELOGGERAUTH'];
            $serverHash = md5("#FireLoggerPassword#" . $this->options['password'] . "#");
            if ($clientHash !== $serverHash) {
                // passwords do not match
                $this->enabled = false;
                if ($this->options['triggerError']) {
                    trigger_error("FireLogger passwords do not match. Have you specified correct password FireLogger extension?");
                }
            } else {
                $this->enabled = true;
            }
        } else {
            $this->enabled = false;
        }
        return $this->enabled;
    }