ogogo/social-auth
Composer 安装命令:
composer require ogogo/social-auth
包简介
Uses the HybridAuth PHP library to Enable authentication via Google, Facebook, Twitter, Yahoo!, etc for the ZfcUser ZF2 module.
关键字:
README 文档
README
Uses the HybridAuth PHP library to Enable authentication via Google, Facebook, Twitter, Yahoo!, etc for the ZfcUser ZF2 module.
Requirements
- Zend Framework 2 (latest master)
- ZfcBase (latest master)
- ZfcUser (latest master)
- HybridAuth (latest master)
- Extension php_curl enabled in php.ini
Features
- Login with AOL [NO LONGER SUPPORTED]
- Login with Facebook [COMPLETE]
- Login with Foursquare [COMPLETE]
- Login with Github [COMPLETE]
- Login with Google [COMPLETE]
- Login with LinkedIn [COMPLETE]
- Login with Live [INCOMPLETE]
- Login with MySpace [INCOMPLETE]
- Login with OpenID [INCOMPLETE]
- Login with Twitter [COMPLETE]
- Login with Yahoo! [COMPLETE]
- Login with Tumblr [COMPLETE]
- Login with Mail.Ru [COMPLETE]
- Login with Odnoklassniki [COMPLETE]
- Login with VKontakte [COMPLETE]
- Login with Yandex [COMPLETE]
- Login with Instagram [COMPLETE]
Installation
It is recommended to add this module to your Zend Framework 2 application using Composer. After cloning ZendSkeletonApplication, change the composer minimum-stability setting to "dev" and add "ogogo/social-auth" to list of requirements, then run php composer.phar install/update. Your composer.json should look something like this:
{
"name": "zendframework/skeleton-application",
"description": "Skeleton Application for ZF2",
"license": "BSD-3-Clause",
"keywords": [
"framework",
"zf2"
],
"minimum-stability": "dev",
"homepage": "http://framework.zend.com/",
"require": {
"php": ">=5.3.3",
"zendframework/zendframework": "dev-master",
"ogogo/social-auth": "dev-master"
},
"autoload": {
"psr-0": {
"Hybrid": "./vendor/hybridauth/hybridauth/hybridauth/"
},
"classmap": ["./vendor/hybridauth/hybridauth"]
}
}
Next add the required modules to config/application.config.php:
<?php
return array(
'modules' => array(
'Application',
'SocialAuth',
'ZfcBase',
'ZfcUser',
),
'module_listener_options' => array(
'config_glob_paths' => array(
'config/autoload/{,*.}{global,local}.php',
),
'module_paths' => array(
'./module',
'./vendor',
),
),
);
Import the schemas for ZfcUser (./vendor/zf-commons/zfc-user/data/schema.sql) and SocialAuth (./vendor/ogogo/social-auth/data/schema.sql).
If you do not already have a valid Zend\Db\Adapter\Adapter in your service
manager configuration, put the following in ./config/autoload/database.local.php:
<?php
$dbParams = array(
'database' => 'changeme',
'username' => 'changeme',
'password' => 'changeme',
'hostname' => 'changeme',
);
return array(
'service_manager' => array(
'factories' => array(
'Zend\Db\Adapter\Adapter' => function ($sm) use ($dbParams) {
return new Zend\Db\Adapter\Adapter(array(
'driver' => 'pdo',
'dsn' => 'mysql:dbname='.$dbParams['database'].';host='.$dbParams['hostname'],
'database' => $dbParams['database'],
'username' => $dbParams['username'],
'password' => $dbParams['password'],
'hostname' => $dbParams['hostname'],
));
},
),
),
);
If you do not already have a valid Zend\Session\SessionManager in your service
manager configuration, put the following in ./config/autoload/session.local.php:
<?php
return array(
'service_manager' => array(
'invokables' => array(
'Zend\Session\SessionManager' => 'Zend\Session\SessionManager',
),
),
);
Options
Make sure to check the options available in ZfcUser: https://github.com/ZF-Commons/ZfcUser#options
The SocialAuth module has two files that allow you to configure supported providers.
After installing SocialAuth, copy
./vendor/ogogo/social-auth/config/social-auth.global.php.dist to
./config/autoload/social-auth.global.php and change the values as desired.
Also copy
./vendor/ogogo/social-auth/config/social-auth.local.php.dist to
./config/autoload/social-auth.local.php and change the values as desired.
ogogo/social-auth 适用场景与选型建议
ogogo/social-auth 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 34 次下载、GitHub Stars 达 1, 最近一次更新时间为 2015 年 01 月 30 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「zf2」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 ogogo/social-auth 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 ogogo/social-auth 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 ogogo/social-auth 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
LosLog provides some log utility
EdpModuleLayouts is very simple Laminas module for making module-specific layouts insanely easy.
Zend Framework module to leverage the symfony dependency injection container
RCM User HTML views/pages
Builds a Bridge between Zend Expressive and Plugin Managers of Zend\MVC
Error and Exception override and observers.
统计信息
- 总下载量: 34
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 20
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2015-01-30