[PHP-DOC] cvs: phpdoc /kr language-defs.ent
cycle98 Wed Mar 7 20:28:41 2001 EDT Modified files: /phpdoc/kr language-defs.ent Log: new fix Index: phpdoc/kr/language-defs.ent diff -u phpdoc/kr/language-defs.ent:1.3 phpdoc/kr/language-defs.ent:1.4 --- phpdoc/kr/language-defs.ent:1.3 Sun Jan 7 10:48:40 2001 +++ phpdoc/kr/language-defs.ent Wed Mar 7 20:28:41 2001 @@ -1,10 +1,10 @@ - - - - - - - - + + + + + + + +
[PHP-DOC] cvs: phpdoc / global.ent html-common.dsl manual.xml.in /en language-defs.ent /en/pear about.xml pear.xml standards.xml
ssb Wed Mar 7 18:45:54 2001 EDT Added files: /phpdoc/en/pear about.xml standards.xml Modified files: /phpdoc global.ent html-common.dsl manual.xml.in /phpdoc/en language-defs.ent /phpdoc/en/pear pear.xml Log: * more PEAR docs Index: phpdoc/global.ent diff -u phpdoc/global.ent:1.80 phpdoc/global.ent:1.81 --- phpdoc/global.ent:1.80 Wed Mar 7 00:36:01 2001 +++ phpdoc/global.ent Wed Mar 7 18:45:53 2001 @@ -1,6 +1,6 @@ Index: phpdoc/en/pear/standards.xml +++ phpdoc/en/pear/standards.xml PEAR Coding Standards Indenting Use an indent of 4 spaces, with no tabs. If you use Emacs to edit PEAR code, you should set indent-tabs-mode to nil. Here is an example mode hook that will set up Emacs according to these guidelines (you will need to ensure that it is called when you are editing php files): (defun php-mode-hook () (setq tab-width 4 c-basic-offset 4 c-hanging-comment-ender-p nil indent-tabs-mode nil)) Here are vim rules for the same thing: set expandtab set shiftwidth=4 set tabstop=4 Control Structures These include if, for, while, switch, etc. Here is an example if statement, since it is the most complicated of them: if ((condition1) || (condition2)) { action1; } elseif ((condition3) && (condition4)) { action2; } else { defaultaction; } Control statements should have one space between the control keyword and opening parenthesis, to distinguish them from function calls. You are strongly encouraged to always use curly braces even in situations where they are technically optional. Having them increases readability and decreases the likelihood of logic errors being introduced when new lines are added. For switch statements: switch (condition) { case 1: action1; break; case 2: action2; break; default: defaultaction; break; } Function Calls Functions should be called with no spaces between the function name, the opening parenthesis, and the first parameter; spaces between commas and each parameter, and no space between the last parameter, the closing parenthesis, and the semicolon. Here's an example: $var = foo($bar, $baz, $quux); As displayed above, there should be one space on either side of an equals sign used to assign the return value of a function to a variable. In the case of a block of related assignments, more space may be inserted to promote readability: $short = foo($bar); $long_variable = foo($baz); Function Definitions Function declaractions follow the "one true brace" convention: function fooFunction($arg1, $arg2 = '') { if (condition) { statement; } return $val; } Arguments with default values go at the end of the argument list. Always attempt to return a meaningful value from a function if one is appropriate. Here is a slightly longer example: function connect(&$dsn, $persistent = false) { if (is_array($dsn)) { $dsninfo = &$dsn; } else { $dsninfo = DB::parseDSN($dsn); } if (!$dsninfo || !$dsninfo['phptype']) { return $this->raiseError(); } return true; } Comments Inline documentation for classes should follow the PHPDoc convention, similar to Javadoc. More information about PHPDoc can be found here: &url.phpdoc; Non-documentation comments are strongly encouraged. A general rule of thumb is that if you look at a section of code and think "Wow, I don't want to try and describe that", you need to comment it before you forget how it works. C++ style comments (/* */) and standard C comments (// ) are both fine. Use of perl/shell style comments (# ) is discouraged. Including Code Anywhere you are unconditionally including a class file, use require_once. Anywhere you are conditionally including a class file (for example, factory methods), use include_once. Either of these will ensure that class files are included only once. They share the same file list, so you don't need to worry about mixing them - a file included with require_once will not be included again by include_once. include_once and require_once are statements, not functions. You don't need parentheses around the filename to be included. PHP Code Tags Always use to delimit PHP code, not the ?> shorthand. This is required for PEAR compliance and is also the most portable way to include PHP code on differing operating systems and setups. Header Comment Blocks All source code files in the co
[PHP-DOC] cvs: phpdoc /en/functions classobj.xml filesystem.xml funchand.xml var.xml
jmcastagnetto Wed Mar 7 15:15:13 2001 EDT Modified files: /phpdoc/en/functionsfunchand.xml var.xml classobj.xml filesystem.xml Log: documentation for is_null, is_scalar, is_writeable, call_user_func_array and call_user_func_method Index: phpdoc/en/functions/funchand.xml diff -u phpdoc/en/functions/funchand.xml:1.9 phpdoc/en/functions/funchand.xml:1.10 --- phpdoc/en/functions/funchand.xml:1.9Wed Mar 7 04:18:14 2001 +++ phpdoc/en/functions/funchand.xmlWed Mar 7 15:15:13 2001 @@ -8,6 +8,67 @@ with functions. + + + +call_user_func_array + + Call a user function given with an array of parameters + + + +Description + + + mixed + call_user_func_array + + string + function_name + + array + paramarr + + + + + Call a user defined function given by + function_name, with + the paramaters in paramarr. + For example: + + +function debug($var, $val) +echo "***DEBUGGING\nVARIABLE: $var\nVALUE:"; +if (is_array($val) || is_object($val) || is_resource($val)) +print_r($val); +else +echo "\n$val\n"; +echo "***\n"; +} + +$c = mysql_connect(); +$host = $HTTP_SERVER_VARS["SERVER_NAME"]; + +call_user_func_array ('debug', array("host", $host)); +call_user_func_array ('debug', array("c", $c)); +call_user_func_array ('debug', array("HTTP_POST_VARS", $HTTP_POST_VARS)); + + + + + See also: + call_user_func, + call_user_method, + call_user_method_array. + + + + This function was added to the CVS code after release of PHP 4.0.4pl1 + + + + @@ -47,6 +108,12 @@ call_user_func ('barber', "shave"); + + + See also: + call_user_func_array, + call_user_method, + call_user_method_array. Index: phpdoc/en/functions/var.xml diff -u phpdoc/en/functions/var.xml:1.34 phpdoc/en/functions/var.xml:1.35 --- phpdoc/en/functions/var.xml:1.34Wed Mar 7 02:40:02 2001 +++ phpdoc/en/functions/var.xml Wed Mar 7 15:15:13 2001 @@ -483,6 +483,40 @@ + + +is_null + + Finds whether a variable is null + + + +Description + + + bool is_null + mixed var + + + + Returns true if var is null, false otherwise. + + + See also is_bool, + is_double, + is_numeric, + is_float, + is_int, + is_real, + is_string, + is_object, + is_array, and + is_integer. + + + + + is_numeric @@ -609,6 +643,83 @@ + + + +is_scalar + + Finds whether a variable is a scalar + + + +Description + + + bool + is_scalar + + mixed + var + + + + + is_scalar returns true if the variable + given by the var parameter is a scalar, + otherwise it returns false. + + + Scalar variables are those containing an integer, float, string + or boolean. For example: + + +function show_var($var) { +if (is_scalar($var)) +echo $var; +else +var_dump($var); +} + +$pi = 3.1416; +$proteins = array("hemoglobin", "cytochrome c oxidase", "ferredoxin"); + +show_var($pi); +// prints: 3.1416 + +show_var($proteins) +// prints: +// array(3) { +// [0]=> +// string(10) "hemoglobin" +// [1]=> +// string(20) "cytochrome c oxidase" +// [2]=> +// string(10) "ferredoxin" +// } + + + + + + This function was added to the CVS code after the release of PHP + 4.0.4pl1 + + + + See also is_bool, + is_double, + is_numeric, + is_float, + is_int, + is_real, + is_string, + is_object, + is_array, and + is_integer. + + + + Index: phpdoc/en/functions/classobj.xml diff -u phpdoc/en/functions/classobj.xml:1.12 phpdoc/en/functions/classobj.xml:1.13 --- phpdoc/en/functions/classobj.xml:1.12 Sat Oct 14 06:26:28 2000 +++ phpdoc/en/functions/classobj.xmlWed Mar 7 15:15:13 2001 @@ -161,7 +161,51 @@ - + + + +call_user_method_array + + Call a user method given with an array of parameters + + + +Description + + + mixed + call_user_method_array + + string + method_name + + object + obj + + array + paramarr + + + + + Calls a the method referred by method_name from + the user defined obj object, using the paramaters + in paramarr. + + + See also: + call_user_func_array, + call_user_func, + call_user_method. + + + + This function was added to the CVS code after release of PHP 4.0.4pl1 + + + + + cal
[PHP-DOC] pear docs
Hi, I've created a "pear" subdirectory alongside "functions" and "chapters". I intend to add reference docs and examples here for the parts of PEAR that are distributed with PHP. You could say there's a need for it. :-) - Stig -- Stig Sæther Bakken <[EMAIL PROTECTED]> Fast Search & Transfer ASA, Trondheim, Norway
[PHP-DOC] cvs: phpdoc /en/pear pear.xml
ssb Wed Mar 7 12:35:26 2001 EDT Added files: /phpdoc/en/pear pear.xml Log: * started documenting the PEAR base class and error mechanism Index: phpdoc/en/pear/pear.xml +++ phpdoc/en/pear/pear.xml PEAR: the PHP Extension and Application Repository PEAR PEAR PEAR base class Description The PEAR base class provides standard functionality that is used by most PEAR classes. Normally you never make an instance of the PEAR class directly, you use it by subclassing it. Its key features are: request-shutdown object "destructors" error handling Examples The example below shows how to use the PEAR's "poor man's kinda emulated destructors" to implement a simple class that holds the contents of a file, lets you append data to the object and flushes the data back to the file at the end of the request: PEAR: emulated destructors require_once "PEAR.php"; class FileContainer extends PEAR { var $file = ''; var $contents = ''; var $modified = 0; function FileContainer($file) { $this->PEAR(); // this calls the parent class constructor $fp = fopen($file, "r"); if (!is_resource($fp)) { return; } while (!empty($data = fread($fp, 2048))) { $this->contents .= $data; } fclose($fp); } function append($str) { $this->contents .= $str; $this->modified++; } // The "destructor" is named like the constructor // but with an underscore in front. function _FileContainer() { if ($this->modified) { $fp = fopen($this->file, "w"); if (!is_resource($fp)) { return; } fwrite($fp, $this->contents); fclose($fp); } } } $fileobj = new FileContainer("testfile"); $fileobj->append("this ends up at the end of the file\n"); // When the request is done and PHP shuts down, $fileobj's // "destructor" is called and updates the file on disk. PEAR "destructors" use PHP's shutdown callbacks (register_shutdown_function), and you can't output anything from these when PHP is running in a web server. So anything printed in a "destructor" gets lost except when PHP is used in command-line mode. Bummer. PEAR_Error PEAR error mechanism base class Description
[PHP-DOC] cvs: phpdoc /fr/functions array.xml classobj.xml datetime.xml dbase.xml filesystem.xml funchand.xml info.xml sybase.xml var.xml zlib.xml
damsWed Mar 7 10:08:43 2001 EDT Modified files: /phpdoc/fr/functionsclassobj.xml datetime.xml dbase.xml filesystem.xml funchand.xml info.xml sybase.xml var.xml zlib.xml array.xml Log: Adding all Jesus' updates (wahoo...) Correcting some Damien's typos. Minor esthetics Index: phpdoc/fr/functions/classobj.xml diff -u phpdoc/fr/functions/classobj.xml:1.6 phpdoc/fr/functions/classobj.xml:1.7 --- phpdoc/fr/functions/classobj.xml:1.6Tue Jan 16 14:42:26 2001 +++ phpdoc/fr/functions/classobj.xmlWed Mar 7 10:08:43 2001 @@ -222,7 +222,7 @@ - See also call_user_func. + Voir aussi call_user_func. Index: phpdoc/fr/functions/datetime.xml diff -u phpdoc/fr/functions/datetime.xml:1.14 phpdoc/fr/functions/datetime.xml:1.15 --- phpdoc/fr/functions/datetime.xml:1.14 Tue Mar 6 10:30:48 2001 +++ phpdoc/fr/functions/datetime.xmlWed Mar 7 10:08:43 2001 @@ -586,7 +586,7 @@ de l'époque UNIX, (1er janvier 1970 00:00:00 GMT), et msec qui est le nombre de microsecondes de cette heure. Cette fonction est seulement disponible sur les systèmes d'exploitation qui - supportent la fonction gettimeofday(). + supportent la fonction gettimeofday. Voir aussi time. Index: phpdoc/fr/functions/dbase.xml diff -u phpdoc/fr/functions/dbase.xml:1.2 phpdoc/fr/functions/dbase.xml:1.3 --- phpdoc/fr/functions/dbase.xml:1.2 Tue Jan 16 02:38:38 2001 +++ phpdoc/fr/functions/dbase.xml Wed Mar 7 10:08:43 2001 @@ -3,31 +3,36 @@ dBase - Ces fonctions vous permettront d'accéder aux enregistrements d'une base au format - dBase (.dbf). +Ces fonctions vous permettront d'accéder aux enregistrements d'une base au +format +dBase (.dbf). - dBase ne permet pas l'utilisation d'index, de "memo fields", ni le blocage - de la base. Deux processus de serveurs web différents modifiant la même fichier - dBase risque de rendre votre base de données incohérente. +dBase ne permet pas l'utilisation d'index, de "memo fields", ni le blocage +de la base. Deux processus de serveurs web différents modifiant +la même fichier dBase risque de rendre votre base de +données incohérente. - A la différence des bases de données SQL, la définition des bases de données - dBase, ne peut pas être changée. Une fois le fichier créé, la définition de - la base est définitive. Il n'y a pas d'index qui accélèrent les recherches ou - organisent vos données. Les fichiers dBase sont de simples fichiers séquentiels - avec des enregistrements de longueur fixe. Les enregistrements sont ajoutés à la - fin du fichier et les enregistrements supprimés sont conservés jusqu'à l'appel de - dbase_pack. +A la différence des bases de données SQL, la définition +des bases de données dBase, ne peut pas être changée. Une +fois le fichier créé, la définition de la base est +définitive. Il n'y a pas d'index qui accélèrent les +recherches +ou organisent vos données. Les fichiers dBase sont de simples fichiers +séquentiels avec des enregistrements de longueur fixe. Les +enregistrements sont ajoutés à la fin du fichier et les +enregistrements supprimés sont conservés jusqu'à +l'appel de dbase_pack. - Nous vous recommandons de ne pas utiliser les fichiers dBase comme base de données - de production. Choisissez n'importe quel serveur SQL à la place. MySQL et - Postgres sont des choix classiques avec PHP. Le support de dBase ne se justifie - ici que pour vous permettre d'importer et d'exporter des données de et vers votre - base des données web, maintenant que le format du fichier est communément géré par - les feuilles et organiseurs Windows. L'import et l'export de données est l'unique - chose pour laquelle l'utilisation de dBase est recommandée. +Nous vous recommandons de ne pas utiliser les fichiers dBase comme base +de données de production. Choisissez n'importe quel serveur SQL +à la place. MySQL et PostgresSQL sont des choix classiques avec +PHP. Le support de dBase ne se justifie ici que pour vous permettre +d'importer et d'exporter des données de et vers votre base des +données web, maintenant que le format du fichier est +communément géré par les feuilles et +organiseurs Windows. L'import et l'export de données est l'unique +chose pour laquelle l'utilisation de dBase est recommandée. @@ -44,8 +49,9 @@ fields est un tableau de tableaux. Chaque tableau - décrit le format d'un fichier de la base. Chaque champs est constitué d'un nom, - d'un caractère de type de champs, d'une longueur et d'une précision. + décrit le format d'un fichier de la base. Chaque champs est + constitué d'un nom, d'un caractère de type
[PHP-DOC] cvs: phpdoc /en/functions funchand.xml
jmcastagnetto Wed Mar 7 04:18:15 2001 EDT Modified files: /phpdoc/en/functionsfunchand.xml Log: more typos Index: phpdoc/en/functions/funchand.xml diff -u phpdoc/en/functions/funchand.xml:1.8 phpdoc/en/functions/funchand.xml:1.9 --- phpdoc/en/functions/funchand.xml:1.8Wed Mar 7 04:17:26 2001 +++ phpdoc/en/functions/funchand.xmlWed Mar 7 04:18:14 2001 @@ -418,7 +418,7 @@ $arr["user"] (see example below). -function mytable($id, $data) { +function myrow($id, $data) { return "\n"; } $id $data
[PHP-DOC] cvs: phpdoc /en/functions funchand.xml
jmcastagnetto Wed Mar 7 04:17:27 2001 EDT Modified files: /phpdoc/en/functionsfunchand.xml Log: Minor typo fixes Index: phpdoc/en/functions/funchand.xml diff -u phpdoc/en/functions/funchand.xml:1.7 phpdoc/en/functions/funchand.xml:1.8 --- phpdoc/en/functions/funchand.xml:1.7Wed Mar 7 03:12:47 2001 +++ phpdoc/en/functions/funchand.xmlWed Mar 7 04:17:26 2001 @@ -419,7 +419,7 @@ function mytable($id, $data) { -return ">tr<>th<$id>/th<>td<$data>/td<>/tr<\n"; +return +"\n"; } $arr = get_defined_functions(); $id $data
[PHP-DOC] cvs: phpdoc / Makefile.in
jmoore Wed Mar 7 03:54:08 2001 EDT Modified files: /phpdoc Makefile.in Log: Updating Copyright msg from php3 to php4 with new licience details. Index: phpdoc/Makefile.in diff -u phpdoc/Makefile.in:1.58 phpdoc/Makefile.in:1.59 --- phpdoc/Makefile.in:1.58 Fri Feb 9 20:46:14 2001 +++ phpdoc/Makefile.in Wed Mar 7 03:54:08 2001 @@ -1,32 +1,23 @@ +# # +--+ -# | PHP HTML Embedded Scripting Language Version 3.0 | +# | PHP Version 4.0 | # +--+ -# | Copyright (c) 1997,1998 PHP Development Team (See Credits file) | +# | Copyright (c) 1997-2001 The PHP Group| # +--+ -# | This program is free software; you can redistribute it and/or modify | -# | it under the terms of one of the following licenses: | -# | | -# | A) the GNU General Public License as published by the Free Software | -# | Foundation; either version 2 of the License, or (at your option) | -# | any later version. | -# | | -# | B) the PHP License as published by the PHP Development Team and | -# | included in the distribution in the file: LICENSE| -# | | -# | This program is distributed in the hope that it will be useful, | -# | but WITHOUT ANY WARRANTY; without even the implied warranty of | -# | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the| -# | GNU General Public License for more details. | -# | | -# | You should have received a copy of both licenses referred to here. | -# | If you did not, or have any questions about PHP licensing, please| -# | contact [EMAIL PROTECTED]| +# | This source file is subject to version 2.02 of the PHP licience, | +# | that is bundled with this package in the file LICENCE and is | +# | avalible through the world wide web at | +# | http://www.php.net/license/2_02.txt. | +# | If uou did not receive a copy of the PHP license and are unable to | +# | obtain it through the world wide web, please send a note to | +# | [EMAIL PROTECTED] so we can mail you a copy immediately| # +--+ # | Authors: Stig Bakken <[EMAIL PROTECTED]> | # +--+ +# # -# $Id: Makefile.in,v 1.58 2001/02/10 04:46:14 jmcastagnetto Exp $ +# $Id: Makefile.in,v 1.59 2001/03/07 11:54:08 jmoore Exp $ # VPATH=@srcdir@
[PHP-DOC] cvs: phpdoc /en/functions info.xml
jmcastagnetto Wed Mar 7 03:24:24 2001 EDT Modified files: /phpdoc/en/functionsinfo.xml Log: added documentation for zend_version Index: phpdoc/en/functions/info.xml diff -u phpdoc/en/functions/info.xml:1.38 phpdoc/en/functions/info.xml:1.39 --- phpdoc/en/functions/info.xml:1.38 Wed Nov 29 09:58:57 2000 +++ phpdoc/en/functions/info.xmlWed Mar 7 03:24:23 2001 @@ -75,45 +75,45 @@ - option - ini-parameter - default - description +option +ini-parameter +default +description - ASSERT_ACTIVE - assert.active - 1 - enable assert evaluation +ASSERT_ACTIVE +assert.active +1 +enable assert evaluation - ASSERT_WARNING - assert.warning - 1 - issue a PHP warning for each failed assertion +ASSERT_WARNING +assert.warning +1 +issue a PHP warning for each failed assertion - ASSERT_BAIL - assert.bail - 0 - terminate execution on failed assertions +ASSERT_BAIL +assert.bail +0 +terminate execution on failed assertions - ASSERT_QUIET_EVAL - assert.quiet_eval - 0 - -disable error_reporting during assertion expression -evaluation - +ASSERT_QUIET_EVAL +assert.quiet_eval +0 + + disable error_reporting during assertion expression + evaluation + - ASSERT_CALLBACK - assert_callback - (null) - user function to call on failed assertions +ASSERT_CALLBACK +assert_callback +(null) +user function to call on failed assertions @@ -170,7 +170,7 @@ Loads the PHP extension defined in library. See also the extension_dir configuration + linkend="ini.extension-dir">extension_dir configuration directive. @@ -203,9 +203,9 @@ You can see a list of all the environmental variables by using phpinfo. You can find out what many of them mean by taking a look at the CGI - specification, specifically the page on - environmental variables. + specification, specifically the page on + environmental variables. This function does not work in ISAPI mode. @@ -242,7 +242,7 @@ To check whether the system is using a configuration file, try + linkend="configuration.file">configuration file, try retrieving the value of the cfg_file_path configuration setting. If this is available, a configuration file is being used. @@ -392,7 +392,7 @@ - This function is not supported on Windows systems. + This function is not supported on Windows systems. @@ -645,10 +645,10 @@ + // some code of your own + phpcredits(CREDITS_ALL + CREDITS_FULLPAGE); + // some more code + ?>