runphp/ucenter-client

dev-master 2014-01-02 01:56 UTC

This package is auto-updated.

Last update: 2024-09-15 15:38:17 UTC


README

简介

UcenterClient 是一个为 zf2 开发的 ucenter 客户端。

[ucenter]http://www.comsenz.com/products/ucenter

安装

将此项目下载到 ./vendor/./modules/

安装后

  1. 在您的 application.config.php 文件中启用它。

    <?php
    return array(
        'modules' => array(
            'UcenterClient',
        ),
        // ...
    );
  2. config/ucenter.global.php.dist 文件复制到您的 ./config/autoload 目录。(移除 .dist 部分)并配置它

  3. 使用

    // ...
    $cookie = $this->getRequest()->getCookie();
    if ($cookie->offsetExists('ucenter_auth')) {
       $param = $cookie->offsetGet('ucenter_auth');
       $uc = $this->getServiceLocator()->get('ucenter_service');
       $user = $uc->getUser($param);
    }
    // ...
  4. 如有任何问题,请发送电子邮件至 runphp@qq.com