Toolbar::getVars

@return \ArrayObject
775225
public function getVars()
    {
        $vars = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS);

        $vars->env = $_ENV;
        $vars->server = $_SERVER;
        $vars->session = $_SESSION;
        $vars->cookies = $_COOKIE;
        $vars->get = $_GET;
        $vars->post = $_POST;
        $vars->files = $_FILES;

        if (function_exists('apache_request_headers')) {
            $vars->headers = apache_request_headers();
        } elseif (function_exists('getallheaders')) {
            $vars->headers = getallheaders();
        } else {
            $vars->headers = [];
            foreach ($_SERVER as $name => $value) {
                if (substr($name, 0, 5) == 'HTTP_') {
                    $vars->headers[ str_replace(' ', '-',
                        ucwords(strtolower(str_replace('_', ' ', substr($name, 5))))) ] = $value;
                }
            }
        }

        return $vars;
    }
643429
public static function getRequestVariables()
    {
        $vars = $_REQUEST;
        unset($vars['appId']);
        unset($vars['appSecret']);
        unset($vars['clientId']);
        unset($vars['clientSecret']);
        unset($vars['itemid']);
        unset($vars['identifier']);
        unset($vars['emailPreview']);
        unset($vars['telPreview']);
        unset($vars['fetchURL']);
        unset($vars['version']);

        //Try to remove the random variable added for get requests to break cache
        foreach ($vars as $key => $var) {
            if ($var === '' && preg_match('/^[a-z0-9]{8}/', $key)) {
                unset ($vars[$key]);
            }
        }

        return $vars;
    }
121756
public function toArray()
    {
        if ($this->gettersVariable) {
            $var = $this->gettersVariable;

            return $this->{$var};
        }

        $properties = (array)$this;
        $list = [];
        foreach ($properties as $property => $value) {
            if ($property[0] !== "\0") {
                $list[$property] = $value;
            }
        }

        return $list;
    }
922071
public function getVariables() 
	{
		$this->attributes['type'] = $this->type;
		
		if(isset($this->attributes['class'])) {
			$this->attributes['class'] = trim($this
			->attributes['class'].' form-control');
		} else {
			$this->attributes['class'] = 'form-control';
		}
		
		return array('attributes' => $this->attributes);
	}
1346100
public function getVariableRefs()
	{
		$variableRefs = array();

		if ( $this->qnameXPath2Expression )
		{
			$variableRefs = array_merge( $variableRefs, $this->qnameXPath2Expression->getParameterQNames() );
		}

		return $variableRefs;
	}
355090
public function getVariables()
    {
        if (!$this->getUseIndex()) {
            return array();
        }

        $staticVariables = $this->reflection->getStaticVariables();

        // When looping through the variables, we will only take the variables that are
        // specified in the use clause, and will not take any other static variables
        // that may be used by the Closures, allowing this to re-create its state.
        $usedVariables = array();

        foreach ($this->getUseClauseVariables() as $variable) {
            $variable = trim($variable, ' $&');

            $usedVariables[$variable] = $staticVariables[$variable];
        }

        return $usedVariables;
    }
648904
protected function findAllVariablePositions(): array
    {
        return TokenHelper::findNextAll(
            $this->file->getBaseFile(),
            [T_VARIABLE],
            $this->stackPos + 1,
            $this->file->findNext([T_CLOSE_PARENTHESIS], $this->stackPos + 1)
        );
    }
797560
public function getVariableRefs()
	{
		$variableRefs = array();

		if ( $this->qnameXPath2Expressions )
		{
			foreach ( $this->qnameXPath2Expressions as $expression )
			{
				$variableRefs = array_merge( $variableRefs, $expression->getParameterQNames() );
			}
		}

		return $variableRefs;
	}
