maillotf/papercut-bridge-bundle

该包的最新版本(1.0.1)没有提供许可证信息。

Papercut 的 Symfony 扩展包

安装: 22

依赖项: 0

建议者: 0

安全: 0

星标: 0

关注者: 2

分支: 0

开放问题: 0

类型:symfony-bundle

1.0.1 2020-09-30 16:24 UTC

This package is auto-updated.

Last update: 2024-09-08 20:44:04 UTC


README

Software license Latest stable Packagist PHP Version Support

基于令牌认证的 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()));
	}

}