PHP Class Container_users

Afficher le fichier Open project: kerphi/phpfreechat Class Usage Examples

Méthodes publiques

Méthode Description
checkUserExists ( $uid )
generateUid ( $uid = null )
getDir ( )
getUserChannels ( $uid, $injson = false )
getUserData ( $uid, $field = null, $injson = false ) Get user's data Can be called to read only one field If $injson is true, data are returned json encoded getUserData('xxxx', 'email'); getUserData('xxxx', null, true);
getUserMsgs ( $uid, $injson = false )
getUsers ( )
joinChannel ( $uid, $cid )
leaveChannel ( $uid, $cid )
rmUser ( $uid ) Remove user's data
runGC ( ) Run the garbage collector (disconnect timeouted users) Has to be called by each users when they check pending messages
setCloseFlag ( $uid ) Update the close flag of a user Called when the user close his window or reload his window
setIsAlive ( $uid ) Update the last activity of a user Has to be called each time the user check his messages
setUserData ( $uid, $userdata ) Set user's data Can be called to update only one field setUserData('xxxx', array('email', '[email protected]'));

Method Details

checkUserExists() public static méthode

public static checkUserExists ( $uid )

generateUid() public static méthode

public static generateUid ( $uid = null )

getDir() public static méthode

public static getDir ( )

getUserChannels() public static méthode

public static getUserChannels ( $uid, $injson = false )

getUserData() public static méthode

Get user's data Can be called to read only one field If $injson is true, data are returned json encoded getUserData('xxxx', 'email'); getUserData('xxxx', null, true);
public static getUserData ( $uid, $field = null, $injson = false )

getUserMsgs() public static méthode

public static getUserMsgs ( $uid, $injson = false )

getUsers() public static méthode

public static getUsers ( )

joinChannel() public static méthode

public static joinChannel ( $uid, $cid )

leaveChannel() public static méthode

public static leaveChannel ( $uid, $cid )

rmUser() public static méthode

Remove user's data
public static rmUser ( $uid )

runGC() public static méthode

Run the garbage collector (disconnect timeouted users) Has to be called by each users when they check pending messages
public static runGC ( )

setCloseFlag() public static méthode

Update the close flag of a user Called when the user close his window or reload his window
public static setCloseFlag ( $uid )

setIsAlive() public static méthode

Update the last activity of a user Has to be called each time the user check his messages
public static setIsAlive ( $uid )

setUserData() public static méthode

Set user's data Can be called to update only one field setUserData('xxxx', array('email', '[email protected]'));
public static setUserData ( $uid, $userdata )