From 456e4db2f91ad942755cb8fdaffef38f0e67d655 Mon Sep 17 00:00:00 2001 From: Gwynne Raskind Date: Tue, 29 Apr 2008 11:33:03 +0000 Subject: [PATCH] complete counter extension documentation, change base ID of new internals docs FROM book.internals2 TO internals2 - consistency and proper scoping git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@258732 c90b9560-bf6c-de11-be94-00142212c4b1 --- internals2/counter.xml | 433 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 432 insertions(+), 1 deletion(-) diff --git a/internals2/counter.xml b/internals2/counter.xml index e99973b3b4..f74c218e3d 100644 --- a/internals2/counter.xml +++ b/internals2/counter.xml @@ -1,5 +1,5 @@ - + The "counter" Extension - A Continuing Example @@ -373,6 +373,7 @@ class MyCounter extends Counter } } +Counter::setCounterClass("MyCounter"); if (($counter_one = Counter::getNamed("one")) === NULL) { $counter_one = new Counter("one", 0, COUNTER_FLAG_PERSIST); } @@ -667,8 +668,438 @@ $counter_four->printCounterInfo(); + + + Counter::setCounterClass + + Set the class returned by Counter::getNamed. + + + + &reftitle.description; + + static + voidCounter::setCounterClass + stringname + + + Counter::setCounterClass changes the class of objects + returned by Counter::getNamed. The class being set + must not have a public constructor and must be a subclass of + Counter. If these conditions are not met, a fatal + error is raised. This is a static function. + + + + &reftitle.parameters; + + + name + + + The name of the class to use. + + + + + + + + + The basic interface + Basic + + + + counter_get + + Get the current value of the basic counter. + + + + &reftitle.description; + + integercounter_get + + + + counter_get returns the current value of the basic + interface's counter. + + + + &reftitle.returnvalues; + + counter_get returns an integer. + + + + &reftitle.seealso; + + counter_bump + counter_reset + + + + + + + counter_bump + + Update the current value of the basic counter. + + + + &reftitle.description; + + voidcounter_bump + integeroffset + + + counter_bump updates the current value of the basic + interface's counter. + + + + &reftitle.parameters; + + + offset + + + The amount by which to change the counter's value. Can be negative. + + + + + + + &reftitle.seealso; + + counter_get + counter_reset + + + + + + + counter_reset + + Reset the current value of the basic counter. + + + + &reftitle.description; + + voidcounter_reset + + + + counter_reset resets the current value of the basic + interface's counter to its original initial value. + + + + &reftitle.seealso; + + counter_get + counter_bump + + + + + + + + The extended interface + Extended + + + + counter_create + + Creates a counter which maintains a single numeric value. + + + + &reftitle.description; + + resourcecounter_create + stringname + integerinitial_value + integerflags + + + Creates a counter which maintains a single numeric value. + + + + &reftitle.parameters; + + + name + + + The new counter's name. + + + + + initial_value + + + The initial value of the counter. Defaults to zero (0). + + + + + flags + + + Flags for the new counter, chosen from the + COUNTER_FLAG_* constants. + + + + + + + &reftitle.returnvalues; + + Returns a counter resource. + + + + + + + counter_get_value + + Get the current value of a counter resource. + + + + &reftitle.description; + + integercounter_get_value + resourcecounter + + + counter_get_value returns the current value of a + counter resource. + + + + &reftitle.parameters; + + + counter + + + The counter resource to operate on. + + + + + + + &reftitle.returnvalues; + + counter_get_value returns an integer. + + + + &reftitle.seealso; + + counter_bump_value + counter_reset_value + + + + + + + counter_bump_value + + Change the current value of a counter resource. + + + + &reftitle.description; + + voidcounter_bump_value + resourcecounter + integeroffset + + + counter_bump_value updates the current value of a + counter resource. + + + + &reftitle.parameters; + + + counter + + + The counter resource to operate on. + + + + + offset + + + The amount by which to change the counter's value. Can be negative. + + + + + + + &reftitle.seealso; + + counter_get_value + counter_reset_value + + + + + + + counter_reset_value + + Reset the current value of a counter resource. + + + + &reftitle.description; + + voidcounter_reset_value + resourcecounter + + + counter_reset_value resets the current value of a + counter resource to its original initial value. + + + + &reftitle.parameters; + + + counter + + + The counter resource to operate on. + + + + + + + &reftitle.seealso; + + counter_get_value + counter_bump_value + + + + + + + counter_get_meta + + Return a piece of metainformation about a counter resource. + + + + &reftitle.description; + + mixedcounter_get_meta + resourcecounter + integerattribute + + + counter_get_meta returns metainformation about a + counter resource. + + + + &reftitle.parameters; + + + counter + + + The counter resource to operate on. + + + + + attribute + + + The metainformation to retrieve. + + + + + + + &reftitle.returnvalues; + + counter_get_meta returns values of varying types + based on which metainformation was requested. + + + + + + + counter_get_named + + Retrieve an existing named counter as a resource. + + + + &reftitle.description; + + resourceCounter::getNamed + stringname + + + counter_get_named returns an existing counter by name + if that name exists, or &null; otherwise. + + + + &reftitle.parameters; + + + name + + + The counter name to search for. + + + + + + + &reftitle.returnvalues; + + counter_get_name returns an existing counter by name + if that name exists, or &null; otherwise. + + + + + +