CVS update: php3/doc/functions

From: Date: Tue, 08 Dec 1998 03:12:34 +0000
Subject: CVS update: php3/doc/functions
Groups: php.dev 
Request: Send a blank email to php-dev+get-2713@lists.php.net to get a copy of this message
Date: Monday December 7, 1998 @ 22:12 Author: jim Update of /repository/php3/doc/functions In directory asf:/u/temp/cvs-serv13961/functions Modified Files: array.sgml datetime.sgml dbase.sgml dbm.sgml exec.sgml filesystem.sgml http.sgml info.sgml misc.sgml mysql.sgml strings.sgml var.sgml Log Message: Add notes from errata. Index: php3/doc/functions/array.sgml diff -c php3/doc/functions/array.sgml:1.28 php3/doc/functions/array.sgml:1.29 *** php3/doc/functions/array.sgml:1.28 Sat Nov 21 18:06:06 1998 --- php3/doc/functions/array.sgml Mon Dec 7 22:12:29 1998 *************** *** 332,340 **** </example> <para> ! See also <function>key</function>, <function>current</function>, ! <function>reset</function>, <function>next</function>, and ! <function>prev</function>. </refsect1> </refentry> --- 332,340 ---- </example> <para> ! See also <function>key</function>, <function>list</function>, ! <function>current</function>, <function>reset</function>, ! <function>next</function>, and <function>prev</function>. </refsect1> </refentry> *************** *** 356,362 **** internal pointer to the last element. <para> See also: ! <function>current</function>, <function>end</function> <function>next</function> and <function>reset</function> </refsect1> </refentry> --- 356,362 ---- internal pointer to the last element. <para> See also: ! <function>current</function>, <function>each</function>, <function>end</function> <function>next</function> and <function>reset</function> </refsect1> </refentry> *************** *** 377,383 **** current array position. <para> See also: ! <function>current</function> <function>next</function> </refsect1> </refentry> --- 377,383 ---- current array position. <para> See also: ! <function>current</function>, <function>next</function> </refsect1> </refentry> *************** *** 465,470 **** --- 465,471 ---- <para> See also: + <function>each</function>, <function>array</function>. </refsect1> </refentry> *************** *** 568,574 **** internal pointer to the first element. <para> See also: ! <function>current</function>, <function>next</function> <function>prev</function> and <function>reset</function> </refsect1> </refentry> --- 569,575 ---- internal pointer to the first element. <para> See also: ! <function>current</function>, <function>each</function>, <function>next</function> <function>prev</function> and <function>reset</function> </refsect1> </refentry> Index: php3/doc/functions/datetime.sgml diff -c php3/doc/functions/datetime.sgml:1.20 php3/doc/functions/datetime.sgml:1.21 *** php3/doc/functions/datetime.sgml:1.20 Fri Oct 23 07:39:08 1998 --- php3/doc/functions/datetime.sgml Mon Dec 7 22:12:29 1998 *************** *** 96,102 **** --- 96,110 ---- $lastmonth = mktime(0,0,0,date("m")-1,date("d"), date("Y")); $nextyear = mktime(0,0,0,date("m"), date("d", date("Y")+1); </programlisting></example> + </para> + <para> + To format dates in other languages, you should use the + <function>setlocale</function> and <function>strftime</function> + functions. + </para> + + <para> See also <function>gmdate</function> and <function>mktime</function>. </para> Index: php3/doc/functions/dbase.sgml diff -c php3/doc/functions/dbase.sgml:1.6 php3/doc/functions/dbase.sgml:1.7 *** php3/doc/functions/dbase.sgml:1.6 Sun Sep 13 13:48:08 1998 --- php3/doc/functions/dbase.sgml Mon Dec 7 22:12:29 1998 *************** *** 8,15 **** (dbf) databases. <simpara> There is no support for indexes or memo fields. There is no support ! for locking, too. Two concurrent webserver processes accessing the ! same dBase file will ruin your database. <simpara> Unlike SQL databases, dBase "databases" cannot change the database definition afterwards. Once the file is created, the database --- 8,15 ---- (dbf) databases. <simpara> There is no support for indexes or memo fields. There is no support ! for locking, too. Two concurrent webserver processes modifying the ! same dBase file will very likely ruin your database. <simpara> Unlike SQL databases, dBase "databases" cannot change the database definition afterwards. Once the file is created, the database *************** *** 84,96 **** <example> <title>Creating a dBase database file</title> <programlisting role=php> - // "database" name - $dbname = "/tmp/test.dbf"; // database "definition" - $def = array( array("date", "D"), --- 84,93 ---- *************** *** 101,107 **** ); // creation - if (!dbase_create($dbname, $def)) print "&lt;strong>Error!&lt;/strong>"; --- 98,103 ---- Index: php3/doc/functions/dbm.sgml diff -c php3/doc/functions/dbm.sgml:1.5 php3/doc/functions/dbm.sgml:1.6 *** php3/doc/functions/dbm.sgml:1.5 Fri Sep 11 09:34:40 1998 --- php3/doc/functions/dbm.sgml Mon Dec 7 22:12:29 1998 *************** *** 9,14 **** --- 9,29 ---- gdbm, and some system libraries, as well as a built-in flatfile library) stores key/value pairs (as opposed to the full-blown records supported by relational databases). + <para> + <example> + <title>dbm example</title> + <programlisting role=php> + $dbm = dbmopen("lastseen", "w"); + if (dbmexists($dbm, $userid)) { + $last_seen = dbmfetch($dbm, $userid); + } else { + dbminsert($dbm, $userid, time()); + } + do_stuff(); + dbmreplace($dbm, $userid, time()); + dbmclose($dbm); + </programlisting></example> + </para> </partintro> <refentry id="function.dbmopen"> *************** *** 26,32 **** <para> The first argument is the full-path filename of the dbm file to be opened and the second is the file open mode which is one of "r", "n" or "w" for ! read-only, new (implies read-write) and read-write respectively. <para> Returns an identifer to be passed to the other dbm functions on success, or false on failure. --- 41,48 ---- <para> The first argument is the full-path filename of the dbm file to be opened and the second is the file open mode which is one of "r", "n" or "w" for ! read-only, new (implies read-write, and may truncate an already-existing ! database of the same name) and read-write respectively. <para> Returns an identifer to be passed to the other dbm functions on success, or false on failure. Index: php3/doc/functions/exec.sgml diff -c php3/doc/functions/exec.sgml:1.13 php3/doc/functions/exec.sgml:1.14 *** php3/doc/functions/exec.sgml:1.13 Thu Jul 16 11:55:26 1998 --- php3/doc/functions/exec.sgml Mon Dec 7 22:12:29 1998 *************** *** 43,49 **** </funcsynopsis> <para> ! Exec executes the given <parameter>command</parameter>, however it does not output anything. It simply returns the last line from the result of the command. If you need to execute a command and have all the data from the command passed directly back without any interference, use the <function>PassThru</function> --- 43,49 ---- </funcsynopsis> <para> ! <function>exec</function> executes the given <parameter>command</parameter>, however it does not output anything. It simply returns the last line from the result of the command. If you need to execute a command and have all the data from the command passed directly back without any interference, use the <function>PassThru</function> Index: php3/doc/functions/filesystem.sgml diff -c php3/doc/functions/filesystem.sgml:1.30 php3/doc/functions/filesystem.sgml:1.31 *** php3/doc/functions/filesystem.sgml:1.30 Fri Nov 6 18:40:52 1998 --- php3/doc/functions/filesystem.sgml Mon Dec 7 22:12:29 1998 *************** *** 151,156 **** --- 151,158 ---- status check, for instance if the file is being checked many times and may change or disappear, use this function to clear the results of the last call from memory. + <para> + This value is only cached for the lifetime of a single request. <para> Affected functions include <function>stat</function>, *************** *** 334,344 **** <para> Returns a string of up to length - 1 bytes read from the file pointed to by fp. Reading ends when length - 1 bytes have been ! read, on a newline, or on EOF (whichever comes first). ! <para> If an error occurs, returns false. ! <para> The file pointer must be valid, and must point to a file successfully opened by <function>fopen</function>, <function>popen</function>, or <function>fsockopen</function>. --- 336,349 ---- <para> Returns a string of up to length - 1 bytes read from the file pointed to by fp. Reading ends when length - 1 bytes have been ! read, on a newline (which is included in the return value), or ! on EOF (whichever comes first). ! <para> ! If an error occurs, returns false. ! <para> ! The file pointer must be valid, and must point to a file successfully opened by <function>fopen</function>, <function>popen</function>, or <function>fsockopen</function>. *************** *** 388,395 **** </funcsynopsis> <para> ! Identical to <function>readfile</function>, except that file() ! returns the file in an array. <para> See also <function>readfile</function>, --- 393,401 ---- </funcsynopsis> <para> ! Identical to <function>readfile</function>, except that <function>file</function> ! returns the file in an array. Each element of the array corresponds ! to a line in the file, with the newline still attached. <para> See also <function>readfile</function>, *************** *** 451,458 **** <funcdef>int <function>filectime</function></funcdef> <paramdef>string <parameter>filename</parameter></paramdef> </funcsynopsis> ! <para> Returns the time the file was last changed, or false in case of an ! error. </refsect1> </refentry> --- 457,465 ---- <funcdef>int <function>filectime</function></funcdef> <paramdef>string <parameter>filename</parameter></paramdef> </funcsynopsis> ! <para> ! Returns the time the file was last changed, or false in case of an ! error. </refsect1> </refentry> *************** *** 504,511 **** <funcdef>int <function>filemtime</function></funcdef> <paramdef>string <parameter>filename</parameter></paramdef> </funcsynopsis> ! <para> Returns the time the file was last modified, or false in case of an ! error. </refsect1> </refentry> --- 511,519 ---- <funcdef>int <function>filemtime</function></funcdef> <paramdef>string <parameter>filename</parameter></paramdef> </funcsynopsis> ! <simpara> ! Returns the time the file was last modified, or false in case of an ! error. </refsect1> </refentry> *************** *** 608,614 **** If <parameter>filename</parameter> begins with "ftp://" (not case sensitive), an ftp connection to the specified server is opened and a pointer to the requested file is returned. If the server does not support ! passive mode ftp, this will fail. <simpara> If <parameter>filename</parameter> begins with anything else, the --- 616,623 ---- If <parameter>filename</parameter> begins with "ftp://" (not case sensitive), an ftp connection to the specified server is opened and a pointer to the requested file is returned. If the server does not support ! passive mode ftp, this will fail. You can open files for either ! reading and writing via ftp (but not both simultaneously). <simpara> If <parameter>filename</parameter> begins with anything else, the *************** *** 652,659 **** <example> <title>fopen() example</title> <programlisting> ! $fp = fopen( "/home/rasmus/file.txt", "r" ); ! $fp = fopen( "http://www.php.net/", "r" ); </programlisting></example> <simpara> --- 661,669 ---- <example> <title>fopen() example</title> <programlisting> ! $fp = fopen("/home/rasmus/file.txt", "r"); ! $fp = fopen("http://www.php.net/", "r"); ! $fp = fopen("ftp://user:password@example.com/", "w"); </programlisting></example> <simpara> *************** *** 661,666 **** --- 671,683 ---- files and you're using the server module version of PHP, remember to make sure that the files and directories you're using are accessible to the server process. + + <para> + On the Windows platform, be careful to escape any backslashes + used in the path to the file, or use forward slashes. + <informalexample><programlisting> + $fp = fopen("c:\\data\\info.txt", "r"); + </programlisting></informalexample> <simpara> See also <function>fclose</function>, Index: php3/doc/functions/http.sgml diff -c php3/doc/functions/http.sgml:1.9 php3/doc/functions/http.sgml:1.10 *** php3/doc/functions/http.sgml:1.9 Fri Sep 11 09:34:41 1998 --- php3/doc/functions/http.sgml Mon Dec 7 22:12:31 1998 *************** *** 103,108 **** --- 103,112 ---- <para> For more information on cookies, see Netscape's cookie specification at <ulink url="&spec.cookies;">&spec.cookies;</ulink>. + <simpara> + Microsoft Internet Explorer 4 with Service Pack 1 applied does + not correctly deal with cookies that have their path parameter + set. </refsect1> </refentry> Index: php3/doc/functions/info.sgml diff -c php3/doc/functions/info.sgml:1.7 php3/doc/functions/info.sgml:1.8 *** php3/doc/functions/info.sgml:1.7 Sat Jul 25 16:49:07 1998 --- php3/doc/functions/info.sgml Mon Dec 7 22:12:31 1998 *************** *** 166,171 **** --- 166,174 ---- <para> Returns the value of the environment variable <parameter>varname</parameter>, or false on an error. + <informalexample><programlisting> + $ip = getenv("REMOTE_ADDR"); // get the ip number from the user + </programlisting></informalexample> </refsect1> </refentry> *************** *** 182,192 **** <paramdef>string <parameter>varname</parameter></paramdef> </funcsynopsis> ! <para> Returns the current value of the PHP configuration variable specified by <parameter>varname</parameter>, or false if an error occurs. </refsect1> </refentry> --- 185,204 ---- <paramdef>string <parameter>varname</parameter></paramdef> </funcsynopsis> ! <simpara> Returns the current value of the PHP configuration variable specified by <parameter>varname</parameter>, or false if an error occurs. + <simpara> + It will not return configuration information set when the PHP was + compiled, or read from an Apache configuration file (using the + php3_configuration_option directives). + + <simpara> + To check whether the system is using a php3.ini file, try retrieving + the value of the cfg_file_path configuration setting. If this is + available, a php3.ini file is being used. </refsect1> </refentry> Index: php3/doc/functions/misc.sgml diff -c php3/doc/functions/misc.sgml:1.13 php3/doc/functions/misc.sgml:1.14 *** php3/doc/functions/misc.sgml:1.13 Mon Nov 23 13:13:07 1998 --- php3/doc/functions/misc.sgml Mon Dec 7 22:12:31 1998 *************** *** 64,69 **** --- 64,97 ---- </refsect1> </refentry> + <refentry id="function.die"> + <refnamediv> + <refname>die</refname> + <refpurpose>Output a message and terminate the current script</refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcdef>void <function>die</function></funcdef> + <paramdef>string <parameter>message</parameter></paramdef> + </funcsynopsis> + <simpara> + This language construct outputs a message and terminates parsing of the script. It does not + return. + <para> + <example> + <title>die example</title> + <programlisting> + &lt;?php + $filename = '/path/to/data-file'; + $file = fopen($filename, 'r') + or die "unable to open file ($filename)"; + ?&gt; + </programlisting> + </example> + </refsect1> + </refentry> + <refentry id="function.exit"> <refnamediv> <refname>exit</refname> Index: php3/doc/functions/mysql.sgml diff -c php3/doc/functions/mysql.sgml:1.17 php3/doc/functions/mysql.sgml:1.18 *** php3/doc/functions/mysql.sgml:1.17 Sun Oct 4 08:11:11 1998 --- php3/doc/functions/mysql.sgml Mon Dec 7 22:12:31 1998 *************** *** 2,7 **** --- 2,14 ---- <reference id="ref.mysql"> <title>MySQL Functions</title> <titleabbrev>MySQL</titleabbrev> + <partintro> + <simpara> + These functions allow you to access MySQL database servers. + <simpara> + More information about MySQL can be found at <ulink + url="http://www.mysql.com/">http://www.mysql.com/</ulink>. + </partintro> <refentry id="function.mysql-affected-rows"> <refnamediv> Index: php3/doc/functions/strings.sgml diff -c php3/doc/functions/strings.sgml:1.43 php3/doc/functions/strings.sgml:1.44 *** php3/doc/functions/strings.sgml:1.43 Mon Nov 23 10:06:53 1998 --- php3/doc/functions/strings.sgml Mon Dec 7 22:12:32 1998 *************** *** 28,34 **** and NUL (the null byte). <para> ! See also <function>stripslashes</function> and <function>quotemeta</function>. </refsect1> </refentry> --- 28,35 ---- and NUL (the null byte). <para> ! See also <function>stripslashes</function>, <function>htmlspecialchars</function> ! and <function>quotemeta</function>. </refsect1> </refentry> *************** *** 154,159 **** --- 155,163 ---- 2-character DES salt by default unless the default encryption type on the system is MD5 in which case a random MD5-compatible salt is generated. + <simpara> + The standard DES encryption <function>crypt</function> contains + the salt as the first two characters of the output. <simpara> There is no decrypt function, since <function>crypt</function> uses a one-way algorithm. *************** *** 174,179 **** --- 178,194 ---- </funcsynopsis> <simpara> Outputs all parameters. + <para> + <function>echo</function> is not actually a function (it + is a language construct) so you are not required to use + parantheses with it. + + <example><title>echo example</title> + <programlisting> + echo "Hello World"; + </programlisting> + </example> + </para> <simpara> See also: *************** *** 780,786 **** An optional <emphasis>precision specifier</emphasis> that says how many decimal digits should be displayed for floating-point numbers. This option has no effect for other types than ! double. <listitem><para> --- 795,802 ---- An optional <emphasis>precision specifier</emphasis> that says how many decimal digits should be displayed for floating-point numbers. This option has no effect for other types than ! double. (Another function useful for formatting numbers is ! <function>number_format</function>.) <listitem><para> *************** *** 842,848 **** <simpara> See also: ! <function>printf</function> </refsect1> --- 858,864 ---- <simpara> See also: ! <function>printf</function>, <function>number_format</function> </refsect1> Index: php3/doc/functions/var.sgml diff -c php3/doc/functions/var.sgml:1.10 php3/doc/functions/var.sgml:1.11 *** php3/doc/functions/var.sgml:1.10 Sat Nov 21 18:09:06 1998 --- php3/doc/functions/var.sgml Mon Dec 7 22:12:34 1998 *************** *** 109,115 **** <simpara> Returns false if <parameter>var</parameter> exists and has a ! value; true otherwise. <simpara> See also <function>isset</function> and <function>unset</function>. --- 109,115 ---- <simpara> Returns false if <parameter>var</parameter> exists and has a ! non-empty or non-zero value; true otherwise. <simpara> See also <function>isset</function> and <function>unset</function>. -- PHP Development Mailing List http://www.php.net/ To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net For help: php-dev-help@lists.php.net

« previous php.dev (#2713) next »