helhum/typo3-frontend-request 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

helhum/typo3-frontend-request

最新稳定版本:v1.2.0

Composer 安装命令:

composer require helhum/typo3-frontend-request

包简介

API to execute TYPO3 frontend requests from code or command line

README 文档

README

This package provides an API to get a response from any TYPO3 frontend request in any context, without the need to do an actual HTTP request.

Examples:

Doing a TYPO3 frontend request

$request = new \TYPO3\CMS\Core\Http\ServerRequest($uri);
$client = new \Helhum\Typo3FrontendRequest\Typo3Client();
try {
    $response = $client->send($request);
    $body = (string)$response->getBody();
} catch (\Helhum\Typo3FrontendRequest\RequestFailed $e) {
    throw new \RuntimeException('Could not fetch  page "' . $uri . '", reason: ' . $e->getMessage(), 1552081550, $e);
}

Doing a TYPO3 frontend request with a user being authenticated

$request = new \TYPO3\CMS\Core\Http\ServerRequest($uri)
$request = $request->withHeader(
    'x-typo3-frontend-user',
    (string)$context->getPropertyFromAspect('frontend.user', 'id')
);
$client = new \Helhum\Typo3FrontendRequest\Typo3Client();
$response = $client->send($request);
$body = (string)$response->getBody();

统计信息

  • 总下载量: 1.98k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 15
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 15
  • Watchers: 2
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2020-07-06