public static function getDebugBar()
    {
        if (self::$debugbar !== null) {
            return self::$debugbar;
        }

        $reasons = self::disabledCriteria();
        if (!empty($reasons)) {
            self::$debugbar = false; // no need to check again
            return;
        }

        self::initDebugBar();

        if (!self::$debugbar) {
            throw new Exception("Failed to initialize the DebugBar");
        }

        return self::$debugbar;
    }