From cd0dd3d9b69fd0345f320c7c69b957df3968ecc0 Mon Sep 17 00:00:00 2001 From: Gwynne Raskind Date: Mon, 8 Dec 2008 06:26:25 +0000 Subject: [PATCH] more lifecycle docs git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@270794 c90b9560-bf6c-de11-be94-00142212c4b1 --- internals2/structure/lifecycle.xml | 132 ++++++++++++++++++++++++++++- 1 file changed, 131 insertions(+), 1 deletion(-) diff --git a/internals2/structure/lifecycle.xml b/internals2/structure/lifecycle.xml index 8ecdc19c0c..a6df02d605 100644 --- a/internals2/structure/lifecycle.xml +++ b/internals2/structure/lifecycle.xml @@ -1,5 +1,5 @@ - + Life cycle of an extension @@ -65,6 +65,136 @@ + + What to do, and when to do it + + + There are many tasks that might be performed at any of these four points. + This table details where many common initialization and termination tasks + belong. + + + + What to do, and when to do it + + + + Module initialization/termination + Request initialization/termination + + + + + Allocate/deallocate and initialize module global variables + + Allocate/deallocate and initialize request-specific variables + + + + Register/unregister class entries + + + + Register/unregister INI entries + + + + Register constants + + + + +
+ +
+ + + The <function>phpinfo</function> callback + + + Aside from globals initialization and certain rarely-used callbacks, there + is one more part of a module's lifecycle to examine: A call to + phpinfo. The output a user sees from this call, whether + text or HTML or anything else, is generated by each individual extension + that is loaded into the PHP interpreter at the time the call is made. + + + + To provide for format-neutral output, the header + "ext/standard/info.h" provides an array of functions to produce + standardized display elements. Specifically, several functions which create + the familiar tables exist: + + + + + php_info_print_table_start + + + Open a table in phpinfo output. Takes no parameters. + + + + + php_info_print_table_header + + + Print a table header in phpinfo output. Takes one + parameter, the number of columns, plus the same number of + char * parameters which are the texts for each column + heading. + + + + + php_info_print_table_row + + + Print a table row in phpinfo output. Takes one + parameter, the number of columns, plus the same number of + char * parameters which are the texts for each column + content. + + + + + php_info_print_table_end + + + Close a table formerly opened by + php_info_print_table_start. Takes no parameters. + + + + + + + Using these four functions, it is possible to produce status information for + nearly any conbimation of features in an extension. Here is the information + callback from the counter extension: + + + + counter's PHP_MINFO function + + + + + +