PHP Class Folks_Driver_sql, horde

Required values for $params:
     'phptype'       The database type (e.g. 'pgsql', 'mysql', etc.).
     'table'         The name of the foo table in 'database'.
     'charset'       The database's internal charset.
Required by some database implementations:
     'database'      The name of the database.
     'hostspec'      The hostname of the database server.
     'protocol'      The communication protocol ('tcp', 'unix', etc.).
     'username'      The username with which to connect to the database.
     'password'      The password associated with 'username'.
     'options'       Additional options to pass to the database.
     'tty'           The TTY on which to connect to the database.
     'port'          The port on which to connect to the database.
The table structure can be created by the scripts/sql/folks_foo.sql script. Copyright 2008-2016 Horde LLC (http://www.horde.org/) See the enclosed file COPYING for license information (GPL). If you did not receive this file, see http://www.horde.org/licenses/gpl.
Author: Duck ([email protected])
Inheritance: extends Folks_Driver
Afficher le fichier Open project: horde/horde

Méthodes publiques

Méthode Description
__construct ( array $params = [] ) Constructs a new SQL storage object.
addUser ( $user, array $credentials ) : boolean Adds a set of authentication credentials.
countUsers ( $criteria = [] ) Count users by attributes
deleteOnlineUser ( $user ) Remove user if is online
getUsers ( $criteria = [], $from, $count ) Get users by attributes
getViews ( ) Get user groups
updateComments ( string $user, $reset = false ) Update user comments count
userExists ( string $user ) : boolean Check if user exist

Méthodes protégées

Méthode Description
_deleteActivity ( string $scope, integer $date, string $user ) : true Delete users activity
_deleteImage ( string $user ) Delete user image
_deleteOnlineStatus ( $to ) Delete users online
_deleteSavedSearch ( string $name ) Delete saved search
_deleteUser ( string $user ) : boolean Delete user
_getActivity ( string $user, $limit ) : array Get user's activity
_getCryptedPassword ( string $user ) : string Formats a password using the current encryption.
_getOnlineUsers ( ) Get usersnames online
_getProfile ( string $user ) Get user profile
_getRandomUsers ( integer $limit = 10, boolean $online = false ) : array Get random users
_getRecentVisitors ( integer $limit = 10 ) : array Get last visitors
_getSavedSearch ( ) : array Get saved search
_getSearchCriteria ( string $name ) : array Get saved search criteria
_logActivity ( string $message, string $scope, string $user ) : true Log users actions
_logView ( $id ) Log user view
_saveProfile ( array $data, string $user ) Save basic user profile
_saveSearch ( string $criteria, string $name ) Save search criteria
_updateOnlineStatus ( ) Get usersnames online

Private Methods

Méthode Description
_buildWhere ( $criteria = [] ) : array Build attributes query
_connect ( ) : boolean Attempts to open a persistent connection to the SQL server.

Method Details

__construct() public méthode

Constructs a new SQL storage object.
public __construct ( array $params = [] )
$params array A hash containing connection parameters.

_deleteActivity() protected méthode

Delete users activity
protected _deleteActivity ( string $scope, integer $date, string $user ) : true
$scope string Scope
$date integer Date
$user string Username
Résultat true on success

_deleteImage() protected méthode

Delete user image
protected _deleteImage ( string $user )
$user string Username

_deleteOnlineStatus() protected méthode

Delete users online
protected _deleteOnlineStatus ( $to )

_deleteSavedSearch() protected méthode

Delete saved search
protected _deleteSavedSearch ( string $name )
$name string Username

_deleteUser() protected méthode

Delete user
protected _deleteUser ( string $user ) : boolean
$user string Username
Résultat boolean

_getActivity() protected méthode

Get user's activity
protected _getActivity ( string $user, $limit ) : array
$user string Username
Résultat array Activity log

_getCryptedPassword() protected méthode

Formats a password using the current encryption.
protected _getCryptedPassword ( string $user ) : string
$user string User we are getting password for
Résultat string The encrypted password.

_getOnlineUsers() protected méthode

Get usersnames online
protected _getOnlineUsers ( )

_getProfile() protected méthode

Get user profile
protected _getProfile ( string $user )
$user string Username

_getRandomUsers() protected méthode

Get random users
protected _getRandomUsers ( integer $limit = 10, boolean $online = false ) : array
$limit integer Username to check
$online boolean User is online?
Résultat array users

_getRecentVisitors() protected méthode

Get last visitors
protected _getRecentVisitors ( integer $limit = 10 ) : array
$limit integer Username to check
Résultat array users

_getSavedSearch() protected méthode

Get saved search
protected _getSavedSearch ( ) : array
Résultat array saved searches

_getSearchCriteria() protected méthode

Get saved search criteria
protected _getSearchCriteria ( string $name ) : array
$name string Username
Résultat array search criteria

_logActivity() protected méthode

Log users actions
protected _logActivity ( string $message, string $scope, string $user ) : true
$message string Log message
$scope string Scope
$user string Username
Résultat true on success

_logView() protected méthode

Log user view
protected _logView ( $id )

_saveProfile() protected méthode

Save basic user profile
protected _saveProfile ( array $data, string $user )
$data array A hash containing profile data
$user string Username

_saveSearch() protected méthode

Save search criteria
protected _saveSearch ( string $criteria, string $name )
$criteria string Search criteria
$name string Search name

_updateOnlineStatus() protected méthode

Get usersnames online
protected _updateOnlineStatus ( )

addUser() public méthode

Adds a set of authentication credentials.
public addUser ( $user, array $credentials ) : boolean
$credentials array The credentials to use.
Résultat boolean true|PEAR_Error

countUsers() public méthode

Count users by attributes
public countUsers ( $criteria = [] )

deleteOnlineUser() public méthode

Remove user if is online
public deleteOnlineUser ( $user )

getUsers() public méthode

Get users by attributes
public getUsers ( $criteria = [], $from, $count )

getViews() public méthode

Get user groups
public getViews ( )

updateComments() public méthode

Update user comments count
public updateComments ( string $user, $reset = false )
$user string Username

userExists() public méthode

Check if user exist
public userExists ( string $user ) : boolean
$user string Username
Résultat boolean