Consumer.php

Summary
Consumer.php
ConsumerTable Definition for consumer
ConsumerSuperclass representing an OAuth consumer as it is stored in the database, with associated interfaces.
schemaDefReturns an array representing the schema used to store the consumer in the backend database.
generateNewCreate a new OAuth consumer record.
deleteDelete this OAuth Consumer and related tokens and nonces
_deleteTokensHelper function to delete tokens related to this OAauth consumer.
_deleteNoncesHelper function to delete nonces related to this OAuth consumer.

Consumer

Table Definition for consumer

postActiv

the micro-blogging software

Copyright

Copyright © 2016-2017, Maiyannah Bishop

Derived from code copyright various sources

  • GNU Social © 2013-2016, Free Software Foundation, Inc
  • StatusNet © 2008-2012, StatusNet, Inc

License

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program.  If not, see http://www.gnu.org/licenses/.

https://www.gnu.org/licenses/agpl.html

About

Table Definition for consumer

PHP version

Tested with PHP 7

File Authors

Web

Consumer

Superclass representing an OAuth consumer as it is stored in the database, with associated interfaces.

  • __table = ‘consumer’ - table name
  • consumer_key - varchar(191) primary_key not_null not 255 because utf8mb4 takes more space
  • consumer_secret - varchar(191) not_null not 255 because utf8mb4 takes more space
  • seed - char(32) not_null
  • created - datetime not_null
  • modified - timestamp not_null default_CURRENT_TIMESTAMP
Summary
schemaDefReturns an array representing the schema used to store the consumer in the backend database.
generateNewCreate a new OAuth consumer record.
deleteDelete this OAuth Consumer and related tokens and nonces
_deleteTokensHelper function to delete tokens related to this OAauth consumer.
_deleteNoncesHelper function to delete nonces related to this OAuth consumer.

schemaDef

public static function schemaDef()

Returns an array representing the schema used to store the consumer in the backend database.

generateNew

static function generateNew()

Create a new OAuth consumer record.

Returns

  • created Consumer object

delete

function delete($useWhere = false)

Delete this OAuth Consumer and related tokens and nonces

XXX

  • Should this happen in an OAuthDataStore instead?
  • Is there any reason NOT to do this kind of cleanup?

_deleteTokens

function _deleteTokens()

Helper function to delete tokens related to this OAauth consumer.

_deleteNonces

function _deleteNonces()

Helper function to delete nonces related to this OAuth consumer.

public static function schemaDef()
Returns an array representing the schema used to store the consumer in the backend database.
static function generateNew()
Create a new OAuth consumer record.
function delete($useWhere = false)
Delete this OAuth Consumer and related tokens and nonces
function _deleteTokens()
Helper function to delete tokens related to this OAauth consumer.
function _deleteNonces()
Helper function to delete nonces related to this OAuth consumer.