maillotf/pcvue-bridge-bundle

该包最新版本(1.0)没有可用的许可证信息。

Symfony 的 PcVue 包

安装: 5

依赖: 0

建议者: 0

安全: 0

星标: 0

关注者: 2

分支: 1

开放问题: 0

类型:symfony-bundle

1.0 2020-10-07 15:26 UTC

This package is auto-updated.

Last update: 2024-09-23 19:14:44 UTC


README

Software license Latest stable Packagist PHP Version Support

基于 OAuth2 认证的 PcVue 客户端的 Symfony 包

所需配置

修改 framework.yaml

pcvue:
    authentication:
        protocol: "http"
        host: "127.0.0.1"
        port: "80"
        client_id: "CLIENT_ID"
        client_secret: "CLIENT_SECRET"
        username: "USERNAME"
        password: "PASSWORD"
#        root_dir: "ROOT_DIR"

root_dir 是可选的

修改 services.yaml

services:
    MaillotF\Pcvue\PcvueBridgeBundle\Service\PcvueService: '@pcvue.service.main'

使用 composer 安装包

$ composer require maillotf/pcvue-bridge-bundle

在控制器中使用

<?php
//...
use MaillotF\Pcvue\PcvueBridgeBundle\Service\PcvueService;

class exampleController extends AbstractController
{
	/**
	 * Example
	 * 
	 * @Route("example", name="example", methods={"GET"})
	 * 
	 */
	public function test(PcvueService $ps)
	{
		$user = $ps->user->getUser('4665');
		
		return ($this->json($user->getEmail()));
	}

}

常见问题解答

您可以在 FAQ 中找到答案