maillotf / papercut-bridge-bundle
该包的最新版本(1.0.1)没有提供许可证信息。
Papercut 的 Symfony 扩展包
1.0.1
2020-09-30 16:24 UTC
Requires
- php: ^7.1
- phpxmlrpc/phpxmlrpc: ^4.3
- symfony/config: ^3.2|^4.0|^4.1|^5.1
- symfony/dependency-injection: ^3.2|^4.0|^4.1|^5.1
- symfony/http-kernel: ^3.2|^4.0|^4.1|^5.1
Requires (Dev)
- phpunit/phpunit: ^6.5
This package is auto-updated.
Last update: 2024-09-08 20:44:04 UTC
README
基于令牌认证的 Papercut XML-RPC 客户端的 Symfony 扩展包
所需配置
修改 framework.yaml
papercut: authentication: protocol: "http" host: "127.0.0.1" port: "80" path: "/rpc/api/xmlrpc" token: "TOKEN"
papercut: authentication: path: "http://URL/rpc/api/xmlrpc" token: "TOKEN"
修改 services.yaml
services: MaillotF\Papercut\PapercutBridgeBundle\Service\PapercutService: '@papercut.service'
## 使用 composer 安装包
$ composer require maillotf/papercut-bridge-bundle
在控制器中使用
<?php //... use MaillotF\Papercut\PapercutBridgeBundle\Service\PapercutService; class exampleController extends AbstractController { /** * Example * * @Route("example", name="example", methods={"GET"}) * */ public function test(PapercutService $ps) { $user = $ps->user->getUser('4665'); return ($this->json($user->getEmail())); } }