nojimage / cakephp-twim
CakePHP Twitter 插件
v2.1.7
2014-11-07 12:35 UTC
Requires
- php: >=5.3.0
- composer/installers: *
- nojimage/twitter-text-php: >=1.1.0
This package is auto-updated.
Last update: 2024-08-29 03:41:45 UTC
README
此插件提供 Twitter API 的 DataSource 和 Models。
此外,还提供 Auth、Helper 和 Behaviors 的 Controller/Component。
适用于 CakePHP 2.x 和 PHP 5.3 及以上版本
要求
此插件需要 CakePHP-ReST-DataSource-Plugin(用于 CakePHP 2.x)。
在安装此插件之前,您应该安装 ReST DataSource 插件。
安装
获取插件(git 子模块)
git submodule add https://github.com/nojimage/CakePHP-Twim.git app/Plugin/Twim
并将其移动到插件目录,安装 twitter-text-php。
cd app/Plugin/Twim
git submodule update --init
设置 APP/Config/bootstrap.php
CakePlugin::load('Twim', array('bootstrap' => true));
设置 APP/Config/database.php
/**
* TwitterSource using OAuth
*
* @var array
*/
public $twitter = array(
'datasource' => 'Twim.TwimSource',
'oauth_consumer_key' => 'YOUR_CONSUMER_KEY',
'oauth_consumer_secret' => 'YOUR_CONSUMER_SECRET',
'oauth_token' => 'YOUR_ACCESS_TOKEN', // optional
'oauth_token_secret' => 'YOUR_ACCESS_TOKEN_SECRET', // optional
'oauth_callback' => 'PATH_TO_OAUTH_CALLBACK_URL',
);
使用方法
并请参阅测试用例;)
许可协议
MIT 许可协议
版权所有 (c) 2013 nojimage, http://php-tips.com
特此授予任何获得本软件及其相关文档副本(以下简称“软件”)的人,免费使用软件的权利,包括但不限于使用、复制、修改、合并、发布、分发、再许可和/或出售软件副本,并允许软件提供者有权进行上述操作,前提是遵守以下条件
上述版权声明和本许可声明应包含在软件的所有副本或主要部分中。
本软件按“原样”提供,不提供任何明示或暗示的保证,包括但不限于适销性、特定用途的适用性和非侵权性。在任何情况下,作者或版权所有者均不对任何索赔、损害或其他责任负责,无论这些索赔、损害或其他责任是由于合同、侵权或其他原因引起的,无论是否与软件或软件的使用或其他操作有关。