获取服务器相关变量（兼容Web模式）

@return array|null
333596
public function getServer()
    {
        if ($this->server === null) {
            if (isset($_SERVER['argv'])) {
                $this->server = $_SERVER['argv'];
                array_shift($this->server);
            } else {
                $this->server = [];
            }
        }

        return $this->server;
    }
65669
public function getEnvironments()
    {
        if (isset($this->values['environments'])) {
            $environments = [];
            foreach ($this->values['environments'] as $key => $value) {
                if (is_array($value)) {
                    $environments[$key] = $value;
                }
            }

            return $environments;
        }

        return null;
    }
486940
public function getWebsite()
        {
            return isset($this->_data[self::PROFILE][self::WEBSITE]) ? $this->_data[self::PROFILE][self::WEBSITE] : null;
        }
819909
protected function getSourcesContent()
    {
        if (empty($this->sources)) {
            return null;
        }

        $content = array();

        foreach ($this->sources as $sourceFile) {
            $content[] = file_get_contents($sourceFile);
        }

        return $content;
    }
977805
public function getQueryParams()
    {
        if (isset($this->_queryParams)) {
            return $this->_queryParams;
        }

        if ($queryString = $this->getQueryString()) {
            $result = [];
            parse_str($queryString, $result);
            return $this->_queryParams = $result;
        }

        return $this->_queryParams;
    }
1361685
public function getLinkPage()
    {
        $pageId = (int) $this->getParsedValue()->PageID;
        if (!$pageId) {
            return null;
        }

        return DataObject::get_by_id(SiteTree::class, $pageId);
    }
973598
public function content()
        {
            $cart = $this->getContent();

            $rows = $cart->_fields;

            if (!count($rows)) {
                return null;
            }

            $content = array();

            foreach ($rows as $rowId) {
                $content[$rowId] = $cart->$rowId;
            }

            return $content;
        }
1363045
public function prepareSearchParam() {
        if (isset($this->request['searchFields']) and ! empty($this->request['searchFields'])) {
            $returnSearch = Array();
            $countSearchFields = 0;

            foreach ($this->request['searchFields'] as $key => $value) {
                $returnSearch[$countSearchFields]['indexColumn'] = $key;
                $returnSearch[$countSearchFields]['valueColumn'] = $value;
                $countSearchFields++;
            }
            return $returnSearch;
        } else {
            return null;
        }
    }
874282
public function get_search_set()
    {
        if (empty($this->search_set)) {
            return null;
        }

        return array(
            $this->search_string,
            $this->search_set,
            $this->search_charset,
            $this->search_sort_field,
            $this->search_sorted,
        );
    }
1130893
public function get_url_params() {
        return array(
            self::PAGEVAR => $this->page,
            self::PERPAGEVAR => $this->perpage,
            self::SORTVAR => $this->sort,
            self::SORTDIRECTIONVAR => $this->sortdirection
        );
    }
1229440
public function getQuery()
    {
        $result = null;
        if (isset($this->_data['response']['GeoObjectCollection']['metaDataProperty']['GeocoderResponseMetaData']['request'])) {
            $result = $this->_data['response']['GeoObjectCollection']['metaDataProperty']['GeocoderResponseMetaData']['request'];
        }
        return $result;
    }
675836
public function getFirst()
    {
        if (is_array($this->rows)) {
            $rows = &$this->rows;
        } else {
            $query = clone $this->query;
            $query->setLimit(1);
            $rows = $query->getResult();
        }

        return (isset($rows[0])) ? $rows[0] : null;
    }
810435
public function resolve()
    {
        $httpHost = $this->request->getHttpHost();
        $domains = explode('.', $httpHost);
        $level = config('localizer.domain.level', 3);

        return ($total = count($domains)) >= $level ? $domains[$total - $level] : null;
    }
356938
public function toArray() {
        $arr = array_filter(
                array(
                    'v' => $this->getValueForArray(),
                    'f' => $this->f,
                    'p' => $this->p,
                ), function ($val) { return !is_null($val);}
        );
        // mm, some charts don't work if 'v' is not present
        if (!isset($arr['v'])) {
            $arr['v'] = null;
        }
        return $arr;
    }
460795
public function resolve()
    {
        $result = $this->app->getUrlManager()->parseRequest($this);
        if ($result !== false) {
            [$route, $params] = $result;
            if ($this->_queryParams === null) {
                $_GET = $params + $_GET; // preserve numeric keys
            } else {
                $this->_queryParams = $params + $this->_queryParams;
            }

            return [$route, $this->getQueryParams()];
        }

        throw new NotFoundHttpException(Yii::t('yii', 'Page not found.'));
    }
309231
protected function getUrl()
    {
        $url = $this->path['url'];

        $uri    = is_array($url) ? $url[0] : $url;
        $params = is_array($url) ? array_slice($url, 1) : null;

        if (Utils::isAbsoluteUrl($uri)) {
            return $uri;
        }

        return url($uri, $params);
    }
903620
public function getContext(): ?array
    {
        if ($this->currentRequest === null) {
            return null;
        }

        $controller = null;

        if ($route = $this->currentRequest->route()) {
            $controller = $route->controller;

            if (! $controller && ! is_string($route->action['uses'])) {
                $controller = $route->action['uses'];
            }
        }

        return [
            'uri' => $this->currentRequest->getUri(),
            'method' => $this->currentRequest->getMethod(),
            'controller' => $controller ? $this->cloner->cloneVar(class_basename($controller)) : $controller,
            'identifier' => spl_object_hash($this->currentRequest),
        ];
    }