Modules
OAuth_Consumer
extends Kohana_OAuth_Consumer
OAuth Consumer
Class declared in MODPATH/oauth/classes/oauth/consumer.php on line 3.
Properties
protected
string$callbackcallback URL for OAuth authorization completion
protected
string$keyconsumer key
protected
string$secretconsumer secret
Methods
public __construct( [ array $options = NULL ] ) (defined in Kohana_OAuth_Consumer)
Sets the consumer key and secret.
Parameters
-
array$options = NULL - Consumer options, key and secret are required
Return Values
void
Source Code
public function __construct(array $options = NULL)
{
if ( ! isset($options['key']))
{
throw new Kohana_OAuth_Exception('Required option not passed: :option',
array(':option' => 'key'));
}
if ( ! isset($options['secret']))
{
throw new Kohana_OAuth_Exception('Required option not passed: :option',
array(':option' => 'secret'));
}
$this->key = $options['key'];
$this->secret = $options['secret'];
if (isset($options['callback']))
{
$this->callback = $options['callback'];
}
}
public __get( string $key ) (defined in Kohana_OAuth_Consumer)
Return the value of any protected class variable.
// Get the consumer key
$key = $consumer->key;
Parameters
-
string$key required - Variable name
Return Values
mixed
Source Code
public function __get($key)
{
return $this->$key;
}
public callback( string $callback ) (defined in Kohana_OAuth_Consumer)
Change the consumer callback.
Parameters
-
string$callback required - New consumer callback
Return Values
$this
Source Code
public function callback($callback)
{
$this->callback = $callback;
return $this;
}
public static factory( [ array $options = NULL ] ) (defined in Kohana_OAuth_Consumer)
Create a new consumer object.
$consumer = OAuth_Consumer::factory($options);
Parameters
-
array$options = NULL - Consumer options, key and secret are required
Return Values
OAuth_Consumer
Source Code
public static function factory(array $options = NULL)
{
return new OAuth_Consumer($options);
}