YANA 4 PHP Framework
Docs For Class Counter
counter wrapper
This class implements persistent counters - optional with IP checking - for various purposes: e.g. visitor counts, statistics, polls.
Located in /includes/class_counter.php
Object | --Counter
Name | Type | Description |
---|---|---|
$filename | string | name of file to safe values to |
$use_ip | int | count on reload on / off |
Use the $use_ip parameter with the setting YANA_COUNTER_USE_IP to create a counter with IP checking (does'nt change on reload) or with the setting YANA_COUNTER_IGNORE_IP to create a counter without IP checking (always changes when an update is called).
Name | Type | Description |
---|---|---|
$id | string | counter id |
$info | string | optional description to be safed along with the counter |
$ammount | int | number to add to counter |
Adds $ammount (defaults to +1) to the counter $id and sets the counter description (the 'info' field) to $info (defaults to "").
Note: as you might already have guessed, using a negative value for $ammount decrements the counter.
Name | Type | Description |
---|---|---|
$anotherObject | object | any object or var you want to compare |
Returns bool(true) if this object and $anotherObject are equal and bool(false) otherwise.
Two instances are considered equal if and only if they are both objects of the same class, they both refer to the same filesystem resource and use the same IP settings.
Redefinition of: Object::equals()
Name | Type | Description |
---|---|---|
$id | string | counter id |
Returns the current counter settings as:
Array( 'COUNT' => int 'INFO' => string )
Note: you may use the wildcard '*' to get all counters as an associative, multidimensional array:
Array( ID1 => Array( 'COUNT' => int 'INFO' => string ) ID2 => Array( 'COUNT' => int 'INFO' => string ) ... )
Name | Type | Description |
---|---|---|
$id | string | counter id |
This function returns the current value of counter $key.
Note: you may use the wildcard '*' to get an associative array for all values:
Array( ID1 => int ID2 => int ... )
Name | Type | Description |
---|---|---|
$id | string | counter id |
The 'info' field is an optional text value, that describes the counter.
This function returns the current description of counter $key.
Note: you may use the wildcard '*' to get an associative array for all counters:
Array( ID1 => string ID2 => string ... )
Inherited From Object
Documentation generated on Sun, 11 Mar 2007 15:02:25 +0100 by phpDocumentor 1.3.1