Class stats
stats
- public class stats
Client site statistics tool.
Constructor Summary |
stats(var $user_agent,
var $session_prefix)
Set session_var name, register user_agent and perform sweep(), if first in session. |
Method Summary |
boolean |
add_unique(var $id,
var $time)
Insert user_agent entry into Stats_user_agent and log basic quantity of
requests from those various user agents. |
unknown |
sweep()
Remove entries with old timestamps. |
boolean |
unique_rating(var $id)
Update Stats_unique rating - article can be rated once per session. |
unknown |
update_user_agent(var $user_agent)
Insert user_agent entry into Stats_user_agent and log basic quantity of
requests from those various user agents. |
stats
public stats(var $user_agent,
var $session_prefix)
- Set session_var name, register user_agent and perform sweep(), if first in session.
add_unique
public boolean add_unique(var $id,
var $time)
- Insert user_agent entry into Stats_user_agent and log basic quantity of
requests from those various user agents.
Returns true if insertion of new unique was ok, false otherwise.
unique_rating
public boolean unique_rating(var $id)
- Update Stats_unique rating - article can be rated once per session.
Returns true if update successful, false otherwise.
update_user_agent
public unknown update_user_agent(var $user_agent)
- Insert user_agent entry into Stats_user_agent and log basic quantity of
requests from those various user agents.
Returns id of newly inserted user_agent or id of already existing one.
- Returns:
- int
sweep
public unknown sweep()
- Remove entries with old timestamps.
Returns number of deleted rows.
- Returns:
- int