openpp/oauth-server-bundle 问题修复 & 功能扩展

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

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

openpp/oauth-server-bundle

最新稳定版本:0.1.6

Composer 安装命令:

composer require openpp/oauth-server-bundle

包简介

Symfony OpenppOAuthServerBundle

README 文档

README

Installation

  1. Download OpenppOAuthServerBundle using composer
  2. Enable the Bundles
  3. Configure Dependency Bundles
  4. Configure OpenppOAuthServerBundle
  5. Extending OpenppOAuthServerBundle

Step 1: Download OpenppOAuthServerBundle using composer

Require the bundle with composer:

$ composer require openpp/oauth-server-bundle "0.1.*"

Composer will install the bundle to your project's vendor/openpp/oauth-server-bundle directory.

$ composer require sonata-project/doctrine-orm-admin-bundle "2.3.*"

Composer will install the bundle to your project's vendor/sonata-project/doctrine-orm-admin-bundle directory.

Step 2: Enable the bundles

Enable the bundle in the kernel::

// app/AppKernel.php
class AppKernel {
    public function registerBundles()
    {
        $bundles = array(
            // ...
            new Symfony\Bundle\SecurityBundle\SecurityBundle(),

            new Knp\Bundle\MenuBundle\KnpMenuBundle(),

            new Sonata\CoreBundle\SonataCoreBundle(),
            new Sonata\BlockBundle\SonataBlockBundle(),

            new Sonata\DoctrineORMAdminBundle\SonataDoctrineORMAdminBundle(),
            new Sonata\AdminBundle\SonataAdminBundle(),

            new Sonata\EasyExtendsBundle\SonataEasyExtendsBundle(),

            new FOS\UserBundle\FOSUserBundle(),
            new Sonata\UserBundle\SonataUserBundle('FOSUserBundle'),

            new FOS\RestBundle\FOSRestBundle(),
            new JMS\SerializerBundle\JMSSerializerBundle(),

            new FOS\OAuthServerBundle\FOSOAuthServerBundle(),
            new Openpp\OAuthServerBundle\OpenppOAuthServerBundle(),
            // ...
        );
    }

Step 3. Configure Dependency Bundles

Configure the SonataCoreBundle

https://sonata-project.org/bundles/core/master/doc/reference/installation.html

Configure the SonataBlockBundle

https://sonata-project.org/bundles/block/master/doc/reference/installation.html

Configure the SonataAdminBundle with SonataDoctrineORMAdminBundle

https://sonata-project.org/bundles/doctrine-orm-admin/2-2/doc/reference/installation.html

https://sonata-project.org/bundles/admin/master/doc/getting_started/installation.html

Configure the SonataEasyExtendsBundle

https://sonata-project.org/bundles/easy-extends/master/doc/reference/installation.html

Configure the SonataUserBundle with FOSUserBundle

http://symfony.com/doc/current/bundles/FOSUserBundle/index.html

https://sonata-project.org/bundles/user/2-2/doc/reference/installation.html

// in AppKernel::registerBundles()
$bundles = array(
    // ...
    new JMS\SerializerBundle\JMSSerializerBundle(),
    // ...
);

Configure the FOSRestServerBundle with JMSSerializerBundle

http://symfony.com/doc/master/bundles/FOSRestBundle/1-setting_up_the_bundle.html

http://jmsyst.com/bundles/JMSSerializerBundle

Configure the FOSOAuthServerBundle

https://github.com/FriendsOfSymfony/FOSOAuthServerBundle/blob/master/Resources/doc/index.md

Step 4. Configure OpenppOAuthServerBundle

# app/config/config.yml
openpp_oauth_server:
    client_class:        Application\Openpp\OAuthServerBundle\Entity\Client
    access_token_class:  Application\Openpp\OAuthServerBundle\Entity\AccessToken
    refresh_token_class: Application\Openpp\OAuthServerBundle\Entity\RefreshToken
    auth_code_class:     Application\Openpp\OAuthServerBundle\Entity\AuthCode

sonata_admin:
    dashboard:
        groups:
            application_openpp_oauth_server.admin.client:
                label:           OAuth
                icon:            '<i class="fa fa-cogs"></i>'
                items:
                    - application_openpp_oauth_server.admin.client
# app/config/routing.yml
fos_oauth_server_security:
    resource: "@OpenppOAuthServerBundle/Resources/config/routing/security.xml"
    prefix:   /

openpp_api_oauth_user:
    resource: "@OpenppOAuthServerBundle/Resources/config/routing/api/user.xml"
    prefix:   /user
    type:     rest

openpp_api_oauth_verify:
    resource: "@OpenppOAuthServerBundle/Resources/config/routing/api/verify.xml"
    prefix:   /verify
    type:     rest

Step 5. Extendig OpenppOAuthServerBundle

$ php app/console sonata:easy-extends:generate OpenppOAuthServerBundle -d src

Enable the bundle in the kernel::

// app/AppKernel.php
class AppKernel {
    public function registerBundles()
    {
        $bundles = array(
            // ...
            new Application\Openpp\OAuthServerBundle\ApplicationOpenppOAuthServerBundle(),
            // ...
        );
    }

openpp/oauth-server-bundle 适用场景与选型建议

openpp/oauth-server-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 211 次下载、GitHub Stars 达 0, 最近一次更新时间为 2015 年 10 月 29 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「oauth」 「oauth2」 「server」 「openpp」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 openpp/oauth-server-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 openpp/oauth-server-bundle 我们能提供哪些服务?
定制开发 / 二次开发

基于 openpp/oauth-server-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 5
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-10-29