Get the value of a global variable.

@param string $variable (required) The variable to get
@return Variable
@throws InvalidParameterException
763734
public function getGlobalVar($variable)
    {
        $uri = "asterisk/variable?variable=$variable";

        try {
            $response = $this->client->getEndpoint()->get($uri);
        } catch (RequestException $e) {
            $this->processRequestException($e);
        }

        return new Variable(\GuzzleHttp\json_decode($response->getBody()));
    }
353954
public function show(string $variable, array $params = [])
    {
        $path = $this->buildVariablesPath($variable);

        return $this->get($path, $params);
    }
894387
public function getCustomValue($key)
    {
        if (!array_key_exists($key, $this->customValues)) {
            throw InvalidPayloadException::notExistingCustomValue($key);
        }

        return $this->customValues[$key];
    }
643997
public function issetVariable($variable)
    {
        // Encrypt the variable-name?
        if (true === $this->hasEncryption()) {
            $variable = $this->encrypt($variable);
        }

        // return the isset status of given variable
        return (true === isset($_SESSION[$variable]));
    }
145360
private function globalVar() {
    if ($this->currentType === T_VARIABLE) {
      return $this->mustMatchToken(T_VARIABLE);
    }
    elseif ($this->currentType === '$') {
      if ($this->isLookAhead('{')) {
        return $this->_compoundVariable();
      }
      else {
        $node = new VariableVariableNode();
        $this->mustMatch('$', $node);
        $node->addChild($this->variable());
        return $node;
      }
    }
    throw new ParserException(
      $this->filename,
      $this->iterator->getLineNumber(),
      $this->iterator->getColumnNumber(),
      'expected a global variable (eg. T_VARIABLE)');
  }
173276
public static function get($variable) {
		self::startSessionIfNeeded();
		// If it exists, and we do not want to overwrite, then throw exception
		if (! self::has($variable)) {
			throw new \Exception("{$variable} does not exist in the store.");
		}

		return unserialize($_SESSION[$variable]);
	}
500484
private static function getToken(GlobalVariables $globalVariable)
    {
        if (!$globalVariable->get('container')->has('security.token_storage')) {
            return;
        }

        return $globalVariable->get('container')->get('security.token_storage')->getToken();
    }
1113240
public function get($name = '')
    {
        if ($name == '') return $this->_get;

        if ($this->getExists($name)) return $_GET[$name];

        throw new GlobalGetKeyNotFoundException('\'' . $name . '\'' . ' key does not exist in $_GET superglobal variable');
    }
312535
public function codes($variable)
    {
        foreach ($this->keywordList('CODES') as $keyword) {
            if ($keyword->subKeys[0] == $variable) {
                return $keyword->values;
            }
        }

        return null;
    }
1326467
protected function getContextVariable($variableName)
    {
        $value = null;

        $view = $this->viewHelperVariableContainer->getView();
        if ($view instanceof FusionAwareViewInterface) {
            $fusionObject = $view->getFusionObject();
            $currentContext = $fusionObject->getRuntime()->getCurrentContext();
            if (isset($currentContext[$variableName])) {
                $value = $currentContext[$variableName];
            }
        }

        return $value;
    }
622848
public function getParameter($key)
    {
        if (empty($this->namedParameters[$key])) {
            throw new InvalidKeyException($key);
        }

        return $this->namedParameters[$key];
    }
332724
public function getVariable($variableName, $defaultValue = null)
    {
        return isset($this->variables[$variableName]) ?
            $this->variables[$variableName] : $defaultValue;
    }
843466
public static String get(VariableElement variable) {
    StringBuilder result = new StringBuilder();
    AnnotationMirror qualifier = getQualifier(variable.getAnnotationMirrors());
    if (qualifier != null) {
      qualifierToString(qualifier, result);
    }
    typeToString(variable.asType(), result, '$');
    return result.toString();
  }
1154314
public static function getGlobalVars()
    {
        if (static::$globalVarCache !== null) {
            return static::$globalVarCache;
        }

        $vars = array_filter(ViewFacade::getShared(), function ($var) {
            return is_scalar($var) || is_array($var);
        });

        return static::$globalVarCache = $vars;
    }
1354332
public function getVar($whatVar, $default = null)
    {
        if (is_numeric($whatVar)) {
            $whatVar = (int)$whatVar + 1;

            if (isset($this->uri[$whatVar])) {
                $value = trim($this->uri[$whatVar]);
                return ($value != '') ? $value : $default;
            } else {
                return $default;
            }
        } else {
            // if variable is string, then treat it like GET parameter
            if (isset($_GET[$whatVar])) {
                $value = trim($_GET[$whatVar]);
                return ($value != '') ? $value : $default;
            } else {
                return $default;
            }
        }
    }
44226
public function setParamVariable($paramVariable)
    {
        if (is_bool($paramVariable) === true) {
            $this->paramVariable = $paramVariable;
        } else {
            $msg = "The 'paramVariable' argument must be a boolean value, '" . gettype($paramVariable) . "'.";
            throw new InvalidArgumentException($msg);
        }
    }
175535
public function getParam($var = null)
    {
        $param = $this->_parameters;
        if (null !== $var) {
            if (isset($this->_parameters[$var])) {
                $param = $this->_parameters[$var];
            } else {
                $param = null;
            }
        }

        return $param;
    }