148474
protected function _getTemplateVars() {
        $vars = array(
            'default_backend'   => $this->_getDefaultBackend(),
            'admin_backend'     => $this->_getAdminBackend(),
            'admin_frontname'   => $this->_getAdminFrontname(),
            'normalize_host_target' => $this->_getNormalizeHostTarget(),
            'url_base_regex'    => $this->getBaseUrlPathRegex(),
            'allowed_hosts_regex'   => $this->getAllowedHostsRegex(),
            'url_excludes'  => $this->_getUrlExcludes(),
            'get_param_excludes'    => $this->_getGetParamExcludes(),
            'get_param_ignored' => $this->_getIgnoreGetParameters(),
            'default_ttl'   => $this->_getDefaultTtl(),
            'enable_get_excludes'   => ($this->_getGetParamExcludes() ? 'true' : 'false'),
            'enable_get_ignored' => ($this->_getIgnoreGetParameters() ? 'true' : 'false'),
            'send_unmodified_url' => ($this->_sendUnModifiedUrlToBackend() ? 'true' : 'false'),
            'debug_headers' => $this->_getEnableDebugHeaders(),
            'grace_period'  => $this->_getGracePeriod(),
            'force_cache_static'    => $this->_getForceCacheStatic(),
            'simple_hash_static'    => $this->_getSimpleHashStatic(),
            'generate_session_expires'    => $this->_getGenerateSessionExpires(),
            'generate_session'    => $this->_getGenerateSession(),
            'generate_session_start'    => $this->_getGenerateSessionStart(),
            'generate_session_end'    => $this->_getGenerateSessionEnd(),
            'static_extensions' => $this->_getStaticExtensions(),
            'static_ttl'    => $this->_getStaticTtl(),
            'url_ttls'      => $this->_getUrlTtls(),
            'enable_caching'    => $this->_getEnableCaching(),
            'crawler_acl'   => $this->_vcl_acl('crawler_acl',
                $this->_getCrawlerIps()),
            'esi_cache_type_param'  =>
                Mage::helper('turpentine/esi')->getEsiCacheTypeParam(),
            'esi_method_param'  =>
                Mage::helper('turpentine/esi')->getEsiMethodParam(),
            'esi_ttl_param' => Mage::helper('turpentine/esi')->getEsiTtlParam(),
            'secret_handshake'  => Mage::helper('turpentine/varnish')
                ->getSecretHandshake(),
            'crawler_user_agent_regex'  => $this->_getCrawlerUserAgents(),
            // 'lru_factor'    => $this->_getLruFactor(),
            'debug_acl'     => $this->_vcl_acl('debug_acl',
                $this->_getDebugIps()),
            'custom_c_code' => file_get_contents(
                $this->_getVclTemplateFilename(self::VCL_CUSTOM_C_CODE_FILE) ),
            'esi_private_ttl'   => Mage::helper('turpentine/esi')
                ->getDefaultEsiTtl(),
        );

        if ((bool) Mage::getStoreConfig('turpentine_vcl/urls/bypass_cache_store_url')) {
            $vars['allowed_hosts'] = $this->_vcl_sub_allowed_hosts_regex();
        }

        if (Mage::getStoreConfig('turpentine_vcl/normalization/encoding')) {
            $vars['normalize_encoding'] = $this->_vcl_sub_normalize_encoding();
        }
        if (Mage::getStoreConfig('turpentine_vcl/normalization/user_agent')) {
            $vars['normalize_user_agent'] = $this->_vcl_sub_normalize_user_agent();
        }
        if (Mage::getStoreConfig('turpentine_vcl/normalization/host')) {
            $vars['normalize_host'] = $this->_vcl_sub_normalize_host();
        }
        if (Mage::getStoreConfig('turpentine_vcl/normalization/cookie_regex')) {
            $vars['normalize_cookie_regex'] = $this->_getNormalizeCookieRegex();
        }
        if (Mage::getStoreConfig('turpentine_vcl/normalization/cookie_target')) {
            $vars['normalize_cookie_target'] = $this->_getNormalizeCookieTarget();
        }

        if (Mage::getStoreConfig('turpentine_vcl/maintenance/enable')) {
            // in vcl_recv set the allowed IPs otherwise load the vcl_error (v3)/vcl_synth (v4)
            $vars['maintenance_allowed_ips'] = $this->_vcl_sub_maintenance_allowed_ips();
            // set the vcl_error from Magento database
            $vars['vcl_synth'] = $this->_vcl_sub_synth();
        }

        if (Mage::getStoreConfig('turpentine_varnish/general/https_proto_fix')) {
            $vars['https_proto_fix'] = $this->_vcl_sub_https_proto_fix();
        }
        
        if (Mage::getStoreConfig('turpentine_varnish/general/https_redirect_fix')) {
            $vars['https_redirect'] = $this->_vcl_sub_https_redirect_fix();
            if (Mage::getStoreConfig('turpentine_varnish/servers/version') == '4.0' || Mage::getStoreConfig('turpentine_varnish/servers/version') == '4.1') {
                $vars['vcl_synth'] = $this->_vcl_sub_synth_https_fix();
            }
        }

        foreach (array('', 'top') as $position) {
            $customIncludeFile = $this->_getCustomIncludeFilename($position);
            if (is_readable($customIncludeFile)) {
                $key = 'custom_vcl_include';
                $key .= ($position) ? '_'.$position : '';
                $vars[$key] = file_get_contents($customIncludeFile);
            }
        }

        return $vars;
    }
