/ucenter-client

zf2 ucenter client

Primary LanguagePHPGNU General Public License v2.0GPL-2.0

UcenterClient

Introduction

UcenterClient is a ucenter client for zf2.

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

Installation

download this project it into ./vendor/ or ./modules/

Post installation

  1. Enabling it in your application.config.phpfile.

    <?php
    return array(
        'modules' => array(
            'UcenterClient',
        ),
        // ...
    );
  2. Copy the config/ucenter.global.php.dist file into your ./config/autoload directory. (Remove the .distpart) and configure it

  3. use

    // ...
    $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. Any problem email to runphp@qq.com