获得请求内容类型参数

@return array
961317
public function getMediaTypeParams(): array
    {
        $contentType = $this->getContentType();
        $contentTypeParams = [];

        if ($contentType) {
            $contentTypeParts = preg_split('/\s*[;,]\s*/', $contentType);
            $contentTypePartsLength = count($contentTypeParts);

            for ($i = 1; $i < $contentTypePartsLength; $i++) {
                $paramParts = explode('=', $contentTypeParts[$i]);
                $contentTypeParams[strtolower($paramParts[0])] = $paramParts[1];
            }

            unset($contentTypeParts, $contentTypePartsLength, $contentType);
        }

        return $contentTypeParams;
    }
1149947
public function getContent()
    {
        if (empty($this->content)) {
            $requestBody = file_get_contents('php://input');
            if (strlen($requestBody) > 0) {
                $this->content = $requestBody;
            }
        }

        return $this->content;
    }
640163
public function getContents()
    {
        $contents = file_get_contents($this->getPath());

        foreach ($this->getReplaces() as $search => $replace) {
            $contents = str_replace('$'.strtoupper($search).'$', $replace, $contents);
        }

        return $contents;
    }
190930
public function getContent()
    {
        $contentAttribute = $this->contentAttribute;
        if ($contentAttribute === false) {
            return null;
        }
        if (is_array($contentAttribute)) {
            $content = [];
            foreach ($contentAttribute as $key => $value) {
                $content[$key] = $this->$value;
            }
            return $content;
        }
        return $this->$contentAttribute;
    }
660217
public function getHeaderArray()
    {
        $headerArray = (count($this->headers) > 0 ? $this->headers : []);
        if ($this->isJson) {
            $headerArray[] = 'Accept: application/json';
        }
        if ($this->isXML) {
            $headerArray[] = 'Accept: text/xml';
        }
        if ($this->method == 'POST' && count($this->data) > 0 && $this->isJson) {
            $headerArray[] = 'Content-type: application/json';
        } elseif ($this->method == 'POST' && count($this->data) > 0 && $this->isXML) {
            $headerArray[] = 'Content-type: text/xml';
        } elseif ($this->method == 'POST' && count($this->data) > 0) {
            $headerArray[] = 'Content-type: application/x-www-form-urlencoded';
        }
        if (count($this->cookies) > 0) {
            $cookies = '';
            foreach ($this->cookies as $key => $value) {
                if (mb_strlen($cookies) > 0) {
                    $cookies .= '; ';
                }
                $cookies .= urlencode($key) . '=' . urlencode($value);
            }
            $headerArray[] = 'Cookie: ' . $cookies;
        }

        return $headerArray;
    }
1022642
public function toArray()
    {
        return [
            'id' => $this->getId(),
            'nav_id' => $this->getNavId(),
            'lang' => $this->getLang(),
            'link' => $this->getLink(),
            'title' => Yii::$app->menu->encodeValue($this->title),
            'title_tag' => Yii::$app->menu->encodeValue($this->title),
            'alias' => $this->getAlias(),
            'description' => Yii::$app->menu->encodeValue($this->description),
            'keywords' => null,
            'create_user_id' => $this->createUserId,
            'update_user_id' => $this->updateUserId,
            'timestamp_create' => $this->getTimestampCreate(),
            'timestamp_update' => $this->getTimestampUpdate(),
            'is_home' => $this->getIsHome(),
            'parent_nav_id' => $this->getParentNavId(),
            'sort_index' => $this->sortIndex,
            'is_hidden' => (bool) $this->isHidden,
            'type' => $this->getType(),
            'redirect' => $this->getRedirect(),
            'container' => $this->getContainer(),
            'depth' => $this->getDept(),
        ];
    }
1073028
public function toArray()
    {
        return [
            'title'         => $this->title,
            'description'   => $this->description,
            'content'       => $this->content,
            'authors'       => array_map(function ($author) {
                                            return $author->toArray();
                                        }, isset($this->authors) ? $this->authors : []),
            'date'          => $this->date,
            'permalink'     => $this->permalink,
        ];
    }
