PHP Класс 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.
Автор: Duck ([email protected])
Наследование: extends Folks_Driver
Показать файл Открыть проект

Открытые методы

Метод Описание
__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

Защищенные методы

Метод Описание
_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

Приватные методы

Метод Описание
_buildWhere ( $criteria = [] ) : array Build attributes query
_connect ( ) : boolean Attempts to open a persistent connection to the SQL server.

Описание методов

__construct() публичный Метод

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

_deleteActivity() защищенный Метод

Delete users activity
protected _deleteActivity ( string $scope, integer $date, string $user ) : true
$scope string Scope
$date integer Date
$user string Username
Результат true on success

_deleteImage() защищенный Метод

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

_deleteOnlineStatus() защищенный Метод

Delete users online
protected _deleteOnlineStatus ( $to )

_deleteSavedSearch() защищенный Метод

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

_deleteUser() защищенный Метод

Delete user
protected _deleteUser ( string $user ) : boolean
$user string Username
Результат boolean

_getActivity() защищенный Метод

Get user's activity
protected _getActivity ( string $user, $limit ) : array
$user string Username
Результат array Activity log

_getCryptedPassword() защищенный Метод

Formats a password using the current encryption.
protected _getCryptedPassword ( string $user ) : string
$user string User we are getting password for
Результат string The encrypted password.

_getOnlineUsers() защищенный Метод

Get usersnames online
protected _getOnlineUsers ( )

_getProfile() защищенный Метод

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

_getRandomUsers() защищенный Метод

Get random users
protected _getRandomUsers ( integer $limit = 10, boolean $online = false ) : array
$limit integer Username to check
$online boolean User is online?
Результат array users

_getRecentVisitors() защищенный Метод

Get last visitors
protected _getRecentVisitors ( integer $limit = 10 ) : array
$limit integer Username to check
Результат array users

_getSavedSearch() защищенный Метод

Get saved search
protected _getSavedSearch ( ) : array
Результат array saved searches

_getSearchCriteria() защищенный Метод

Get saved search criteria
protected _getSearchCriteria ( string $name ) : array
$name string Username
Результат array search criteria

_logActivity() защищенный Метод

Log users actions
protected _logActivity ( string $message, string $scope, string $user ) : true
$message string Log message
$scope string Scope
$user string Username
Результат true on success

_logView() защищенный Метод

Log user view
protected _logView ( $id )

_saveProfile() защищенный Метод

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

_saveSearch() защищенный Метод

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

_updateOnlineStatus() защищенный Метод

Get usersnames online
protected _updateOnlineStatus ( )

addUser() публичный Метод

Adds a set of authentication credentials.
public addUser ( $user, array $credentials ) : boolean
$credentials array The credentials to use.
Результат boolean true|PEAR_Error

countUsers() публичный Метод

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

deleteOnlineUser() публичный Метод

Remove user if is online
public deleteOnlineUser ( $user )

getUsers() публичный Метод

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

getViews() публичный Метод

Get user groups
public getViews ( )

updateComments() публичный Метод

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

userExists() публичный Метод

Check if user exist
public userExists ( string $user ) : boolean
$user string Username
Результат boolean