dindigital/social-auth 问题修复 & 功能扩展

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

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

dindigital/social-auth

Composer 安装命令:

composer require dindigital/social-auth

包简介

README 文档

README

Install

Using composer:

{
  "minimum-stability": "dev",
  "prefer-stable": true,
  "require": {
    "dindigital/social_auth": "dev-master"
  }
}

Google

Auth Example

require 'vendor/autoload.php';

use Din\SocialAuth\Google\Auth;
use Din\SocialAuth\Google\Scope;
use Din\SocialAuth\Google\Exception\Auth_Exception;

/**
 * Configurações
 */
$id = '';
$secret = '';
$devkey = '';
$token = null;
$redirect_url = '';

/**
 * Modelo Implementação
 */
$googleAuth = new Auth;
$googleAuth->setClientId($id);
$googleAuth->setClientSecret($secret);
$googleAuth->setDeveloperKey($devkey);
$googleAuth->setRedirectUri($redirect_url);

// Define qual permissão o Google fornecerá
$scope = new Scope;
$scope->setYouTube();
$scope->setAnalytcs();

$googleAuth->setScope($scope);

try {

	if (isset($_GET['code'])) {
		$googleAuth->authCode($_GET['code']);
		// Persistir o token: $googleAuth->getToken()
		header("Location: {$redirect_url}");
	}
	
	$googleAuth->setToken($token);

} catch (Exception $e) {
	$url = $googleAuth->getAuthUrl();
	echo '<h1>'.$e->getMessage().'</h1>';
	echo '<a href="'.$url.'">Login</a>';
	exit;
}

if ($googleAuth->hasUpdated()) {
	// Persistir o token: $googleAuth->getToken()
}

YouTube

Insert Video

$youtube = new Din\SocialAuth\Google\Services\YouTube($googleAuth);
$youtube->setTitle('Teste YouTube');
$youtube->setDescription('Teste da descrução');
$youtube->setTags(array('tag1', 'tag2'));
$youtube->setPrivacy('private');

$file = $_SERVER['DOCUMENT_ROOT'] . '/test.mp4';

$id_youtube = $youtube->insert($file);
echo $id_youtube;

Delete Video

Analytics

URL search views by date range

$ga = new Din\SocialAuth\Google\Services\Analytics($googleAuth);
$ga->setProperty('XXXXXXX');
$ga->setStartDate('2014-12-01');
$ga->setEndDate(date('Y-m-d'));
$ga->setUri('/xxxxx/xxxxxxxxx/');
echo $ga->getVisits();

Facebook

Twitter

Instagram

ISSUU

Linkedin

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2014-12-24