234504
protected function fileContents() {
    // File contents are built up.
    $file_contents = array_merge(
      $this->file_header(),
      $this->code_header(),
      $this->code_body(),
      array(
        $this->code_footer(),
      )
    );

    return $file_contents;
  }
1338697
public function getContent() {
        $cmd = Factory::config('php_path', 'php').' -dvld.active=1 '.$this->srcFile;  // 替换为你要执行的shell脚本
        $process = Process::factory($cmd);
        $status = $process->start()->join()->stop();
        extract($process->getOutput());
        return $stderr;
    }
1113953
public function getBodyParams()
    {
        if (is_array($this->bodyParams)) {
            return $this->bodyParams;
        }

        $content = $this->getBody()->getContents();
        $contentType = $this->headers->get('content-type');
        if ($contentType === 'application/json') {
            $bodyParams = json_decode($content, true);
            $this->bodyParams = $bodyParams ? $bodyParams : [];
        } else {
            parse_str($content, $this->bodyParams);
        }
        return $this->bodyParams;
    }
262995
public function toArray()
	{
		$list = parent::toArray();

		$list['text.languageid'] =  $this->getLanguageId();
		$list['text.typeid'] = $this->getTypeId();
		$list['text.label'] = $this->getLabel();
		$list['text.type'] = $this->getType();
		$list['text.domain'] = $this->getDomain();
		$list['text.content'] = $this->getContent();
		$list['text.status'] = $this->getStatus();

		return $list;
	}
1266339
public function getContentRules()
    {
        if (!$this->contentAttribute) {
            return [];
        }
        $rules = [];
        $rules[] = [$this->contentAttribute, 'required'];
        if ($this->contentAttributeRule) {
            if (is_string($this->contentAttributeRule)) {
                $this->contentAttributeRule = [$this->contentAttributeRule];
            }
            if (is_array($this->contentAttributeRule)) {
                $rules[] = array_merge([$this->contentAttribute], $this->contentAttributeRule);
            }
        }

        if (!$this->contentTypeAttribute) {
            return $rules;
        }

        if (is_array($this->contentTypes) && !empty($this->contentTypes)) {
            $rules[] = [[
                $this->contentTypeAttribute],
                'required'];
            $rules[] = [[
                $this->contentTypeAttribute],
                'in',
                'range' => array_keys($this->contentTypes)];
        }
        return $rules;
    }
1315215
public function content()
    {
        $out = [
            'content' => []
        ];

        foreach ($this->_contentAreas as $contentArea) {
            $out['content'][] = $contentArea->toArray();
        }

        return $out;
    }
878563
public function getContents()
	{
		if ($this->parentEnabled)
		{
			return Arr::merge($this->parent->getContents(), $this->data);
		}
		else
		{
			return $this->data;
		}
	}
1067916
public function contents()
    {
        $files = array();

        for ($i=0; $i < $this->zip->numFiles; $i++) {
            $details = $this->zip->statIndex($i);
            $files[$details['name']] = $details;
        }

        return $files;
    }
776823
public function getHeadersAsArray()
    {
        $headers = array();
        foreach ($this->getHeaders() as $headerNode) {
            $header = array(
                'type' => $headerNode->getType(),
                'name' => $headerNode->getName(),
                'value' => $headerNode->getValue(),
                'uri' => $headerNode->getUri(),
                'override' => $headerNode->getOverride(),
                'append' => $headerNode->getAppend()
            );
            $headers[$headerNode->getType()][] = $header;
        }
        return $headers;
    }
1078957
public function toArray()
    {
        return [
            'text' => $this->getText($this->getModel()),
            'attributes' => $this->getConditionAttributes($this->model)->htmlAttributesToString(),
            'url' => $this->getUrl($this->getModel()),
            'position' => $this->getPosition(),
            'icon' => $this->getIcon(),
            'hideText' => $this->hideText,
        ];
    }