承接 webiny/twitter-oauth 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

webiny/twitter-oauth

Composer 安装命令:

composer require webiny/twitter-oauth

包简介

Webiny Twitter OAuth Component

README 文档

README

This component provides is a wrapper for Twitter OAuth server.

Install the component

The best way to install the component is using Composer.

composer require webiny/twitter-oauth

For additional versions of the package, visit the Packagist page.

Configuring the component

To use the component, you first need to configure it. The configuration is done by defining the following params:

  • ClientId - Twitter client id
  • ClientSecret - Twitter client secret
  • RedirectUri - location where the user will be redirected by the OAuth server, once he is authorized

Example configuration:

    TwitterOAuth:
        MyTwitterApp:
            ClientOd: AJmIXgXfaasdasaULBmnygIiGA
            ClientSecret: JE5dpb0a891ciisasdMOu7ELF9SI0TazR3hDAirft0Y
            RedirectUri: /security/login-tw/
        Bridge: \Webiny\Component\TwitterOAuth\Bridge\TwitterOAuth\TwitterOAuth

Dependency

The library requires abraham/twitteroauth TwitterOAuth component. The will be installed automatically if you install TwitterOAuth Webiny component using composer, however, you will need to include this file somewhere in your application before you can use the component /path/to/abraham/twitteroauth/twitteroauth.php.

Usage

Once you have configured the component, its usage is fairly simple if you have an access token. If you don't have an access token, the best way to get one, is to authenticate the user using the Security component with TwitterOAuth as auth provider.

$tw = TwitterOAuthLoader::getInstance('MyTwitterApp');

$tw->setAccessToken(...);

// get user details for current access token
$user = $tw->getUserDetails(); // returns TwitterOAuthUser object

// perform any other API operation
$tw->get($url, $params);
$tw->post($url, $params);
$tw->delete($url, $params);

Resources

To run unit tests, you need to use the following command:

$ cd path/to/Webiny/Component/TwitterOAuth/
$ composer.phar install
$ phpunit

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-08-30

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固