953663
public function getVariables() 
	{	
		if($this->image) {
			$this->type = 'image';
			$this->attributes['src'] = $this->image;
		}
		
		return parent::getVariables();
	}
1020467
public function getVariables() 
	{
		$variables = parent::getVariables();
		
		$loaded = self::$loaded;
		self::$loaded = true;
		
		$variables['loaded'] = $loaded;
		
		return $variables;
	}
1005349
protected function _getTemplateVars() {
        $vars = parent::_getTemplateVars();
        $vars['advanced_session_validation'] =
            $this->_getAdvancedSessionValidation();

        //dispatch event to allow other extensions to add custom vcl template variables
        Mage::dispatchEvent('turpentine_get_templatevars_after', array(
            'vars' => &$vars,
            'vcl_version'=> self::VCL_VERSION
        ));

        return $vars;
    }
1014443
public function getVariableRefs()
	{
		$variableRefs = isset( $this->dimensionXPath2Expression )
			? $this->dimensionXPath2Expression->getParameterQNames()
			: array();

		foreach ( $this->members as $member )
		{
			if ( isset( $member['qnameXPath2Expression']) )
			{
				$variableRefs = array_merge( $variableRefs, $member['qnameXPath2Expression']->getParameterQNames() );
			}
			else if ( isset( $member['variable'] ) )
			{
				$variableRefs[] = new QName(
					$member['variable']['originalPrefix'],
					$member['variable']['namespace'],
					$member['variable']['name']
				);
			}
		}

		return $variableRefs;
	}
591772
public function getVariables() 
	{
		$order = null;
		if(!isset($this->query['sort']) || $this->query['sort'] != $this->key) {
			$this->query['sort'] = $this->key;
			$this->query['order'] = self::ASC;
		} else if($this->query['order'] == self::ASC) {
			$order = self::ASC;
			$this->query['order'] = self::DESC;
		} else {
			$order = self::DESC;
			$this->query['order'] = self::ASC;
		}
		
		return array(
			'url'	=> $this->url,
			'query' => $this->query,
			'label' => $this->label,
			'order'	=> strtolower($order),
			'class'	=> $this->className);
	}
8540
protected function getTwigVariables()
    {
        return array(
            'config' => $this->getConfig(),
            'base_dir' => rtrim($this->getRootDir(), '/'),
            'base_url' => rtrim($this->getBaseUrl(), '/'),
            'theme_dir' => $this->getThemesDir() . $this->getConfig('theme'),
            'theme_url' => $this->getBaseThemeUrl() . $this->getConfig('theme'),
            'site_title' => $this->getConfig('site_title'),
            'meta' => $this->meta,
            'content' => $this->content,
            'pages' => $this->pages,
            'prev_page' => $this->previousPage,
            'current_page' => $this->currentPage,
            'next_page' => $this->nextPage,
            'version' => static::VERSION
        );
    }
335791
public function getVar($varName)
    {
        if (!isset($this->variableList[$varName])) {
            trigger_error('Variable "' . $varName . '" isn\'t defined in View.', E_USER_WARNING);
            return false;
        }
        return $this->variableList[$varName];
    }
739971
public function getVariables()
    {
        $variables = ['search.query' => $this->catalogSearchData->getEscapedQueryText()];

        if ($layer = $this->catalogLayer) {
            $productCollection = $layer->getProductCollection();
            $variables['search.is_spellchecked'] = (int) $productCollection->isSpellchecked();
        }

        return $variables;
    }