maillotf / pcvue-bridge-bundle
该包最新版本(1.0)没有可用的许可证信息。
Symfony 的 PcVue 包
1.0
2020-10-07 15:26 UTC
Requires
- php: ^7.1
- guzzlehttp/guzzle: ^6.3
- kamermans/guzzle-oauth2-subscriber: ^1.0
- 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-23 19:14:44 UTC
README
基于 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 中找到答案