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 | (optional) |
$use_ip | int | (optional) default = YANA_COUNTER_USE_IP |
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 | |
$info | string | (optional) |
$ammount | int | (optional) default = 1 |
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 |
---|---|---|
$another_object | object |
Returns bool(true) if this object and $another_object 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 | (optional) |
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 | (optional) |
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 | (optional) |
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 Wed, 22 Nov 2006 20:19:03 +0100 by phpDocumentor 1.3.1