cvs: phpdoc /en/chapters security.xml /nl/chapters security.xml /nl/features file-upload.xml /nl/functions calendar.xml filesystem.xml ftp.xml
ibase.xml ldap.xml misc.xml mysql.xml oci8.xml sockets.xml swf.xml var.xml xml.xml /nl/language basic-syntax.xml functions.xml
| From: | Derick Rethans | Date: | Tue, 07 Nov 2000 23:11:09 +0000 |
| Subject: | cvs: phpdoc /en/chapters security.xml /nl/chapters security.xml /nl/features file-upload.xml /nl/functions calendar.xml filesystem.xml ftp.xml ibase.xml ldap.xml misc.xml mysql.xml oci8.xml sockets.xml swf.xml var.xml xml.xml /nl/language basic-syntax.xml functions.xml |
||
| Groups: | php.doc | ||
| Request: | Send a blank email to phpdoc+get-969332825@lists.php.net to get a copy of this message | ||
derick Tue Nov 7 15:11:09 2000 EDT
Modified files:
/phpdoc/en/chapters security.xml
/phpdoc/nl/chapters security.xml
/phpdoc/nl/features file-upload.xml
/phpdoc/nl/functions calendar.xml filesystem.xml ftp.xml ibase.xml
ldap.xml misc.xml mysql.xml oci8.xml
sockets.xml swf.xml var.xml xml.xml
/phpdoc/nl/language basic-syntax.xml functions.xml
Log:
- Updated from English tree, and fixed some typo's
Index: phpdoc/en/chapters/security.xml diff -u phpdoc/en/chapters/security.xml:1.12 phpdoc/en/chapters/security.xml:1.13 --- phpdoc/en/chapters/security.xml:1.12 Wed Nov 1 22:11:37 2000 +++ phpdoc/en/chapters/security.xml Tue Nov 7 15:11:07 2000 @@ -400,7 +400,7 @@ ?> </programlisting> </example> - Dpending on your operating system, there are a wide variety of files + Depending on your operating system, there are a wide variety of files which you should be concerned about, including device entries (/dev/ or COM1), configuration files (/etc/ files and the .ini files), well known file storage areas (/home/, My Documents), etc. For this Index: phpdoc/nl/chapters/security.xml diff -u phpdoc/nl/chapters/security.xml:1.5 phpdoc/nl/chapters/security.xml:1.6 --- phpdoc/nl/chapters/security.xml:1.5 Wed Oct 18 16:02:18 2000 +++ phpdoc/nl/chapters/security.xml Tue Nov 7 15:11:07 2000 @@ -306,10 +306,11 @@ <simpara> Omdat PHP is ontworpen met gebruikers level toegang tot het bestandssysteem, is het helemaal mogelijk om een PHP script te - schrijven dat systeembestanden zoals /etc/password bewerkt. Dit geeft - een aantal implicaties; je moet namelijk goed controleren dat de - bestanden die je leest en schrijft ook diegene zijn die je denkt - dat je leest en schrijft. + schrijven dat systeembestanden zoals /etc/password bewerkt, + ethernet connecties door de war gooit of heel veel uitprint op + een printer. Dit geeft een aantal implicaties; je moet namelijk + goed controleren dat de bestanden die je leest en schrijft + ook diegene zijn die je denkt dat je leest en schrijft. </simpara> <simpara> Neem het volgende in gedachten: als een gebruikt te kennen geeft een @@ -351,7 +352,7 @@ ?> </programlisting> </example> - Er zijn twee toepasbare manier om dit soort dingen tegen te gaan: + Er zijn twee belangrijke manieren om dit soort dingen tegen te gaan: <itemizedlist> <listitem> <simpara> @@ -360,7 +361,7 @@ </listitem> <listitem> <simpara> - Controleer alle bestands gerelateerde variabelen. + Controleer alle variabelen. </simpara> </listitem> </itemizedlist> @@ -369,7 +370,7 @@ <title>Veiliger bestandsnaam controle</title> <programlisting role="php"> <?php -// verwijders een bestand van de schijf waartoe de PHP gebruiker +// verwijderd een bestand van de schijf waartoe de PHP gebruiker // toegang heeft. $gebruiker = $HTTP_REMOTE_USER; // use an authentication mechanisim @@ -383,10 +384,31 @@ fputs ($fp, $logstring); fclose($fp); -echo "$te_verwijderen_bestand has been deleted!"; +echo "$te_verwijderen_bestand is verwijderd!"; ?> </programlisting> </example> + Een alternatief is om een eigen controle uit te voeren: + <example> + <title>Veiliger bestandsnaam controle</title> + <programlisting role="php"> +<?php +$username = $HTTP_REMOTE_USER; +$homedir = "/home/$username"; + +if (!ereg('^[^./][^/]*$', $userfile)) + die('niet geldige bestansnaam'); //die, ga niet verder + +//etc... +?> + </programlisting> + </example> + Afhankelijke van je operating system zijn er een groot aantal files + die extra andacht vereisen, inbegrepen zijn device entries (/dev/ + or COM1), configuratie files (/etc/ bestanden en de .ini files), + bekende bestandslocaties (/home/, Mijn Documenten), etc. Om deze + reden is het vaak makkelijker om een policy aan te houden die alles + verbied, behalve de dingen die je expliciet toelaat. </para> </sect1> @@ -503,6 +525,14 @@ een systeem kunnen garanderen, maar de beveiling zal zeker beter zijn dan als je jezelf deze vragen niet stelt. </para> + <para> + Je kunt ook overwegen om register_globals, + magic_quotes, of andere handigheden uit te zetten die je kunnen + tegenwerken om de validiteit, herkomst, of waarde van een gegeven + variabele te conroleren. Het werken met PHP in error_reporting(E_ALL) + mode kan je ook helpen waarschuwen over variabelen die gebruikt + worden voordat ze zijn gecontroleerd of geïnitialiseerd. + </para> </sect1> <sect1 id="security.general"> @@ -516,7 +546,12 @@ dan zou je een enorm veilig systeem hebben. Op deze manier zal het wel een uur duren om een redelijk complex web formulier in te vullen. Op deze manier zullen gebruikers een manier gaan zoeken om de beveiliging - te omzeilen om hun werk te doen. Sommige manieren van aanvallen + te omzeilen om hun werk te doen. + </simpara> + <simpara> + De beste manier van beveiliging is vaak te strak om gebruikers gewoon + kun werk te laten doen, of om de developer dood te gooien met + vergaande complexiteit. Sommige manieren van aanvallen op systemen zijn zelfs ontstaan vanwege een overkill aan beveiliging. </simpara> <simpara> Index: phpdoc/nl/features/file-upload.xml diff -u phpdoc/nl/features/file-upload.xml:1.1 phpdoc/nl/features/file-upload.xml:1.2 --- phpdoc/nl/features/file-upload.xml:1.1 Tue Oct 10 15:07:53 2000 +++ phpdoc/nl/features/file-upload.xml Tue Nov 7 15:11:07 2000 @@ -41,9 +41,9 @@ In PHP 3, the following variables will be defined within the destination script upon a successful upload, assuming that <link linkend="ini.register-globals">register_globals</link> is turned - on in <filename>php.ini</filename>. If <link + on in <filename>php3.ini</filename>. If <link linkend="ini.track-vars">track_vars</link> is turned on, they will - also be available within the global array + also be available in PHP 3 within the global array <varname>$HTTP_POST_VARS</varname>. Note that the following variable names assume the use of the file upload name 'userfile', as used in the example above: Index: phpdoc/nl/functions/calendar.xml diff -u phpdoc/nl/functions/calendar.xml:1.1 phpdoc/nl/functions/calendar.xml:1.2 --- phpdoc/nl/functions/calendar.xml:1.1 Tue Oct 10 15:07:53 2000 +++ phpdoc/nl/functions/calendar.xml Tue Nov 7 15:11:07 2000 @@ -202,9 +202,7 @@ <funcsynopsis> <funcprototype> <funcdef>string <function>jdtofrench</function></funcdef> - <paramdef>int <parameter>month</parameter></paramdef> - <paramdef>int <parameter>day</parameter></paramdef> - <paramdef>int <parameter>year</parameter></paramdef> + <paramdef>int <parameter>juliandaycount</parameter></paramdef> </funcprototype> </funcsynopsis> <para> Index: phpdoc/nl/functions/filesystem.xml diff -u phpdoc/nl/functions/filesystem.xml:1.2 phpdoc/nl/functions/filesystem.xml:1.3 --- phpdoc/nl/functions/filesystem.xml:1.2 Thu Oct 19 15:01:23 2000 +++ phpdoc/nl/functions/filesystem.xml Tue Nov 7 15:11:07 2000 @@ -382,6 +382,33 @@ </refsect1> </refentry> + <refentry id="function.fflush"> + <refnamediv> + <refname>fflush</refname> + <refpurpose>Flushes the output to a file</refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcprototype> + <funcdef>int <function>fflush</function></funcdef> + <paramdef>int <parameter>fp</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + This function forces a write of all buffered output to the + to the resource pointed to by the file handle + <parameter>fp</parameter>. Returns true if succesful, false + otherwise. + </para> + <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>. + </para> + </refsect1> + </refentry> + <refentry id="function.fgetc"> <refnamediv> <refname>fgetc</refname> @@ -959,30 +986,30 @@ <itemizedlist> <listitem> <simpara> - To acquire a shared lock (reader), set - <parameter>operation</parameter> to LOCK_SH (set to 1 prior to - PHP 4.0.1). + To acquire a shared lock (reader), set + <parameter>operation</parameter> to LOCK_SH (set to 1 prior to + PHP 4.0.1). </simpara> </listitem> <listitem> <simpara> - To acquire an exclusive lock (writer), set - <parameter>operation</parameter> to LOCK_EX (set to 2 prior to - PHP 4.0.1). + To acquire an exclusive lock (writer), set + <parameter>operation</parameter> to LOCK_EX (set to 2 prior to + PHP 4.0.1). </simpara> </listitem> <listitem> <simpara> - To release a lock (shared or exclusive), set - <parameter>operation</parameter> to LOCK_UN (set to 3 prior to - PHP 4.0.1). + To release a lock (shared or exclusive), set + <parameter>operation</parameter> to LOCK_UN (set to 3 prior to + PHP 4.0.1). </simpara> </listitem> <listitem> <simpara> - If you don't want <function>flock</function> to block while - locking, add LOCK_NB (4 prior to PHP 4.0.1) to - <parameter>operation</parameter>. + If you don't want <function>flock</function> to block while + locking, add LOCK_NB (4 prior to PHP 4.0.1) to + <parameter>operation</parameter>. </simpara> </listitem> </itemizedlist> @@ -1068,42 +1095,42 @@ <itemizedlist> <listitem> <simpara> - 'r' - Open for reading only; place the file pointer at the - beginning of the file. + 'r' - Open for reading only; place the file pointer at the + beginning of the file. </simpara> </listitem> <listitem> <simpara> - 'r+' - Open for reading and writing; place the file pointer at - the beginning of the file. + 'r+' - Open for reading and writing; place the file pointer at + the beginning of the file. </simpara> </listitem> <listitem> <simpara> - 'w' - Open for writing only; place the file pointer at the - beginning of the file and truncate the file to zero length. - If the file does not exist, attempt to create it. + 'w' - Open for writing only; place the file pointer at the + beginning of the file and truncate the file to zero length. + If the file does not exist, attempt to create it. </simpara> </listitem> <listitem> <simpara> - 'w+' - Open for reading and writing; place the file pointer at - the beginning of the file and truncate the file to zero - length. If the file does not exist, attempt to create it. + 'w+' - Open for reading and writing; place the file pointer at + the beginning of the file and truncate the file to zero + length. If the file does not exist, attempt to create it. </simpara> </listitem> <listitem> <simpara> - 'a' - Open for writing only; place the file pointer at the end - of the file. If the file does not exist, attempt to create - it. + 'a' - Open for writing only; place the file pointer at the end + of the file. If the file does not exist, attempt to create + it. </simpara> </listitem> <listitem> <simpara> - 'a+' - Open for reading and writing; place the file pointer at - the end of the file. If the file does not exist, attempt to - create it. + 'a+' - Open for reading and writing; place the file pointer at + the end of the file. If the file does not exist, attempt to + create it. </simpara> </listitem> </itemizedlist> @@ -2391,10 +2418,18 @@ $tmpfname = tempnam ("/tmp", "FOO"); </programlisting> </example> + </para> + <note> + <simpara> + This Function's behaviour changed in 4.0.3, the temporary file is also + created to avoid a race condition where the file might appear in the + filesystem between the time the string was generated and before the + the script gets around to creating the file. + </simpara> + </note> + <para> + See also <function>tmpfile</function>. </para> - <para> - See also <function>tmpfile</function>. - </para> </refsect1> </refentry> @@ -2442,9 +2477,9 @@ <funcdef>int <function>touch</function></funcdef> <paramdef>string <parameter>filename</parameter></paramdef> <paramdef>int - <parameter> - <optional>time</optional> - </parameter> + <parameter> + <optional>time</optional> + </parameter> </paramdef> </funcprototype> </funcsynopsis> Index: phpdoc/nl/functions/ftp.xml diff -u phpdoc/nl/functions/ftp.xml:1.1 phpdoc/nl/functions/ftp.xml:1.2 --- phpdoc/nl/functions/ftp.xml:1.1 Tue Oct 10 15:07:53 2000 +++ phpdoc/nl/functions/ftp.xml Tue Nov 7 15:11:07 2000 @@ -227,7 +227,7 @@ <title>Description</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>ftp_rawlist</function></funcdef> + <funcdef>array <function>ftp_rawlist</function></funcdef> <paramdef>int <parameter>ftp_stream</parameter></paramdef> <paramdef>string <parameter>directory</parameter></paramdef> </funcprototype> Index: phpdoc/nl/functions/ibase.xml diff -u phpdoc/nl/functions/ibase.xml:1.1 phpdoc/nl/functions/ibase.xml:1.2 --- phpdoc/nl/functions/ibase.xml:1.1 Tue Oct 10 15:07:53 2000 +++ phpdoc/nl/functions/ibase.xml Tue Nov 7 15:11:07 2000 @@ -131,7 +131,7 @@ <title>Description</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>ibase_connect</function></funcdef> + <funcdef>int <function>ibase_pconnect</function></funcdef> <paramdef>string <parameter>database</parameter></paramdef> <paramdef>string <parameter><optional>username</optional></parameter> @@ -142,6 +142,12 @@ <paramdef>string <parameter><optional>charset</optional></parameter> </paramdef> + <paramdef>int + <parameter><optional>buffers</optional></parameter> + </paramdef> + <paramdef>int + <parameter><optional>dialect</optional></parameter> + </paramdef> <paramdef>string <parameter><optional>role</optional></parameter> </paramdef> @@ -160,6 +166,23 @@ by <function>ibase_pconnect</function>). This type of link is therefore called 'persistent'. </para> + <note> + <para> + <parameter>buffers</parameter> was added in PHP4-RC2. + </para> + </note> + <note> + <para> + <parameter>dialect</parameter> was added in PHP4-RC2. It is functional + only with InterBase 6 and versions higher than that. + </para> + </note> + <note> + <para> + <parameter>role</parameter> was added in PHP4-RC2. It is functional + only with InterBase 5 and versions higher than that. + </para> + </note> <para> See also <function>ibase_connect</function> for the meaning of parameters passed to this function. They are exactly the same. @@ -295,7 +318,31 @@ </para> </refsect1> </refentry> - + + <refentry id="function.ibase-field-info"> + <refnamediv> + <refname>ibase_field_info</refname> + <refpurpose> + Get information about a field + </refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcprototype> + <funcdef>array <function>ibase_field_info</function></funcdef> + <paramdef>int <parameter>result</parameter></paramdef> + <paramdef>int <parameter>field number</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + Returns an array with information about a field after a select + query has been run. The array is in the form of name, alias, + relation, length, type. + </para> + </refsect1> + </refentry> + <refentry id="function.ibase-free-result"> <refnamediv> <refname>ibase_free_result</refname> @@ -388,6 +435,78 @@ </refsect1> </refentry> + <refentry id="function.ibase-trans"> + <refnamediv> + <refname>ibase_trans</refname> + <refpurpose>Begin a transaction</refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcprototype> + <funcdef>int <function>ibase_trans</function></funcdef> + <paramdef>int + <parameter><optional>trans_args</optional></parameter> + </paramdef> + <paramdef>int + <parameter><optional>link_identifier</optional></parameter> + </paramdef> + </funcprototype> + </funcsynopsis> + <para> + Begins a transaction. + </para> + </refsect1> + </refentry> + + <refentry id="function.ibase-commit"> + <refnamediv> + <refname>ibase_commit</refname> + <refpurpose>Commit a transaction</refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcprototype> + <funcdef>int <function>ibase_commit</function></funcdef> + <paramdef>int + <parameter><optional>link_identifier</optional></parameter> + </paramdef> + <paramdef>int <parameter>trans_number</parameter> + </paramdef> + </funcprototype> + </funcsynopsis> + <para> + Commits transaction <parameter>trans_number</parameter> which was + created with <function>ibase_trans</function>. + </para> + </refsect1> + </refentry> + + <refentry id="function.ibase-rollback"> + <refnamediv> + <refname>ibase_rollback</refname> + <refpurpose>Rolls back a transaction</refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcprototype> + <funcdef>int <function>ibase_rollback</function></funcdef> + <paramdef>int + <parameter><optional>link_identifier</optional></parameter> + </paramdef> + <paramdef>int <parameter>trans_number</parameter> + </paramdef> + </funcprototype> + </funcsynopsis> + <para> + Rolls back transaction <parameter>trans_number</parameter> which was + created with <function>ibase_trans</function>. + </para> + </refsect1> + </refentry> + <refentry id="function.ibase-free-query"> <refnamediv> <refname>ibase_free_query</refname> @@ -517,6 +636,27 @@ in PHP 4. </para> </note> + </refsect1> + </refentry> + + <refentry id="function.ibase-errmsg"> + <refnamediv> + <refname>ibase_errmsg</refname> + <refpurpose> + Returns error messages + </refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcprototype> + <funcdef>string <function>ibase_errmsg</function></funcdef> + <paramdef>void <parameter></parameter></paramdef> + </funcprototype> + </funcsynopsis> + <simpara> + Returns a string containing an error message. + </simpara> </refsect1> </refentry> Index: phpdoc/nl/functions/ldap.xml diff -u phpdoc/nl/functions/ldap.xml:1.3 phpdoc/nl/functions/ldap.xml:1.4 --- phpdoc/nl/functions/ldap.xml:1.3 Fri Oct 27 10:27:55 2000 +++ phpdoc/nl/functions/ldap.xml Tue Nov 7 15:11:07 2000 @@ -424,6 +424,12 @@ already opened link will be returned. If only <parameter>hostname</parameter> is specified, then the port defaults to 389.</para> + <para> + If you are using OpenLDAP 2.x.x you can specify a URL instead of the + hostname. To use LDAP with SSL, compile OpenLDAP 2.x.x with SSL + support, configure PHP with SSL, and use ldaps://hostname/ as + host parameter. The port parameter is not used when using URLs. + URL and SSL support were added in 4.0.4.</para> </refsect1> </refentry> @@ -929,7 +935,7 @@ LDAP_OPT_MATCHED_DN. These are described in <ulink url="&url.ldap.openldap-c-api;">draft-ietf-ldapext-ldap-c-api-xx.txt</ulink> </para> - <para>This function is only available when using OpenLDAP 2.x.x, and was + <para>This function is only available when using OpenLDAP 2.x.x OR Netscape Directory SDK x.x, and was added in PHP 4.0.4</para> <para> @@ -1534,7 +1540,7 @@ LDAP_OPT_RESTART, LDAP_OPT_HOST_NAME, LDAP_OPT_ERROR_STRING, LDAP_OPT_MATCHED_DN. These are described in <ulink url="&url.ldap.openldap-c-api;">draft-ietf-ldapext-ldap-c-api-xx.txt</ulink></para> - <para>This function is only available when using OpenLDAP 2.x.x, and was + <para>This function is only available when using OpenLDAP 2.x.x OR Netscape Directory SDK x.x, and was added in PHP 4.0.4</para> <para> Index: phpdoc/nl/functions/misc.xml diff -u phpdoc/nl/functions/misc.xml:1.1 phpdoc/nl/functions/misc.xml:1.2 --- phpdoc/nl/functions/misc.xml:1.1 Tue Oct 10 15:07:53 2000 +++ phpdoc/nl/functions/misc.xml Tue Nov 7 15:11:07 2000 @@ -171,6 +171,16 @@ <para> Returns true if the named constant given by <parameter>name</parameter> has been defined, false otherwise. + <example> + <title>Checking Constants</title> + <programlisting role="php"> +<?php +if (defined("CONSTANT")){ // Note that it should be quoted + echo CONSTANT; // + } +?> + </programlisting> + </example> </para> <para> See also <function>define</function> and the section on <link @@ -414,7 +424,7 @@ <title>Description</title> <funcsynopsis> <funcprototype> - <funcdef>void <function>highlight_file</function></funcdef> + <funcdef>boolean <function>highlight_file</function></funcdef> <paramdef>string <parameter>filename</parameter></paramdef> </funcprototype> </funcsynopsis> @@ -422,6 +432,7 @@ The <function>highlight_file</function> function prints out a syntax higlighted version of the code contained in <parameter>filename</parameter> using the colors defined in the built-in syntax highlighter for PHP. + It returns true on success, false otherwise (PHP 4). </simpara> <para> <example> @@ -510,6 +521,7 @@ The <function>highlight_string</function> function prints out a syntax highlighted version of <parameter>str</parameter> using the colors defined in the built-in syntax highlighter for PHP. + It returns true on success, false otherwise (PHP 4). </simpara> <simpara> See also <function>highlight_file</function>, @@ -771,7 +783,7 @@ <title>Description</title> <funcsynopsis> <funcprototype> - <funcdef>void <function>show_source</function></funcdef> + <funcdef>boolean <function>show_source</function></funcdef> <paramdef>string <parameter>filename</parameter></paramdef> </funcprototype> </funcsynopsis> @@ -779,6 +791,7 @@ The <function>show_source</function> function prints out a syntax higlighted version of the code contained in <parameter>filename</parameter> using the colors defined in the built-in syntax highlighter for PHP. + It returns true on success, false otherwise (PHP 4). </simpara> <note> <simpara> Index: phpdoc/nl/functions/mysql.xml diff -u phpdoc/nl/functions/mysql.xml:1.1 phpdoc/nl/functions/mysql.xml:1.2 --- phpdoc/nl/functions/mysql.xml:1.1 Tue Oct 10 15:07:53 2000 +++ phpdoc/nl/functions/mysql.xml Tue Nov 7 15:11:07 2000 @@ -399,7 +399,7 @@ $db_list = mysql_list_dbs(); $i = 0; -$cnt = mysql_numrows($db_list); +$cnt = mysql_num_rows($db_list); while ($i < $cnt) { echo mysql_db_name($db_list, $i) . "\n"; $i++; @@ -1524,6 +1524,22 @@ a result set. This command is only valid for SELECT statements. To retrieve the number of rows returned from a INSERT, UPDATE or DELETE, use <function>mysql_affected_rows</function>. + <example> + <title> + <function> + mysql_num_rows example by crubel@trilizio.org + </function> + </title> + <programlisting role="php"> +<?php +$conn = mysql_connect("hostaddress", "username", "password"); +mysql_select_db("database",$conn); // needed if you have m,ultiple db's +$Resultfornummembers = mysql_query("SELECT * FROM Accounts",$conn); +$NumMembers = mysql_num_rows($Resultfornummembers); +echo "$NumMembers Members"; +?> + </programlisting> + </example> </para> <para> See also: Index: phpdoc/nl/functions/oci8.xml diff -u phpdoc/nl/functions/oci8.xml:1.2 phpdoc/nl/functions/oci8.xml:1.3 --- phpdoc/nl/functions/oci8.xml:1.2 Tue Oct 31 00:11:08 2000 +++ phpdoc/nl/functions/oci8.xml Tue Nov 7 15:11:07 2000 @@ -71,7 +71,7 @@ $result = OCIResult($stmt, $n); if (is_object ($result)) $result = $result->load(); -// For INSERT or UPDATE statetment use: +// For INSERT or UPDATE statement use: $sql = "insert into table (field1, field2) values (field1 = 'value', field2 = empty_clob()) returning field2 into :field2"; @@ -110,37 +110,6 @@ </example> </para> </partintro> - -<!-- -OCIBindByName -OCIDefineByName -OCIColumnIsNULL -OCIColumnName -OCIColumnSize -OCIColumnType -OCIExecute -OCIFetch -OCIFetchInto -OCIFetchStatement -OCIInternalDebug -OCILogoff -OCILogon -OCIPLogon -OCINLogon -OCIError -OCICommit -OCIRollback -OCINewCursor -OCINewDescriptor -OCIRowCount -OCINumCols -OCIParse -OCIResult -OCIServerVersion -OCIStatementType -OCIFreeStatement -OCIFreeCursor ---> <refentry id="function.ocidefinebyname"> <refnamediv> @@ -156,8 +125,9 @@ <funcdef>int <function>OCIDefineByName</function></funcdef> <paramdef>int <parameter>stmt</parameter></paramdef> <paramdef>string <parameter>Column-Name</parameter></paramdef> - <paramdef>mixed &<parameter>variable</parameter></paramdef> - <paramdef>int <parameter><optional>type</optional></parameter></paramdef> + <paramdef>mixed <parameter>variable</parameter></paramdef> + <paramdef>int <parameter><optional>type</optional></parameter> + </paramdef> </funcprototype> </funcsynopsis> <para> @@ -187,8 +157,8 @@ /* the define MUST be done BEFORE ociexecute! */ -OCIDefineByName($stmt,"EMPNO",&$empno); -OCIDefineByName($stmt,"ENAME",&$ename); +OCIDefineByName($stmt,"EMPNO",$empno); +OCIDefineByName($stmt,"ENAME",$ename); OCIExecute($stmt); @@ -208,7 +178,9 @@ <refentry id="function.ocibindbyname"> <refnamediv> <refname>OCIBindByName</refname> - <refpurpose>Bind a PHP variable to an Oracle Placeholder</refpurpose> + <refpurpose> + Bind a PHP variable to an Oracle Placeholder + </refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -218,8 +190,9 @@ <paramdef>int <parameter>stmt</parameter></paramdef> <paramdef>string <parameter>ph_name</parameter></paramdef> <paramdef>mixed &<parameter>variable</parameter></paramdef> - <paramdef>int<parameter>length</parameter></paramdef> - <paramdef>int <parameter><optional>type</optional></parameter></paramdef> + <paramdef>int <parameter>length</parameter></paramdef> + <paramdef>int <parameter> + <optional>type</optional></parameter></paramdef> </funcprototype> </funcsynopsis> <para> @@ -228,7 +201,7 @@ <parameter>ph_name</parameter>. Whether it will be used for input or output will be determined run-time, and the necessary storage space will be allocated. The - <parameter>length</parameter> paramter sets the maximum length + <parameter>length</parameter> parameter sets the maximum length for the bind. If you set <parameter>length</parameter> to -1 <function>OCIBindByName</function> will use the current length of <parameter>variable</parameter> to set the maximum length. @@ -249,7 +222,7 @@ <programlisting> <?php /* OCIBindByPos example thies@thieso.net (980221) - inserts 3 resords into emp, and uses the ROWID for updating the + inserts 3 records into emp, and uses the ROWID for updating the records just after the insert. */ @@ -299,6 +272,16 @@ ?> </programlisting> </example> + <warning> + <para> + It is a bad idea to use magic quotes and + <function>OciBindByName</function> simultaneously as no quoting + is needed on quoted variables and any quotes magically applied + will be written into your database as + <function>OciBindByName</function> is not able to distinguish + magically added quotings from those added by intention. + </para> + </warning> </refsect1> </refentry> @@ -314,7 +297,9 @@ <funcdef>int <function>OCILogon</function></funcdef> <paramdef>string <parameter>username</parameter></paramdef> <paramdef>string <parameter>password</parameter></paramdef> - <paramdef>string <parameter><optional>db</optional></parameter></paramdef> + <paramdef>string + <parameter><optional>db</optional></parameter> + </paramdef> </funcprototype> </funcsynopsis> <para> @@ -370,7 +355,7 @@ function commit($conn) { ocicommit($conn); - echo $conn." commited\n\n"; + echo $conn." committed\n\n"; } function rollback($conn) @@ -425,8 +410,8 @@ <refentry id="function.ociplogon"> <refnamediv> <refname>OCIPLogon</refname> - <refpurpose>Connect to an Oracle database and log on using a persistant connection. - Returns a new session.</refpurpose> + <refpurpose>Connect to an Oracle database and log on using a + persistant connection. Returns a new session.</refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -435,7 +420,9 @@ <funcdef>int <function>OCIPLogon</function></funcdef> <paramdef>string <parameter>username</parameter></paramdef> <paramdef>string <parameter>password</parameter></paramdef> - <paramdef>string <parameter><optional>db</optional></parameter></paramdef> + <paramdef>string + <parameter><optional>db</optional></parameter> + </paramdef> </funcprototype> </funcsynopsis> <para> @@ -449,14 +436,16 @@ </para> <simpara> See also <function>OCILogon</function> and - <function>OCINLogon</function>.</simpara> - </refsect1></refentry> + <function>OCINLogon</function>. + </simpara> + </refsect1> + </refentry> <refentry id="function.ocinlogon"> <refnamediv> <refname>OCINLogon</refname> - <refpurpose>Connect to an Oracle database and log on using a new connection. - Returns a new session.</refpurpose> + <refpurpose>Connect to an Oracle database and log on using a new + connection. Returns a new session.</refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -465,7 +454,9 @@ <funcdef>int <function>OCINLogon</function></funcdef> <paramdef>string <parameter>username</parameter></paramdef> <paramdef>string <parameter>password</parameter></paramdef> - <paramdef>string <parameter><optional>db</optional></parameter></paramdef> + <paramdef>string + <parameter><optional>db</optional></parameter> + </paramdef> </funcprototype> </funcsynopsis> <para> @@ -526,7 +517,7 @@ function commit($conn) { ocicommit($conn); - echo $conn." commited\n\n"; + echo $conn." committed\n\n"; } function rollback($conn) @@ -570,11 +561,14 @@ drop_table($c1); print "</PRE></HTML>"; -?></programlisting></example></para> +?></programlisting></example> + </para> <simpara> See also <function>OCILogon</function> and - <function>OCIPLogon</function>.</simpara> - </refsect1></refentry> + <function>OCIPLogon</function>. + </simpara> + </refsect1> + </refentry> <refentry id="function.ocilogoff"> <refnamediv> @@ -606,15 +600,18 @@ <funcprototype> <funcdef>int <function>OCIExecute</function></funcdef> <paramdef>int <parameter>statement</parameter></paramdef> - <paramdef>int <parameter><optional>mode</optional></parameter></paramdef> + <paramdef>int + <parameter><optional>mode</optional></parameter> + </paramdef> </funcprototype> </funcsynopsis> <para> - <function>OCIExecute</function> executes a previously parsed statement. - (see <function>OCIParse</function>). The optional <parameter>mode</parameter> - allows you to specify the execution-mode (default is OCI_COMMIT_ON_SUCCESS). - If you don't want statements to be commited automaticly specify OCI_DEFAULT as - your mode. + <function>OCIExecute</function> executes a previously parsed + statement. (see <function>OCIParse</function>. The optional + <parameter>mode</parameter> allows you to specify the + execution-mode (default is OCI_COMMIT_ON_SUCCESS). If you don't + want statements to be committed automaticly specify OCI_DEFAULT as + your mode. </para> </refsect1> </refentry> @@ -633,8 +630,8 @@ </funcprototype> </funcsynopsis> <para> - <function>OCICommit</function> commits all outstanding statements for - Oracle connection <parameter>connection</parameter>. + <function>OCICommit</function> commits all outstanding statements + for Oracle connection <parameter>connection</parameter>. </para> </refsect1> </refentry> @@ -653,8 +650,8 @@ </funcprototype> </funcsynopsis> <para> - <function>OCIRollback</function> rolls back all outstanding statements for - Oracle connection <parameter>connection</parameter>. + <function>OCIRollback</function> rolls back all outstanding + statements for Oracle connection <parameter>connection</parameter>. </para> </refsect1> </refentry> @@ -662,7 +659,9 @@ <refentry id="function.ocinewdescriptor"> <refnamediv> <refname>OCINewDescriptor</refname> - <refpurpose>Initialize a new empty descriptor LOB/FILE (LOB is default)</refpurpose> + <refpurpose> + Initialize a new empty descriptor LOB/FILE (LOB is default) + </refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -670,16 +669,18 @@ <funcprototype> <funcdef>string <function>OCINewDescriptor</function></funcdef> <paramdef>int <parameter>connection</parameter></paramdef> - <paramdef>int <parameter><optional>type</optional></parameter></paramdef> + <paramdef>int + <parameter><optional>type</optional></parameter> + </paramdef> </funcprototype> </funcsynopsis> <para> <function>OCINewDescriptor</function> Allocates storage to hold descriptors or LOB locators. Valid values for the valid <parameter>type</parameter> are OCI_D_FILE, OCI_D_LOB, OCI_D_ROWID. - For LOB desriptors, the methods load, save, and savefile are - associated with the descriptor, for BFILE only the load method exists. - See the second example usage hints. + For LOB descriptors, the methods load, save, and savefile are + associated with the descriptor, for BFILE only the load method + exists. See the second example usage hints. </para> <example> <title>OCINewDescriptor</title> @@ -766,7 +767,7 @@ </funcsynopsis> <para> <function>OCIRowCount</function> returns the number of rows affected - for eg update-statements. This funtions will not tell you the number + for eg update-statements. This function will not tell you the number of rows that a select will return!</para> <para> <example> @@ -789,15 +790,17 @@ OCIFreeStatement($stmt); OCILogOff($conn); print "</PRE></HTML>"; -?> </programlisting></example></para> - +?> </programlisting></example> + </para> </refsect1> </refentry> <refentry id="function.ocinumcols"> <refnamediv> <refname>OCINumCols</refname> - <refpurpose>Return the number of result columns in a statement</refpurpose> + <refpurpose> + Return the number of result columns in a statement + </refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -842,7 +845,7 @@ <refentry id="function.ociresult"> <refnamediv> <refname>OCIResult</refname> - <refpurpose>Returns coulumn value for fetched row</refpurpose> + <refpurpose>Returns column value for fetched row</refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -857,7 +860,8 @@ <function>OCIResult</function> returns the data for column <parameter>column</parameter> in the current row (see <function>OCIFetch</function>).<function>OCIResult</function> will - return everything as strings except for abstract types (ROWIDs, LOBs and FILEs). + return everything as strings except for abstract types (ROWIDs, + LOBs and FILEs). </para> </refsect1> </refentry> @@ -876,8 +880,8 @@ </funcprototype> </funcsynopsis> <para> - <function>OCIFetch</function> fetches the next row (for SELECT statements) - into the internal result-buffer. + <function>OCIFetch</function> fetches the next row (for SELECT + statements) into the internal result-buffer. </para> </refsect1> </refentry> @@ -894,31 +898,40 @@ <funcdef>int <function>OCIFetchInto</function></funcdef> <paramdef>int <parameter>stmt</parameter></paramdef> <paramdef>array &<parameter>result</parameter></paramdef> - <paramdef>int <parameter><optional>mode</optional></parameter></paramdef> + <paramdef>int + <parameter><optional>mode</optional></parameter> + </paramdef> </funcprototype> </funcsynopsis> <para> - <function>OCIFetchInto</function> fetches the next row (for SELECT statements) - into the <parameter>result</parameter> array. <function>OCIFetchInto</function> - will overwrite the previous content of <parameter>result</parameter>. By default - <parameter>result</parameter> will contain a one-based array of all columns - that are not NULL. + <function>OCIFetchInto</function> fetches the next row (for SELECT + statements) into the <parameter>result</parameter> array. + <function>OCIFetchInto</function> will overwrite the previous + content of <parameter>result</parameter>. By default + <parameter>result</parameter> will contain a one-based array of all + columns that are not NULL. </para> <para> - The <parameter>mode</parameter> parameter allows you to change the default - behaviour. You can specify more than one flag by simply addig them up - (eg OCI_ASSOC+OCI_RETURN_NULLS). The known flags are: - + The <parameter>mode</parameter> parameter allows you to change the + default behaviour. You can specify more than one flag by simply + adding them up (eg OCI_ASSOC+OCI_RETURN_NULLS). The known flags + are: <simplelist> - <member><literal>OCI_ASSOC</literal> Return an associative array.</member> - <member><literal>OCI_NUM</literal> Return an numbered array - starting with one. (DEFAULT)</member> - <member><literal>OCI_RETURN_NULLS</literal> Return empty columns.</member> - <member><literal>OCI_RETURN_LOBS</literal> Return the value of a LOB instead of the desxriptor.</member> + <member> + <literal>OCI_ASSOC</literal> Return an associative array. + </member> + <member> + <literal>OCI_NUM</literal> Return an numbered array starting with + one. (DEFAULT) + </member> + <member> + <literal>OCI_RETURN_NULLS</literal> Return empty columns. + </member> + <member> + <literal>OCI_RETURN_LOBS</literal> Return the value of a LOB + instead of the descriptor. + </member> </simplelist> - - </para> - <para> </para> </refsect1> </refentry> @@ -939,8 +952,9 @@ </funcsynopsis> <para> <function>OCIFetchStatement</function> fetches all the rows from a - result into a user-defined array. <function>OCIFetchStatement</function> - returns the number of rows fetched. + result into a user-defined array. + <function>OCIFetchStatement</function> returns the number of rows + fetched. </para> <example> <title>OCIFetchStatement</title> @@ -980,11 +994,12 @@ OCIFreeStatement($stmt); OCILogoff($conn); - -?></programlisting></example> - +?> + </programlisting> + </example> </refsect1> </refentry> + <refentry id="function.ocicolumnisnull"> <refnamediv> <refname>OCIColumnIsNULL</refname> @@ -1003,12 +1018,71 @@ <function>OCIColumnIsNULL</function> returns true if the returned column <parameter>column</parameter> in the result from the statement <parameter>stmt</parameter> is NULL. You can either use - the column-number (1-Based) or the column-name for the <parameter>col</parameter> - parameter. + the column-number (1-Based) or the column-name for the + <parameter>col</parameter> parameter. </para> </refsect1> </refentry> + <refentry id="function.ocicolumnname"> + <refnamediv> + <refname>OCIColumnName</refname> + <refpurpose>Returns the name of a column.</refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcprototype> + <funcdef>string <function>OCIColumnName</function></funcdef> + <paramdef>int <parameter>stmt</parameter></paramdef> + <paramdef>int <parameter>col</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <simpara> + <function>OCIColumnName</function> returns the name of the column + corresponding to the column number (1-based) that is passed in. + </simpara> + <para> + <example> + <title>OCIColumnName</title> + <programlisting> +<?php + print "<HTML><PRE>\n"; + $conn = OCILogon("scott", "tiger"); + $stmt = OCIParse($conn,"select * from emp"); + OCIExecute($stmt); + print "<TABLE BORDER=\"1\">"; + print "<TR>"; + print "<TH>Name</TH>"; + print "<TH>Type</TH>"; + print "<TH>Length</TH>"; + print "</TR>"; + $ncols = OCINumCols($stmt); + for ( $i = 1; $i <= $ncols; $i++ ) { + $column_name = OCIColumnName($stmt,$i); + $column_type = OCIColumnType($stmt,$i); + $column_size = OCIColumnSize($stmt,$i); + print "<TR>"; + print "<TD>$column_name</TD>"; + print "<TD>$column_type</TD>"; + print "<TD>$column_size</TD>"; + print "</TR>"; + } + OCIFreeStatement($stmt); + OCILogoff($conn); + print "</PRE>"; + print "</HTML>\n"; +?> + </programlisting> + </example> + </para> + <simpara> + See also <function>OCINumCols</function>, + <function>OCIColumnType</function>, + and <function>OCIColumnSize</function>. + </simpara> + </refsect1> + </refentry> <refentry id="function.ocicolumnsize"> <refnamediv> @@ -1027,8 +1101,8 @@ <para> <function>OCIColumnSize</function> returns the size of the column as given by Oracle. You can either use - the column-number (1-Based) or the column-name for the <parameter>col</parameter> - parameter. + the column-number (1-Based) or the column-name for the + <parameter>col</parameter> parameter. </para> <para> <example> @@ -1065,16 +1139,80 @@ </programlisting> </example> </para> + <simpara> + See also <function>OCINumCols</function>, + <function>OCIColumnName</function>, and + <function>OCIColumnSize</function>. + </simpara> + </refsect1> + </refentry> + + <refentry id="function.ocicolumntype"> + <refnamediv> + <refname>OCIColumnType</refname> + <refpurpose>Returns the data type of a column.</refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcprototype> + <funcdef>mixed <function>OCIColumnType</function></funcdef> + <paramdef>int <parameter>stmt</parameter></paramdef> + <paramdef>int <parameter>col</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <simpara> + <function>OCIColumnType</function> returns the data type of the + column corresponding to the column number (1-based) that is passed + in. + </simpara> + <para> + <example> + <title>OCIColumnType</title> + <programlisting> +<?php + print "<HTML><PRE>\n"; + $conn = OCILogon("scott", "tiger"); + $stmt = OCIParse($conn,"select * from emp"); + OCIExecute($stmt); + print "<TABLE BORDER=\"1\">"; + print "<TR>"; + print "<TH>Name</TH>"; + print "<TH>Type</TH>"; + print "<TH>Length</TH>"; + print "</TR>"; + $ncols = OCINumCols($stmt); + for ( $i = 1; $i <= $ncols; $i++ ) { + $column_name = OCIColumnName($stmt,$i); + $column_type = OCIColumnType($stmt,$i); + $column_size = OCIColumnSize($stmt,$i); + print "<TR>"; + print "<TD>$column_name</TD>"; + print "<TD>$column_type</TD>"; + print "<TD>$column_size</TD>"; + print "</TR>"; + } + OCIFreeStatement($stmt); + OCILogoff($conn); + print "</PRE>"; + print "</HTML>\n"; +?> + </programlisting> + </example> + </para> <simpara> - See also <function>OCINumCols</function>, <function>OCIColumnName</function>, - and <function>OCIColumnSize</function>.</simpara> + See also <function>OCINumCols</function>, + <function>OCIColumnName</function>, + and <function>OCIColumnSize</function>. + </simpara> </refsect1> </refentry> <refentry id="function.ociserverversion"> <refnamediv> <refname>OCIServerVersion</refname> - <refpurpose>Return a string containing server version information.</refpurpose> + <refpurpose>Return a string containing server version + information.</refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -1092,8 +1230,10 @@ $conn = OCILogon("scott","tiger"); print "Server Version: " . OCIServerVersion($conn); OCILogOff($conn); -?></programlisting></example></para> - +?> + </programlisting> + </example> + </para> </refsect1> </refentry> @@ -1111,7 +1251,8 @@ </funcprototype> </funcsynopsis> <para> - <function>OCIStatementType</function> returns on of the following values: + <function>OCIStatementType</function> returns one of the following + values: <orderedlist> <listitem><simpara> "SELECT"</simpara></listitem> <listitem><simpara> "UPDATE"</simpara></listitem> @@ -1141,15 +1282,18 @@ OCILogoff($conn); print "</PRE></HTML>"; ?> -</programlisting></example></para> - + </programlisting> + </example> + </para> </refsect1> </refentry> <refentry id="function.ocinewcursor"> <refnamediv> <refname>OCINewCursor</refname> - <refpurpose>return a new cursor (Statement-Handle) - use this to bind ref-cursors!</refpurpose> + <refpurpose> + Return a new cursor (Statement-Handle) - use to bind ref-cursors. + </refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -1160,8 +1304,8 @@ </funcprototype> </funcsynopsis> <para> - <function>OCINewCursor</function> allocates a new statement handle on the specified - connection. + <function>OCINewCursor</function> allocates a new statement handle + on the specified connection. </para> <para> <example> @@ -1235,7 +1379,9 @@ <refentry id="function.ocifreestatement"> <refnamediv> <refname>OCIFreeStatement</refname> - <refpurpose>Free all resources associated with a statement.</refpurpose> + <refpurpose> + Free all resources associated with a statement. + </refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -1246,8 +1392,8 @@ </funcprototype> </funcsynopsis> <para> - <function>OCIFreeStatement</function> returns true if successful, or false if - unsuccessful. + <function>OCIFreeStatement</function> returns true if successful, + or false if unsuccessful. </para> </refsect1> </refentry> @@ -1255,7 +1401,9 @@ <refentry id="function.ocifreecursor"> <refnamediv> <refname>OCIFreeCursor</refname> - <refpurpose>Free all resources associated with a cursor.</refpurpose> + <refpurpose> + Free all resources associated with a cursor. + </refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -1266,8 +1414,8 @@ </funcprototype> </funcsynopsis> <para> - <function>OCIFreeCursor</function> returns true if successful, or false if - unsuccessful. + <function>OCIFreeCursor</function> returns true if successful, or + false if unsuccessful. </para> </refsect1> </refentry> @@ -1285,129 +1433,13 @@ <paramdef>object <parameter>lob</parameter></paramdef> </funcprototype> </funcsynopsis> - <para> - <function>OCIFreeDesc</function> returns true if successful, or false if - unsuccessful. - </para> - </refsect1> - </refentry> - - <refentry id="function.ocicolumnname"> - <refnamediv> - <refname>OCIColumnName</refname> - <refpurpose>Returns the name of a column.</refpurpose> - </refnamediv> - <refsect1> - <title>Description</title> - <funcsynopsis> - <funcprototype> - <funcdef>string <function>OCIColumnName</function></funcdef> - <paramdef>int <parameter>stmt</parameter></paramdef> - <paramdef>int <parameter>col</parameter></paramdef> - </funcprototype> - </funcsynopsis> - <simpara> - <function>OCIColumnName</function> returns the name of the column - corresponding to the column number (1-based) that is passed in.</simpara> - - <para> - <example> - <title>OCIColumnName</title> - <programlisting> -<?php - print "<HTML><PRE>\n"; - $conn = OCILogon("scott", "tiger"); - $stmt = OCIParse($conn,"select * from emp"); - OCIExecute($stmt); - print "<TABLE BORDER=\"1\">"; - print "<TR>"; - print "<TH>Name</TH>"; - print "<TH>Type</TH>"; - print "<TH>Length</TH>"; - print "</TR>"; - $ncols = OCINumCols($stmt); - for ( $i = 1; $i <= $ncols; $i++ ) { - $column_name = OCIColumnName($stmt,$i); - $column_type = OCIColumnType($stmt,$i); - $column_size = OCIColumnSize($stmt,$i); - print "<TR>"; - print "<TD>$column_name</TD>"; - print "<TD>$column_type</TD>"; - print "<TD>$column_size</TD>"; - print "</TR>"; - } - OCIFreeStatement($stmt); - OCILogoff($conn); - print "</PRE>"; - print "</HTML>\n"; -?> - </programlisting> - </example> - </para> - <simpara> - See also <function>OCINumCols</function>, <function>OCIColumnType</function>, - and <function>OCIColumnSize</function>.</simpara> - </refsect1> - </refentry> - - <refentry id="function.ocicolumntype"> - <refnamediv> - <refname>OCIColumnType</refname> - <refpurpose>Returns the data type of a column.</refpurpose> - </refnamediv> - <refsect1> - <title>Description</title> - <funcsynopsis> - <funcprototype> - <funcdef>mixed <function>OCIColumnType</function></funcdef> - <paramdef>int <parameter>stmt</parameter></paramdef> - <paramdef>int <parameter>col</parameter></paramdef> - </funcprototype> - </funcsynopsis> - <simpara> - <function>OCIColumnType</function> returns the data type of the column - corresponding to the column number (1-based) that is passed in.</simpara> - <para> - <example> - <title>OCIColumnType</title> - <programlisting> -<?php - print "<HTML><PRE>\n"; - $conn = OCILogon("scott", "tiger"); - $stmt = OCIParse($conn,"select * from emp"); - OCIExecute($stmt); - print "<TABLE BORDER=\"1\">"; - print "<TR>"; - print "<TH>Name</TH>"; - print "<TH>Type</TH>"; - print "<TH>Length</TH>"; - print "</TR>"; - $ncols = OCINumCols($stmt); - for ( $i = 1; $i <= $ncols; $i++ ) { - $column_name = OCIColumnName($stmt,$i); - $column_type = OCIColumnType($stmt,$i); - $column_size = OCIColumnSize($stmt,$i); - print "<TR>"; - print "<TD>$column_name</TD>"; - print "<TD>$column_type</TD>"; - print "<TD>$column_size</TD>"; - print "</TR>"; - } - OCIFreeStatement($stmt); - OCILogoff($conn); - print "</PRE>"; - print "</HTML>\n"; -?> - </programlisting> - </example> + <function>OCIFreeDesc</function> returns true if successful, or + false if unsuccessful. </para> - <simpara> - See also <function>OCINumCols</function>, <function>OCIColumnName</function>, - and <function>OCIColumnSize</function>.</simpara> - </refsect1> </refentry> + <refentry id="function.ociparse"> <refnamediv> <refname>OCIParse</refname> @@ -1423,10 +1455,11 @@ </funcprototype> </funcsynopsis> <simpara> - <function>OCIParse</function> parses the <parameter>query</parameter> - using <parameter>conn</parameter>. It returns the statement - identity if the query is valid, false if not. The - <parameter>query</parameter> can be any valid SQL statement. + <function>OCIParse</function> parses the + <parameter>query</parameter> using <parameter>conn</parameter>. + It returns the statement identity if the query is valid, false if + not. The <parameter>query</parameter> can be any valid SQL + statement. </simpara> </refsect1> </refentry> @@ -1477,8 +1510,10 @@ </funcprototype> </funcsynopsis> <simpara> - <function>OCIInternalDebug</function> enables internal debug output. Set <parameter>onoff</parameter> - to 0 to turn debug output off, 1 to turn it on.</simpara> + <function>OCIInternalDebug</function> enables internal debug + output. Set <parameter>onoff</parameter> to 0 to turn debug + output off, 1 to turn it on. + </simpara> </refsect1> </refentry> </reference> Index: phpdoc/nl/functions/sockets.xml diff -u phpdoc/nl/functions/sockets.xml:1.1 phpdoc/nl/functions/sockets.xml:1.2 --- phpdoc/nl/functions/sockets.xml:1.1 Tue Oct 10 15:07:53 2000 +++ phpdoc/nl/functions/sockets.xml Tue Nov 7 15:11:07 2000 @@ -397,6 +397,42 @@ </refsect1> </refentry> + <refentry id="function.read"> + <refnamediv> + <refname>read</refname> + <refpurpose>Read from a socket</refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcprototype> + <funcdef>int <function>read</function></funcdef> + <paramdef>int <parameter>socket_des</parameter></paramdef> + <paramdef>string <parameter>&buffer</parameter></paramdef> + <paramdef>int <parameter>length</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + The function <function>read</function> reads from socket + <parameter>socket_des</parameter>created by the + <function>accept_connect</function> function into + <parameter>&buffer</parameter> the number of bytes set by + <parameter>length</parameter>. Otherwise you can use \n, \t or \0 to + end reading. Returns number of bytes that have been read. + </para> + <para> + See also + <function>accept_connect</function>, + <function>bind</function>, + <function>connect</function>, + <function>listen</function>, + <function>strerror</function>, + <function>socket_get_status</function>. and + <function>write</function>. + </para> + </refsect1> + </refentry> + <refentry id="function.socket"> <refnamediv> <refname>socket</refname> @@ -508,6 +544,40 @@ <function>connect</function>, <function>listen</function>, <function>socket</function>, and + <function>socket_get_status</function>. + </para> + </refsect1> + </refentry> + + <refentry id="function.write"> + <refnamediv> + <refname>write</refname> + <refpurpose>Write to a socket</refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcprototype> + <funcdef>int <function>write</function></funcdef> + <paramdef>int <parameter>socket_des</parameter></paramdef> + <paramdef>string <parameter>&buffer</parameter></paramdef> + <paramdef>int <parameter>length</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + The function <function>write</function> writes to the socket + <parameter>socket_des</parameter> from + <parameter>&buffer</parameter> the number of bytes set by + <parameter>length</parameter>. + </para> + <para> + See also + <function>accept_connect</function>, + <function>bind</function>, + <function>connect</function>, + <function>listen</function>, + <function>read</function>, + <function>strerror</function>, and <function>socket_get_status</function>. </para> </refsect1> Index: phpdoc/nl/functions/swf.xml diff -u phpdoc/nl/functions/swf.xml:1.1 phpdoc/nl/functions/swf.xml:1.2 --- phpdoc/nl/functions/swf.xml:1.1 Tue Oct 10 15:07:53 2000 +++ phpdoc/nl/functions/swf.xml Tue Nov 7 15:11:07 2000 @@ -68,7 +68,7 @@ swf_enddoaction (); swf_closefile (); -?> +?> </programlisting> </example> It will produce the animation found at the following <ulink @@ -78,6 +78,11 @@ <para> SWF support was added in PHP 4 RC2. </para> + <para> + The libswf does not have support for Windows. The development of + that library has been stopped, and the source is not available + to port it to another systems. + </para> </note> </partintro> @@ -231,7 +236,7 @@ @mysql_free_result ($sth); @mysql_close ($dbh); } -?> +> </programlisting> </example> </para> @@ -1510,12 +1515,12 @@ <itemizedlist> <listitem> <simpara> - Aheight - The height in pixels of a capital A. + Aheight - The height in pixels of a capital A. </simpara> </listitem> <listitem> <simpara> - xheight - The height in pixels of a lowercase x. + xheight - The height in pixels of a lowercase x. </simpara> </listitem> </itemizedlist> @@ -1634,17 +1639,17 @@ <itemizedlist> <listitem> <simpara> - "size" - The size in bytes of the bitmap. + "size" - The size in bytes of the bitmap. </simpara> </listitem> <listitem> <simpara> - "width" - The width in pixels of the bitmap. + "width" - The width in pixels of the bitmap. </simpara> </listitem> <listitem> <simpara> - "height" - The height in pixels of the bitmap. + "height" - The height in pixels of the bitmap. </simpara> </listitem> </itemizedlist> @@ -1812,42 +1817,42 @@ <itemizedlist> <listitem> <simpara> - IdletoOverUp + IdletoOverUp </simpara> </listitem> <listitem> <simpara> - OverUptoIdle + OverUptoIdle </simpara> </listitem> <listitem> <simpara> - OverUptoOverDown + OverUptoOverDown </simpara> </listitem> <listitem> <simpara> - OverDowntoOverUp + OverDowntoOverUp </simpara> </listitem> <listitem> <simpara> - IdletoOverDown + IdletoOverDown </simpara> </listitem> <listitem> <simpara> - OutDowntoIdle + OutDowntoIdle </simpara> </listitem> <listitem> <simpara> - MenuEnter (IdletoOverUp|IdletoOverDown) + MenuEnter (IdletoOverUp|IdletoOverDown) </simpara> </listitem> <listitem> <simpara> - MenuExit (OverUptoIdle|OverDowntoIdle) + MenuExit (OverUptoIdle|OverDowntoIdle) </simpara> </listitem> </itemizedlist> @@ -1855,47 +1860,47 @@ <itemizedlist> <listitem> <simpara> - IdletoOverUp + IdletoOverUp </simpara> </listitem> <listitem> <simpara> - OverUptoIdle + OverUptoIdle </simpara> </listitem> <listitem> <simpara> - OverUptoOverDown + OverUptoOverDown </simpara> </listitem> <listitem> <simpara> - OverDowntoOverUp + OverDowntoOverUp </simpara> </listitem> <listitem> <simpara> - OverDowntoOutDown + OverDowntoOutDown </simpara> </listitem> <listitem> <simpara> - OutDowntoOverDown + OutDowntoOverDown </simpara> </listitem> <listitem> <simpara> - OutDowntoIdle + OutDowntoIdle </simpara> </listitem> <listitem> <simpara> - ButtonEnter (IdletoOverUp|OutDowntoOverDown) + ButtonEnter (IdletoOverUp|OutDowntoOverDown) </simpara> </listitem> <listitem> <simpara> - ButtonExit (OverUptoIdle|OverDowntoOutDown) + ButtonExit (OverUptoIdle|OverDowntoOutDown) </simpara> </listitem> </itemizedlist> Index: phpdoc/nl/functions/var.xml diff -u phpdoc/nl/functions/var.xml:1.1 phpdoc/nl/functions/var.xml:1.2 --- phpdoc/nl/functions/var.xml:1.1 Tue Oct 10 15:07:54 2000 +++ phpdoc/nl/functions/var.xml Tue Nov 7 15:11:07 2000 @@ -124,12 +124,17 @@ <simpara>"resource"</simpara> </listitem> <listitem> - <simpara>"user function"</simpara> + <simpara>"user function" (PHP 3 only, deprecated)</simpara> </listitem> <listitem> <simpara>"unknown type"</simpara> </listitem> </itemizedlist> + </para> + <para> + For PHP 4, you should use <function>function_exists</function> and + <function>method_exists</function> to replace the prior usage of + <function>gettype</function> on a function. </para> <para> See also <function>settype</function>. Index: phpdoc/nl/functions/xml.xml diff -u phpdoc/nl/functions/xml.xml:1.1 phpdoc/nl/functions/xml.xml:1.2 --- phpdoc/nl/functions/xml.xml:1.1 Tue Oct 10 15:07:54 2000 +++ phpdoc/nl/functions/xml.xml Tue Nov 7 15:11:07 2000 @@ -24,8 +24,8 @@ default, you can use this make rule for that: <programlisting role="makefile"> libexpat.a: $(OBJS) - ar -rc $@ $(OBJS) - ranlib $@ + ar -rc $@ $(OBJS) + ranlib $@ </programlisting> A source RPM package of expat can be found at <ulink url="&url.expat.rpm;">&url.expat.rpm;</ulink>. @@ -77,84 +77,84 @@ <table> <title>Supported XML handlers</title> <tgroup cols="2"> - <thead> - <row> - <entry>PHP function to set handler</entry> - <entry>Event description</entry> - </row> - </thead> - <tbody> - <row> - <entry><function>xml_set_element_handler</function></entry> - <entry> - Element events are issued whenever the XML parser - encounters start or end tags. There are separate handlers - for start tags and end tags. - </entry> - </row> - <row> - <entry> - <function>xml_set_character_data_handler</function> - </entry> - <entry> - Character data is roughly all the non-markup contents of - XML documents, including whitespace between tags. Note - that the XML parser does not add or remove any whitespace, - it is up to the application (you) to decide whether - whitespace is significant. - </entry> - </row> - <row> - <entry> - <function>xml_set_processing_instruction_handler</function> - </entry> - <entry> - PHP programmers should be familiar with processing - instructions (PIs) already. <?php ?> is a processing - instruction, where <replaceable>php</replaceable> is called - the "PI target". The handling of these are - application-specific, except that all PI targets starting - with "XML" are reserved. - </entry> - </row> - <row> - <entry><function>xml_set_default_handler</function></entry> - <entry> - What goes not to another handler goes to the default - handler. You will get things like the XML and document - type declarations in the default handler. - </entry> - </row> - <row> - <entry> - <function>xml_set_unparsed_entity_decl_handler</function> - </entry> - <entry> - This handler will be called for declaration of an unparsed - (NDATA) entity. - </entry> - </row> - <row> - <entry> - <function>xml_set_notation_decl_handler</function> - </entry> - <entry> - This handler is called for declaration of a notation. - </entry> - </row> - <row> - <entry> - <function>xml_set_external_entity_ref_handler</function> - </entry> - <entry> - This handler is called when the XML parser finds a - reference to an external parsed general entity. This can - be a reference to a file or URL, for example. See <link - linkend="example.xml-external-entity">the external entity - example</link> for a demonstration. - </entry> - </row> - </tbody> + <thead> + <row> + <entry>PHP function to set handler</entry> + <entry>Event description</entry> + </row> + </thead> + <tbody> + <row> + <entry><function>xml_set_element_handler</function></entry> + <entry> + Element events are issued whenever the XML parser + encounters start or end tags. There are separate handlers + for start tags and end tags. + </entry> + </row> + <row> + <entry> + <function>xml_set_character_data_handler</function> + </entry> + <entry> + Character data is roughly all the non-markup contents of + XML documents, including whitespace between tags. Note + that the XML parser does not add or remove any whitespace, + it is up to the application (you) to decide whether + whitespace is significant. + </entry> + </row> + <row> + <entry> + <function>xml_set_processing_instruction_handler</function> + </entry> + <entry> + PHP programmers should be familiar with processing + instructions (PIs) already. <?php ?> is a processing + instruction, where <replaceable>php</replaceable> is called + the "PI target". The handling of these are + application-specific, except that all PI targets starting + with "XML" are reserved. + </entry> + </row> + <row> + <entry><function>xml_set_default_handler</function></entry> + <entry> + What goes not to another handler goes to the default + handler. You will get things like the XML and document + type declarations in the default handler. + </entry> + </row> + <row> + <entry> + <function>xml_set_unparsed_entity_decl_handler</function> + </entry> + <entry> + This handler will be called for declaration of an unparsed + (NDATA) entity. + </entry> + </row> + <row> + <entry> + <function>xml_set_notation_decl_handler</function> + </entry> + <entry> + This handler is called for declaration of a notation. + </entry> + </row> + <row> + <entry> + <function>xml_set_external_entity_ref_handler</function> + </entry> + <entry> + This handler is called when the XML parser finds a + reference to an external parsed general entity. This can + be a reference to a file or URL, for example. See <link + linkend="example.xml-external-entity">the external entity + example</link> for a demonstration. + </entry> + </row> + </tbody> </tgroup> </table> </para> @@ -313,29 +313,29 @@ <example> <title>Map XML to HTML</title> <para> - This example maps tags in an XML document directly to HTML - tags. Elements not found in the "map array" are ignored. Of - course, this example will only work with a specific XML - document type. - <programlisting role="php"> + This example maps tags in an XML document directly to HTML + tags. Elements not found in the "map array" are ignored. Of + course, this example will only work with a specific XML + document type. + <programlisting role="php"> $file = "data.xml"; $map_array = array( - "BOLD" => "B", - "EMPHASIS" => "I", - "LITERAL" => "TT" + "BOLD" => "B", + "EMPHASIS" => "I", + "LITERAL" => "TT" ); function startElement($parser, $name, $attrs) { global $map_array; if ($htmltag = $map_array[$name]) { - print "<$htmltag>"; + print "<$htmltag>"; } } function endElement($parser, $name) { global $map_array; if ($htmltag = $map_array[$name]) { - print "</$htmltag>"; + print "</$htmltag>"; } } @@ -360,7 +360,7 @@ } } xml_parser_free($xml_parser); - </programlisting> + </programlisting> </para> </example> </para> @@ -501,7 +501,7 @@ print "parse complete\n"; xml_parser_free($xml_parser); -?> +?> </programlisting> </example> </para> @@ -509,33 +509,33 @@ <example> <title>xmltest.xml</title> <programlisting role="xml"> -<?xml version='1.0'?> +<?xml version='1.0'?> <!DOCTYPE chapter SYSTEM "/just/a/test.dtd" [ -<!ENTITY plainEntity "FOO entity"> -<!ENTITY systemEntity SYSTEM "xmltest2.xml"> -]> -<chapter> - <TITLE>Title &plainEntity;</TITLE> - <para> - <informaltable> - <tgroup cols="3"> - <tbody> - <row><entry>a1</entry><entry morerows="1">b1</entry><entry>c1</entry></row> - <row><entry>a2</entry><entry>c2</entry></row> - <row><entry>a3</entry><entry>b3</entry><entry>c3</entry></row> - </tbody> - </tgroup> - </informaltable> - </para> +<!ENTITY plainEntity "FOO entity"> +<!ENTITY systemEntity SYSTEM "xmltest2.xml"> +]> +<chapter> + <TITLE>Title &plainEntity;</TITLE> + <para> + <informaltable> + <tgroup cols="3"> + <tbody> + <row><entry>a1</entry><entry morerows="1">b1</entry><entry>c1</entry></row> + <row><entry>a2</entry><entry>c2</entry></row> + <row><entry>a3</entry><entry>b3</entry><entry>c3</entry></row> + </tbody> + </tgroup> + </informaltable> + </para> &systemEntity; - <sect1 id="about"> - <title>About this Document</title> - <para> - <!-- this is a comment --> - <?php print 'Hi! This is PHP version '.phpversion(); ?> - </para> - </sect1> -</chapter> + <sect1 id="about"> + <title>About this Document</title> + <para> + <!-- this is a comment --> + <?php print 'Hi! This is PHP version '.phpversion(); ?> + </para> + </sect1> +</chapter> </programlisting> </example> </para> @@ -544,15 +544,15 @@ <example> <title>xmltest2.xml</title> <programlisting role="xml"> -<?xml version="1.0"?> +<?xml version="1.0"?> <!DOCTYPE foo [ -<!ENTITY testEnt "test entity"> -]> -<foo> - <element attrib="value"/> +<!ENTITY testEnt "test entity"> +]> +<foo> + <element attrib="value"/> &testEnt; - <?php print "This is some more PHP code being executed."; ?> -</foo> + <?php print "This is some more PHP code being executed."; ?> +</foo> </programlisting> </example> </para> @@ -580,15 +580,15 @@ <varlistentry> <term><parameter>encoding</parameter> (optional)</term> <listitem> - <para> - Which character encoding the parser should use. The - following character encodings are supported: - <simplelist> - <member><literal>ISO-8859-1</literal> (default)</member> - <member><literal>US-ASCII</literal></member> - <member><literal>UTF-8</literal></member> - </simplelist> - </para> + <para> + Which character encoding the parser should use. The + following character encodings are supported: + <simplelist> + <member><literal>ISO-8859-1</literal> (default)</member> + <member><literal>US-ASCII</literal></member> + <member><literal>UTF-8</literal></member> + </simplelist> + </para> </listitem> </varlistentry> </variablelist> @@ -625,14 +625,14 @@ var $parser; function xml() { - $this->parser = xml_parser_create(); - xml_set_object($this->parser,&$this); - xml_set_element_handler($this->parser,"tag_open","tag_close"); - xml_set_character_data_handler($this->parser,"cdata"); + $this->parser = xml_parser_create(); + xml_set_object($this->parser,&$this); + xml_set_element_handler($this->parser,"tag_open","tag_close"); + xml_set_character_data_handler($this->parser,"cdata"); } function parse($data) { - xml_parse($this->parser,$data); + xml_parse($this->parser,$data); } function tag_open($parser,$tag,$attributes) { @@ -650,8 +650,8 @@ } // end of class xml $xml_parser = new xml(); -$xml_parser->parse("<A ID=\"hallo\">PHP</A>"); -?> +$xml_parser->parse("<A ID=\"hallo\">PHP</A>"); +?> </programlisting> </refsect1> </refentry> @@ -701,43 +701,43 @@ <varlistentry> <term><parameter>parser</parameter></term> <listitem> - <simpara> - The first parameter, <replaceable>parser</replaceable>, is a - reference to the XML parser calling the - handler. - </simpara> + <simpara> + The first parameter, <replaceable>parser</replaceable>, is a + reference to the XML parser calling the + handler. + </simpara> </listitem> </varlistentry> <varlistentry> <term><parameter>name</parameter></term> <listitem> - <simpara> - The second parameter, <parameter>name</parameter>, contains - the name of the element for which this handler is called. If - <link linkend="xml.case-folding">case-folding</link> is in - effect for this parser, the element name will be in uppercase - letters. - </simpara> + <simpara> + The second parameter, <parameter>name</parameter>, contains + the name of the element for which this handler is called. If + <link linkend="xml.case-folding">case-folding</link> is in + effect for this parser, the element name will be in uppercase + letters. + </simpara> </listitem> </varlistentry> <varlistentry> <term><parameter>attribs</parameter></term> <listitem> - <simpara> - The third parameter, <parameter>attribs</parameter>, contains - an associative array with the element's attributes (if any). - The keys of this array are the attribute names, the values - are the attribute values. Attribute names are <link - linkend="xml.case-folding">case-folded</link> on the same - criteria as element names. Attribute values are - <emphasis>not</emphasis> case-folded. - </simpara> - <simpara> - The original order of the attributes can be retrieved by - walking through <parameter>attribs</parameter> the normal - way, using <function>each</function>. The first key in the - array was the first attribute, and so on. - </simpara> + <simpara> + The third parameter, <parameter>attribs</parameter>, contains + an associative array with the element's attributes (if any). + The keys of this array are the attribute names, the values + are the attribute values. Attribute names are <link + linkend="xml.case-folding">case-folded</link> on the same + criteria as element names. Attribute values are + <emphasis>not</emphasis> case-folded. + </simpara> + <simpara> + The original order of the attributes can be retrieved by + walking through <parameter>attribs</parameter> the normal + way, using <function>each</function>. The first key in the + array was the first attribute, and so on. + </simpara> </listitem> </varlistentry> </variablelist> @@ -756,23 +756,23 @@ <varlistentry> <term><parameter>parser</parameter></term> <listitem> - <simpara> - The first parameter, <replaceable>parser</replaceable>, is a - reference to the XML parser calling the - handler. - </simpara> + <simpara> + The first parameter, <replaceable>parser</replaceable>, is a + reference to the XML parser calling the + handler. + </simpara> </listitem> </varlistentry> <varlistentry> <term><parameter>name</parameter></term> <listitem> - <simpara> - The second parameter, <parameter>name</parameter>, contains - the name of the element for which this handler is called. If - <link linkend="xml.case-folding">case-folding</link> is in - effect for this parser, the element name will be in uppercase - letters. - </simpara> + <simpara> + The second parameter, <parameter>name</parameter>, contains + the name of the element for which this handler is called. If + <link linkend="xml.case-folding">case-folding</link> is in + effect for this parser, the element name will be in uppercase + letters. + </simpara> </listitem> </varlistentry> </variablelist> @@ -829,19 +829,19 @@ <varlistentry> <term><parameter>parser</parameter></term> <listitem> - <simpara> - The first parameter, <replaceable>parser</replaceable>, is a - reference to the XML parser calling the handler. - </simpara> + <simpara> + The first parameter, <replaceable>parser</replaceable>, is a + reference to the XML parser calling the handler. + </simpara> </listitem> </varlistentry> <varlistentry> <term><parameter>data</parameter></term> <listitem> - <simpara> - The second parameter, <parameter>data</parameter>, contains - the character data as a string. - </simpara> + <simpara> + The second parameter, <parameter>data</parameter>, contains + the character data as a string. + </simpara> </listitem> </varlistentry> </variablelist></para> @@ -923,14 +923,14 @@ <varlistentry> <term><parameter>target</parameter></term> <listitem><simpara> - The second parameter, <parameter>target</parameter>, contains - the PI target.</simpara></listitem> + The second parameter, <parameter>target</parameter>, contains + the PI target.</simpara></listitem> </varlistentry> <varlistentry> <term><parameter>data</parameter></term> <listitem><simpara> - The third parameter, <parameter>data</parameter>, contains - the PI data.</simpara></listitem> + The third parameter, <parameter>data</parameter>, contains + the PI data.</simpara></listitem> </varlistentry> </variablelist></para> <para> @@ -984,27 +984,27 @@ <variablelist> <varlistentry> <term> - <parameter>parser</parameter> + <parameter>parser</parameter> </term> <listitem> - <simpara> - The first parameter, <replaceable>parser</replaceable>, is a - reference to the XML parser calling the - handler. - </simpara> + <simpara> + The first parameter, <replaceable>parser</replaceable>, is a + reference to the XML parser calling the + handler. + </simpara> </listitem> </varlistentry> <varlistentry> <term> - <parameter>data</parameter> + <parameter>data</parameter> </term> <listitem> - <simpara> - The second parameter, <parameter>data</parameter>, contains - the character data. This may be the XML declaration, - document type declaration, entities or other data for which - no other handler exists. - </simpara> + <simpara> + The second parameter, <parameter>data</parameter>, contains + the character data. This may be the XML declaration, + document type declaration, entities or other data for which + no other handler exists. + </simpara> </listitem> </varlistentry> </variablelist> @@ -1080,54 +1080,54 @@ <varlistentry> <term><parameter>parser</parameter></term> <listitem> - <simpara> - The first parameter, <replaceable>parser</replaceable>, is a - reference to the XML parser calling the - handler. - </simpara> + <simpara> + The first parameter, <replaceable>parser</replaceable>, is a + reference to the XML parser calling the + handler. + </simpara> </listitem> </varlistentry> <varlistentry> <term><parameter>entityName</parameter></term> <listitem> - <simpara> - The name of the entity that is about to be defined. - </simpara> + <simpara> + The name of the entity that is about to be defined. + </simpara> </listitem> </varlistentry> <varlistentry> <term><parameter>base</parameter></term> <listitem><simpara> - This is the base for resolving the system identifier - (<parameter>systemId</parameter>) of the external - entity. Currently this parameter will always be set to - an empty string. - </simpara> + This is the base for resolving the system identifier + (<parameter>systemId</parameter>) of the external + entity. Currently this parameter will always be set to + an empty string. + </simpara> </listitem> </varlistentry> <varlistentry> <term><parameter>systemId</parameter></term> <listitem> - <simpara> - System identifier for the external entity. - </simpara> + <simpara> + System identifier for the external entity. + </simpara> </listitem> </varlistentry> <varlistentry> <term><parameter>publicId</parameter></term> <listitem> - <simpara> - Public identifier for the external entity. - </simpara> + <simpara> + Public identifier for the external entity. + </simpara> </listitem> </varlistentry> <varlistentry> <term><parameter>notationName</parameter></term> <listitem> - <simpara> - Name of the notation of this entity (see - <function>xml_set_notation_decl_handler</function>). - </simpara> + <simpara> + Name of the notation of this entity (see + <function>xml_set_notation_decl_handler</function>). + </simpara> </listitem> </varlistentry> </variablelist></para> @@ -1194,56 +1194,56 @@ <variablelist> <varlistentry> <term> - <parameter>parser</parameter> + <parameter>parser</parameter> </term> <listitem> - <simpara> - The first parameter, <replaceable>parser</replaceable>, is a - reference to the XML parser calling the - handler. - </simpara> + <simpara> + The first parameter, <replaceable>parser</replaceable>, is a + reference to the XML parser calling the + handler. + </simpara> </listitem> </varlistentry> <varlistentry> <term><parameter>notationName</parameter></term> <listitem> - <simpara> - This is the notation's <parameter>name</parameter>, as per - the notation format described above. - </simpara> + <simpara> + This is the notation's <parameter>name</parameter>, as per + the notation format described above. + </simpara> </listitem> </varlistentry> <varlistentry> <term> - <parameter>base</parameter> + <parameter>base</parameter> </term> <listitem> - <simpara> - This is the base for resolving the system identifier - (<parameter>systemId</parameter>) of the notation - declaration. Currently this parameter will always be set to - an empty string. - </simpara> + <simpara> + This is the base for resolving the system identifier + (<parameter>systemId</parameter>) of the notation + declaration. Currently this parameter will always be set to + an empty string. + </simpara> </listitem> </varlistentry> <varlistentry> <term><parameter>systemId</parameter></term> <listitem> - <simpara> - System identifier of the external notation - declaration. - </simpara> + <simpara> + System identifier of the external notation + declaration. + </simpara> </listitem> </varlistentry> <varlistentry> <term> - <parameter>publicId</parameter> + <parameter>publicId</parameter> </term> <listitem> - <simpara> - Public identifier of the external notation - declaration. - </simpara> + <simpara> + Public identifier of the external notation + declaration. + </simpara> </listitem> </varlistentry> </variablelist> @@ -1311,53 +1311,53 @@ <varlistentry> <term><parameter>parser</parameter></term> <listitem> - <simpara> - The first parameter, <replaceable>parser</replaceable>, is a - reference to the XML parser calling the handler. - </simpara> + <simpara> + The first parameter, <replaceable>parser</replaceable>, is a + reference to the XML parser calling the handler. + </simpara> </listitem> </varlistentry> <varlistentry> <term><parameter>openEntityNames</parameter></term> <listitem> - <simpara> - The second parameter, <parameter>openEntityNames</parameter>, - is a space-separated list of the names of the entities that - are open for the parse of this entity (including the name of - the referenced entity). - </simpara> + <simpara> + The second parameter, <parameter>openEntityNames</parameter>, + is a space-separated list of the names of the entities that + are open for the parse of this entity (including the name of + the referenced entity). + </simpara> </listitem> </varlistentry> <varlistentry> <term><parameter>base</parameter></term> <listitem> - <simpara> - This is the base for resolving the system identifier - (<parameter>systemid</parameter>) of the external entity. - Currently this parameter will always be set to an empty - string. - </simpara> + <simpara> + This is the base for resolving the system identifier + (<parameter>systemid</parameter>) of the external entity. + Currently this parameter will always be set to an empty + string. + </simpara> </listitem> </varlistentry> <varlistentry> <term><parameter>systemId</parameter></term> <listitem> - <simpara> - The fourth parameter, <parameter>systemId</parameter>, is the - system identifier as specified in the entity declaration. - </simpara> + <simpara> + The fourth parameter, <parameter>systemId</parameter>, is the + system identifier as specified in the entity declaration. + </simpara> </listitem> </varlistentry> <varlistentry> <term><parameter>publicId</parameter></term> <listitem> - <simpara> - The fifth parameter, <parameter>publicId</parameter>, is the - public identifier as specified in the entity declaration, or - an empty string if none was specified; the whitespace in the - public identifier will have been normalized as required by - the XML spec. - </simpara> + <simpara> + The fifth parameter, <parameter>publicId</parameter>, is the + public identifier as specified in the entity declaration, or + an empty string if none was specified; the whitespace in the + public identifier will have been normalized as required by + the XML spec. + </simpara> </listitem> </varlistentry> </variablelist> @@ -1401,29 +1401,29 @@ <varlistentry> <term><parameter>parser</parameter></term> <listitem> - <simpara> - A reference to the XML parser to use. - </simpara> + <simpara> + A reference to the XML parser to use. + </simpara> </listitem> </varlistentry> <varlistentry> <term><parameter>data</parameter></term> <listitem> - <simpara> - Chunk of data to parse. A document may be parsed piece-wise - by calling <function>xml_parse</function> several times with - new data, as long as the <parameter>isFinal</parameter> - parameter is set and true when the last data is parsed. - </simpara> + <simpara> + Chunk of data to parse. A document may be parsed piece-wise + by calling <function>xml_parse</function> several times with + new data, as long as the <parameter>isFinal</parameter> + parameter is set and true when the last data is parsed. + </simpara> </listitem> </varlistentry> <varlistentry> <term><parameter>isFinal</parameter> (optional)</term> <listitem> - <simpara> - If set and true, <parameter>data</parameter> is the last - piece of data sent in this parse. - </simpara> + <simpara> + If set and true, <parameter>data</parameter> is the last + piece of data sent in this parse. + </simpara> </listitem> </varlistentry> </variablelist> @@ -1464,9 +1464,9 @@ <varlistentry> <term><parameter>parser</parameter></term> <listitem> - <simpara> - A reference to the XML parser to get error code from. - </simpara> + <simpara> + A reference to the XML parser to get error code from. + </simpara> </listitem> </varlistentry> </variablelist> @@ -1498,9 +1498,9 @@ <varlistentry> <term><parameter>code</parameter></term> <listitem> - <simpara> - An error code from <function>xml_get_error_code</function>. - </simpara> + <simpara> + An error code from <function>xml_get_error_code</function>. + </simpara> </listitem> </varlistentry> </variablelist> @@ -1532,9 +1532,9 @@ <varlistentry> <term><parameter>parser</parameter></term> <listitem> - <simpara> - A reference to the XML parser to get line number from. - </simpara> + <simpara> + A reference to the XML parser to get line number from. + </simpara> </listitem> </varlistentry> </variablelist> @@ -1569,9 +1569,9 @@ <varlistentry> <term><parameter>parser</parameter></term> <listitem> - <simpara> - A reference to the XML parser to get column number from. - </simpara> + <simpara> + A reference to the XML parser to get column number from. + </simpara> </listitem> </varlistentry> </variablelist> @@ -1606,9 +1606,9 @@ <varlistentry> <term><parameter>parser</parameter></term> <listitem> - <simpara> - A reference to the XML parser to get byte index from. - </simpara> + <simpara> + A reference to the XML parser to get byte index from. + </simpara> </listitem> </varlistentry> </variablelist> @@ -1637,21 +1637,21 @@ <paramdef>array <parameter>&index</parameter></paramdef> </funcprototype> </funcsynopsis> + <para> + This function parses an XML file into 2 parallel array + structures, one (<parameter>index</parameter>) containing pointers + to the location of the appropriate values in the + <parameter>values</parameter> array. These last two parameters + must be passed by reference. + </para> <para> - This function parses an XML file into 2 parallel array - structures, one (<parameter>index</parameter>) containing pointers - to the location of the appropriate values in the - <parameter>values</parameter> array. These last two parameters - must be passed by reference. - </para> - <para> - Below is an example that illustrates the internal structure of - the arrays being generated by the function. We use a simple - <literal>note</literal> tag embeded inside a - <literal>para</literal> tag, and then we parse this an print out - the structures generated: - <informalexample> - <programlisting> + Below is an example that illustrates the internal structure of + the arrays being generated by the function. We use a simple + <literal>note</literal> tag embeded inside a + <literal>para</literal> tag, and then we parse this an print out + the structures generated: + <informalexample> + <programlisting> $simple = "<para><note>simple note</note></para>"; $p = xml_parser_create(); xml_parse_into_struct($p,$simple,&$vals,&$index); @@ -1660,11 +1660,11 @@ print_r($index); echo "\nVals array\n"; print_r($vals); - </programlisting> - </informalexample> - When we run that code, the output will be: - <informalexample> - <programlisting> + </programlisting> + </informalexample> + When we run that code, the output will be: + <informalexample> + <programlisting> Index array Array ( @@ -1707,93 +1707,93 @@ ) ) - </programlisting> - </informalexample> - </para> - <para> - Event-driven parsing (based on the expat library) can get - complicated when you have an XML document that is complex. - This function does not produce a DOM style object, but it - generates structures amenable of being transversed in a tree - fashion. Thus, we can create objects representing the data - in the XML file easily. Let's consider the following XML file - representing a small database of aminoacids information: - <example> - <title>moldb.xml - small database of molecular information</title> - <programlisting> + </programlisting> + </informalexample> + </para> + <para> + Event-driven parsing (based on the expat library) can get + complicated when you have an XML document that is complex. + This function does not produce a DOM style object, but it + generates structures amenable of being transversed in a tree + fashion. Thus, we can create objects representing the data + in the XML file easily. Let's consider the following XML file + representing a small database of aminoacids information: + <example> + <title>moldb.xml - small database of molecular information</title> + <programlisting> <?xml version="1.0"?> <moldb> - <molecule> - <name>Alanine</name> - <symbol>ala</symbol> - <code>A</code> - <type>hydrophobic</type> - </molecule> - - <molecule> - <name>Lysine</name> - <symbol>lys</symbol> - <code>K</code> - <type>charged</type> - </molecule> + <molecule> + <name>Alanine</name> + <symbol>ala</symbol> + <code>A</code> + <type>hydrophobic</type> + </molecule> + + <molecule> + <name>Lysine</name> + <symbol>lys</symbol> + <code>K</code> + <type>charged</type> + </molecule> </moldb> - </programlisting> - </example> - And some code to parse the document and generate the appropriate - objects: - <example> - <title> - parsemoldb.php - parses moldb.xml into and array of - molecular objects - </title> - <programlisting role="php"> + </programlisting> + </example> + And some code to parse the document and generate the appropriate + objects: + <example> + <title> + parsemoldb.php - parses moldb.xml into and array of + molecular objects + </title> + <programlisting role="php"> <?php class AminoAcid { - var $name; // aa name - var $symbol; // three letter symbol - var $code; // one letter code - var $type; // hydrophobic, charged or neutral - - function AminoAcid ($aa) { - foreach ($aa as $k=>$v) - $this->$k = $aa[$k]; - } + var $name; // aa name + var $symbol; // three letter symbol + var $code; // one letter code + var $type; // hydrophobic, charged or neutral + + function AminoAcid ($aa) { + foreach ($aa as $k=>$v) + $this->$k = $aa[$k]; + } } function readDatabase($filename) { - // read the xml database of aminoacids - $data = implode("",file($filename)); - $parser = xml_parser_create(); - xml_parser_set_option($parser,XML_OPTION_CASE_FOLDING,0); - xml_parser_set_option($parser,XML_OPTION_SKIP_WHITE,1); - xml_parse_into_struct($parser,$data,&$values,&$tags); - xml_parser_free($parser); - - // loop through the structures - foreach ($tags as $key=>$val) { - if ($key == "molecule") { - $molranges = $val; - // each contiguous pair of array entries are the - // lower and upper range for each molecule definition - for ($i=0; $i < count($molranges); $i+=2) { - $offset = $molranges[$i] + 1; - $len = $molranges[$i + 1] - $offset; - $tdb[] = parseMol(array_slice($values, $offset, $len)); - } - } else { - continue; - } - } - return $tdb; + // read the xml database of aminoacids + $data = implode("",file($filename)); + $parser = xml_parser_create(); + xml_parser_set_option($parser,XML_OPTION_CASE_FOLDING,0); + xml_parser_set_option($parser,XML_OPTION_SKIP_WHITE,1); + xml_parse_into_struct($parser,$data,&$values,&$tags); + xml_parser_free($parser); + + // loop through the structures + foreach ($tags as $key=>$val) { + if ($key == "molecule") { + $molranges = $val; + // each contiguous pair of array entries are the + // lower and upper range for each molecule definition + for ($i=0; $i < count($molranges); $i+=2) { + $offset = $molranges[$i] + 1; + $len = $molranges[$i + 1] - $offset; + $tdb[] = parseMol(array_slice($values, $offset, $len)); + } + } else { + continue; + } + } + return $tdb; } function parseMol($mvalues) { - for ($i=0; $i < count($mvalues); $i++) - $mol[$mvalues[$i]["tag"]] = $mvalues[$i]["value"]; - return new AminoAcid($mol); + for ($i=0; $i < count($mvalues); $i++) + $mol[$mvalues[$i]["tag"]] = $mvalues[$i]["value"]; + return new AminoAcid($mol); } $db = readDatabase("moldb.xml"); @@ -1801,14 +1801,14 @@ print_r($db); ?> - </programlisting> - </example> - After executing <filename>parsemoldb.php</filename>, the variable - <varname>$db</varname> contains an array of - <classname>AminoAcid</classname> objects, and the output of the - script confirms that: - <informalexample> - <programlisting> + </programlisting> + </example> + After executing <filename>parsemoldb.php</filename>, the variable + <varname>$db</varname> contains an array of + <classname>AminoAcid</classname> objects, and the output of the + script confirms that: + <informalexample> + <programlisting> ** Database of AminoAcid objects: Array ( @@ -1829,9 +1829,9 @@ ) ) - </programlisting> - </informalexample> - </para> + </programlisting> + </informalexample> + </para> </refsect1> </refentry> @@ -1853,9 +1853,9 @@ <varlistentry> <term><parameter>parser</parameter></term> <listitem> - <simpara> - A reference to the XML parser to free. - </simpara> + <simpara> + A reference to the XML parser to free. + </simpara> </listitem> </varlistentry> </variablelist></para> @@ -1887,25 +1887,25 @@ <varlistentry> <term><parameter>parser</parameter></term> <listitem> - <simpara> - A reference to the XML parser to set an option in. - </simpara> + <simpara> + A reference to the XML parser to set an option in. + </simpara> </listitem> </varlistentry> <varlistentry> <term><parameter>option</parameter></term> <listitem> - <simpara> - Which option to set. See below. - </simpara> + <simpara> + Which option to set. See below. + </simpara> </listitem> </varlistentry> <varlistentry> <term><parameter>value</parameter></term> <listitem> - <simpara> - The option's new value. - </simpara> + <simpara> + The option's new value. + </simpara> </listitem> </varlistentry> </variablelist> @@ -1921,34 +1921,34 @@ <title>XML parser options</title> <tgroup cols="3"> <thead> - <row> - <entry>Option constant</entry> - <entry>Data type</entry> - <entry>Description</entry> - </row> + <row> + <entry>Option constant</entry> + <entry>Data type</entry> + <entry>Description</entry> + </row> </thead> <tbody> - <row> - <entry>XML_OPTION_CASE_FOLDING</entry> - <entry>integer</entry> - <entry> - Controls whether <link - linkend="xml.case-folding">case-folding</link> is enabled - for this XML parser. Enabled by default. - </entry> - </row> - <row> - <entry>XML_OPTION_TARGET_ENCODING</entry> - <entry>string</entry> - <entry> - Sets which <link linkend="xml.encoding">target - encoding</link> to use in this XML parser. By default, it - is set to the same as the source encoding used by - <function>xml_parser_create</function>. Supported target - encodings are <literal>ISO-8859-1</literal>, - <literal>US-ASCII</literal> and <literal>UTF-8</literal>. - </entry> - </row> + <row> + <entry>XML_OPTION_CASE_FOLDING</entry> + <entry>integer</entry> + <entry> + Controls whether <link + linkend="xml.case-folding">case-folding</link> is enabled + for this XML parser. Enabled by default. + </entry> + </row> + <row> + <entry>XML_OPTION_TARGET_ENCODING</entry> + <entry>string</entry> + <entry> + Sets which <link linkend="xml.encoding">target + encoding</link> to use in this XML parser. By default, it + is set to the same as the source encoding used by + <function>xml_parser_create</function>. Supported target + encodings are <literal>ISO-8859-1</literal>, + <literal>US-ASCII</literal> and <literal>UTF-8</literal>. + </entry> + </row> </tbody> </tgroup> </table> @@ -1977,20 +1977,20 @@ <varlistentry> <term><parameter>parser</parameter></term> <listitem> - <simpara> - A reference to the XML parser to get an option - from. - </simpara> + <simpara> + A reference to the XML parser to get an option + from. + </simpara> </listitem> </varlistentry> <varlistentry> <term><parameter>option</parameter></term> <listitem> - <simpara> - Which option to fetch. See - <function>xml_parser_set_option</function> for a list of - options. - </simpara> + <simpara> + Which option to fetch. See + <function>xml_parser_set_option</function> for a list of + options. + </simpara> </listitem> </varlistentry> </variablelist> @@ -2064,33 +2064,33 @@ <title>UTF-8 encoding</title> <tgroup cols="3"> <thead> - <row> - <entry>bytes</entry> - <entry>bits</entry> - <entry>representation</entry> - </row> + <row> + <entry>bytes</entry> + <entry>bits</entry> + <entry>representation</entry> + </row> </thead> <tbody> - <row> - <entry>1</entry> - <entry>7</entry> - <entry>0bbbbbbb</entry> - </row> - <row> - <entry>2</entry> - <entry>11</entry> - <entry>110bbbbb 10bbbbbb</entry> - </row> - <row> - <entry>3</entry> - <entry>16</entry> - <entry>1110bbbb 10bbbbbb 10bbbbbb</entry> - </row> - <row> - <entry>4</entry> - <entry>21</entry> - <entry>11110bbb 10bbbbbb 10bbbbbb 10bbbbbb</entry> - </row> + <row> + <entry>1</entry> + <entry>7</entry> + <entry>0bbbbbbb</entry> + </row> + <row> + <entry>2</entry> + <entry>11</entry> + <entry>110bbbbb 10bbbbbb</entry> + </row> + <row> + <entry>3</entry> + <entry>16</entry> + <entry>1110bbbb 10bbbbbb 10bbbbbb</entry> + </row> + <row> + <entry>4</entry> + <entry>21</entry> + <entry>11110bbb 10bbbbbb 10bbbbbb 10bbbbbb</entry> + </row> </tbody> </tgroup> </table> Index: phpdoc/nl/language/basic-syntax.xml diff -u phpdoc/nl/language/basic-syntax.xml:1.3 phpdoc/nl/language/basic-syntax.xml:1.4 --- phpdoc/nl/language/basic-syntax.xml:1.3 Fri Oct 20 15:44:17 2000 +++ phpdoc/nl/language/basic-syntax.xml Tue Nov 7 15:11:07 2000 @@ -12,24 +12,24 @@ <example> <title>Manieren om PHP te embedden in HTML</title> <programlisting> -1. <? echo ("dit is de makkelijste, als een SGML processing instructie\n"); ?> +1. <? echo ("dit is de makkelijste, als een SGML processing instructie\n"); ?> -2. <?php echo("als je XML documenten wilt publiceren, gebruik dan deze methode\n"); ?> +2. <?php echo("als je XML documenten wilt publiceren, gebruik dan deze methode\n"); ?> -3. <script language="php"> +3. <script language="php"> echo ("sommige editors (zoals FrontPage) gaan slecht met processing instructies om"); - </script> + </script> -4. <% echo ("Optioneel kun je ASP-stijl tags gebruiken"); %> - <%= $variable; # Dit is kort voor: "<%echo .." %> +4. <% echo ("Optioneel kun je ASP-stijl tags gebruiken"); %> + <%= $variable; # Dit is kort voor: "<%echo .." %> </programlisting> </example></para> <para> De als eerste beschreven manier is alleen beschikbaar als "short - tags" zijn aangezet. Dit kan worden gedaan met de - <function>short_tags</function> functie, die aan te zetten is door + tags" zijn aangezet. Dit kan worden gedaan met + <!-- de <function>short_tags</function> functie, die aan te zetten is door--> de <link linkend="ini.short-open-tag">short_open_tag</link> configuratie setting in het PHP configuratie bestand, of door PHP te compileren met de <command>configure</command> optie --enable-short-tags.</para> Index: phpdoc/nl/language/functions.xml diff -u phpdoc/nl/language/functions.xml:1.1 phpdoc/nl/language/functions.xml:1.2 --- phpdoc/nl/language/functions.xml:1.1 Tue Oct 10 15:07:54 2000 +++ phpdoc/nl/language/functions.xml Tue Nov 7 15:11:07 2000 @@ -258,14 +258,14 @@ <para> To return a reference from a function, you have to use the reference operator & in both the function declaration and - when assigning the return value to a variable: + when assigning the returned value to a variable: <informalexample> <programlisting role="php"> function &returns_reference() { - return &$someref; + return $someref; } -$newref = &returns_reference(); +$newref =&returns_reference(); </programlisting> </informalexample> </para>
Index: phpdoc/en/chapters/security.xml diff -u phpdoc/en/chapters/security.xml:1.12 phpdoc/en/chapters/security.xml:1.13 --- phpdoc/en/chapters/security.xml:1.12 Wed Nov 1 22:11:37 2000 +++ phpdoc/en/chapters/security.xml Tue Nov 7 15:11:07 2000 @@ -400,7 +400,7 @@ ?> </programlisting> </example> - Dpending on your operating system, there are a wide variety of files + Depending on your operating system, there are a wide variety of files which you should be concerned about, including device entries (/dev/ or COM1), configuration files (/etc/ files and the .ini files), well known file storage areas (/home/, My Documents), etc. For this Index: phpdoc/nl/chapters/security.xml diff -u phpdoc/nl/chapters/security.xml:1.5 phpdoc/nl/chapters/security.xml:1.6 --- phpdoc/nl/chapters/security.xml:1.5 Wed Oct 18 16:02:18 2000 +++ phpdoc/nl/chapters/security.xml Tue Nov 7 15:11:07 2000 @@ -306,10 +306,11 @@ <simpara> Omdat PHP is ontworpen met gebruikers level toegang tot het bestandssysteem, is het helemaal mogelijk om een PHP script te - schrijven dat systeembestanden zoals /etc/password bewerkt. Dit geeft - een aantal implicaties; je moet namelijk goed controleren dat de - bestanden die je leest en schrijft ook diegene zijn die je denkt - dat je leest en schrijft. + schrijven dat systeembestanden zoals /etc/password bewerkt, + ethernet connecties door de war gooit of heel veel uitprint op + een printer. Dit geeft een aantal implicaties; je moet namelijk + goed controleren dat de bestanden die je leest en schrijft + ook diegene zijn die je denkt dat je leest en schrijft. </simpara> <simpara> Neem het volgende in gedachten: als een gebruikt te kennen geeft een @@ -351,7 +352,7 @@ ?> </programlisting> </example> - Er zijn twee toepasbare manier om dit soort dingen tegen te gaan: + Er zijn twee belangrijke manieren om dit soort dingen tegen te gaan: <itemizedlist> <listitem> <simpara> @@ -360,7 +361,7 @@ </listitem> <listitem> <simpara> - Controleer alle bestands gerelateerde variabelen. + Controleer alle variabelen. </simpara> </listitem> </itemizedlist> @@ -369,7 +370,7 @@ <title>Veiliger bestandsnaam controle</title> <programlisting role="php"> <?php -// verwijders een bestand van de schijf waartoe de PHP gebruiker +// verwijderd een bestand van de schijf waartoe de PHP gebruiker // toegang heeft. $gebruiker = $HTTP_REMOTE_USER; // use an authentication mechanisim @@ -383,10 +384,31 @@ fputs ($fp, $logstring); fclose($fp); -echo "$te_verwijderen_bestand has been deleted!"; +echo "$te_verwijderen_bestand is verwijderd!"; ?> </programlisting> </example> + Een alternatief is om een eigen controle uit te voeren: + <example> + <title>Veiliger bestandsnaam controle</title> + <programlisting role="php"> +<?php +$username = $HTTP_REMOTE_USER; +$homedir = "/home/$username"; + +if (!ereg('^[^./][^/]*$', $userfile)) + die('niet geldige bestansnaam'); //die, ga niet verder + +//etc... +?> + </programlisting> + </example> + Afhankelijke van je operating system zijn er een groot aantal files + die extra andacht vereisen, inbegrepen zijn device entries (/dev/ + or COM1), configuratie files (/etc/ bestanden en de .ini files), + bekende bestandslocaties (/home/, Mijn Documenten), etc. Om deze + reden is het vaak makkelijker om een policy aan te houden die alles + verbied, behalve de dingen die je expliciet toelaat. </para> </sect1> @@ -503,6 +525,14 @@ een systeem kunnen garanderen, maar de beveiling zal zeker beter zijn dan als je jezelf deze vragen niet stelt. </para> + <para> + Je kunt ook overwegen om register_globals, + magic_quotes, of andere handigheden uit te zetten die je kunnen + tegenwerken om de validiteit, herkomst, of waarde van een gegeven + variabele te conroleren. Het werken met PHP in error_reporting(E_ALL) + mode kan je ook helpen waarschuwen over variabelen die gebruikt + worden voordat ze zijn gecontroleerd of geïnitialiseerd. + </para> </sect1> <sect1 id="security.general"> @@ -516,7 +546,12 @@ dan zou je een enorm veilig systeem hebben. Op deze manier zal het wel een uur duren om een redelijk complex web formulier in te vullen. Op deze manier zullen gebruikers een manier gaan zoeken om de beveiliging - te omzeilen om hun werk te doen. Sommige manieren van aanvallen + te omzeilen om hun werk te doen. + </simpara> + <simpara> + De beste manier van beveiliging is vaak te strak om gebruikers gewoon + kun werk te laten doen, of om de developer dood te gooien met + vergaande complexiteit. Sommige manieren van aanvallen op systemen zijn zelfs ontstaan vanwege een overkill aan beveiliging. </simpara> <simpara> Index: phpdoc/nl/features/file-upload.xml diff -u phpdoc/nl/features/file-upload.xml:1.1 phpdoc/nl/features/file-upload.xml:1.2 --- phpdoc/nl/features/file-upload.xml:1.1 Tue Oct 10 15:07:53 2000 +++ phpdoc/nl/features/file-upload.xml Tue Nov 7 15:11:07 2000 @@ -41,9 +41,9 @@ In PHP 3, the following variables will be defined within the destination script upon a successful upload, assuming that <link linkend="ini.register-globals">register_globals</link> is turned - on in <filename>php.ini</filename>. If <link + on in <filename>php3.ini</filename>. If <link linkend="ini.track-vars">track_vars</link> is turned on, they will - also be available within the global array + also be available in PHP 3 within the global array <varname>$HTTP_POST_VARS</varname>. Note that the following variable names assume the use of the file upload name 'userfile', as used in the example above: Index: phpdoc/nl/functions/calendar.xml diff -u phpdoc/nl/functions/calendar.xml:1.1 phpdoc/nl/functions/calendar.xml:1.2 --- phpdoc/nl/functions/calendar.xml:1.1 Tue Oct 10 15:07:53 2000 +++ phpdoc/nl/functions/calendar.xml Tue Nov 7 15:11:07 2000 @@ -202,9 +202,7 @@ <funcsynopsis> <funcprototype> <funcdef>string <function>jdtofrench</function></funcdef> - <paramdef>int <parameter>month</parameter></paramdef> - <paramdef>int <parameter>day</parameter></paramdef> - <paramdef>int <parameter>year</parameter></paramdef> + <paramdef>int <parameter>juliandaycount</parameter></paramdef> </funcprototype> </funcsynopsis> <para> Index: phpdoc/nl/functions/filesystem.xml diff -u phpdoc/nl/functions/filesystem.xml:1.2 phpdoc/nl/functions/filesystem.xml:1.3 --- phpdoc/nl/functions/filesystem.xml:1.2 Thu Oct 19 15:01:23 2000 +++ phpdoc/nl/functions/filesystem.xml Tue Nov 7 15:11:07 2000 @@ -382,6 +382,33 @@ </refsect1> </refentry> + <refentry id="function.fflush"> + <refnamediv> + <refname>fflush</refname> + <refpurpose>Flushes the output to a file</refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcprototype> + <funcdef>int <function>fflush</function></funcdef> + <paramdef>int <parameter>fp</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + This function forces a write of all buffered output to the + to the resource pointed to by the file handle + <parameter>fp</parameter>. Returns true if succesful, false + otherwise. + </para> + <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>. + </para> + </refsect1> + </refentry> + <refentry id="function.fgetc"> <refnamediv> <refname>fgetc</refname> @@ -959,30 +986,30 @@ <itemizedlist> <listitem> <simpara> - To acquire a shared lock (reader), set - <parameter>operation</parameter> to LOCK_SH (set to 1 prior to - PHP 4.0.1). + To acquire a shared lock (reader), set + <parameter>operation</parameter> to LOCK_SH (set to 1 prior to + PHP 4.0.1). </simpara> </listitem> <listitem> <simpara> - To acquire an exclusive lock (writer), set - <parameter>operation</parameter> to LOCK_EX (set to 2 prior to - PHP 4.0.1). + To acquire an exclusive lock (writer), set + <parameter>operation</parameter> to LOCK_EX (set to 2 prior to + PHP 4.0.1). </simpara> </listitem> <listitem> <simpara> - To release a lock (shared or exclusive), set - <parameter>operation</parameter> to LOCK_UN (set to 3 prior to - PHP 4.0.1). + To release a lock (shared or exclusive), set + <parameter>operation</parameter> to LOCK_UN (set to 3 prior to + PHP 4.0.1). </simpara> </listitem> <listitem> <simpara> - If you don't want <function>flock</function> to block while - locking, add LOCK_NB (4 prior to PHP 4.0.1) to - <parameter>operation</parameter>. + If you don't want <function>flock</function> to block while + locking, add LOCK_NB (4 prior to PHP 4.0.1) to + <parameter>operation</parameter>. </simpara> </listitem> </itemizedlist> @@ -1068,42 +1095,42 @@ <itemizedlist> <listitem> <simpara> - 'r' - Open for reading only; place the file pointer at the - beginning of the file. + 'r' - Open for reading only; place the file pointer at the + beginning of the file. </simpara> </listitem> <listitem> <simpara> - 'r+' - Open for reading and writing; place the file pointer at - the beginning of the file. + 'r+' - Open for reading and writing; place the file pointer at + the beginning of the file. </simpara> </listitem> <listitem> <simpara> - 'w' - Open for writing only; place the file pointer at the - beginning of the file and truncate the file to zero length. - If the file does not exist, attempt to create it. + 'w' - Open for writing only; place the file pointer at the + beginning of the file and truncate the file to zero length. + If the file does not exist, attempt to create it. </simpara> </listitem> <listitem> <simpara> - 'w+' - Open for reading and writing; place the file pointer at - the beginning of the file and truncate the file to zero - length. If the file does not exist, attempt to create it. + 'w+' - Open for reading and writing; place the file pointer at + the beginning of the file and truncate the file to zero + length. If the file does not exist, attempt to create it. </simpara> </listitem> <listitem> <simpara> - 'a' - Open for writing only; place the file pointer at the end - of the file. If the file does not exist, attempt to create - it. + 'a' - Open for writing only; place the file pointer at the end + of the file. If the file does not exist, attempt to create + it. </simpara> </listitem> <listitem> <simpara> - 'a+' - Open for reading and writing; place the file pointer at - the end of the file. If the file does not exist, attempt to - create it. + 'a+' - Open for reading and writing; place the file pointer at + the end of the file. If the file does not exist, attempt to + create it. </simpara> </listitem> </itemizedlist> @@ -2391,10 +2418,18 @@ $tmpfname = tempnam ("/tmp", "FOO"); </programlisting> </example> + </para> + <note> + <simpara> + This Function's behaviour changed in 4.0.3, the temporary file is also + created to avoid a race condition where the file might appear in the + filesystem between the time the string was generated and before the + the script gets around to creating the file. + </simpara> + </note> + <para> + See also <function>tmpfile</function>. </para> - <para> - See also <function>tmpfile</function>. - </para> </refsect1> </refentry> @@ -2442,9 +2477,9 @@ <funcdef>int <function>touch</function></funcdef> <paramdef>string <parameter>filename</parameter></paramdef> <paramdef>int - <parameter> - <optional>time</optional> - </parameter> + <parameter> + <optional>time</optional> + </parameter> </paramdef> </funcprototype> </funcsynopsis> Index: phpdoc/nl/functions/ftp.xml diff -u phpdoc/nl/functions/ftp.xml:1.1 phpdoc/nl/functions/ftp.xml:1.2 --- phpdoc/nl/functions/ftp.xml:1.1 Tue Oct 10 15:07:53 2000 +++ phpdoc/nl/functions/ftp.xml Tue Nov 7 15:11:07 2000 @@ -227,7 +227,7 @@ <title>Description</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>ftp_rawlist</function></funcdef> + <funcdef>array <function>ftp_rawlist</function></funcdef> <paramdef>int <parameter>ftp_stream</parameter></paramdef> <paramdef>string <parameter>directory</parameter></paramdef> </funcprototype> Index: phpdoc/nl/functions/ibase.xml diff -u phpdoc/nl/functions/ibase.xml:1.1 phpdoc/nl/functions/ibase.xml:1.2 --- phpdoc/nl/functions/ibase.xml:1.1 Tue Oct 10 15:07:53 2000 +++ phpdoc/nl/functions/ibase.xml Tue Nov 7 15:11:07 2000 @@ -131,7 +131,7 @@ <title>Description</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>ibase_connect</function></funcdef> + <funcdef>int <function>ibase_pconnect</function></funcdef> <paramdef>string <parameter>database</parameter></paramdef> <paramdef>string <parameter><optional>username</optional></parameter> @@ -142,6 +142,12 @@ <paramdef>string <parameter><optional>charset</optional></parameter> </paramdef> + <paramdef>int + <parameter><optional>buffers</optional></parameter> + </paramdef> + <paramdef>int + <parameter><optional>dialect</optional></parameter> + </paramdef> <paramdef>string <parameter><optional>role</optional></parameter> </paramdef> @@ -160,6 +166,23 @@ by <function>ibase_pconnect</function>). This type of link is therefore called 'persistent'. </para> + <note> + <para> + <parameter>buffers</parameter> was added in PHP4-RC2. + </para> + </note> + <note> + <para> + <parameter>dialect</parameter> was added in PHP4-RC2. It is functional + only with InterBase 6 and versions higher than that. + </para> + </note> + <note> + <para> + <parameter>role</parameter> was added in PHP4-RC2. It is functional + only with InterBase 5 and versions higher than that. + </para> + </note> <para> See also <function>ibase_connect</function> for the meaning of parameters passed to this function. They are exactly the same. @@ -295,7 +318,31 @@ </para> </refsect1> </refentry> - + + <refentry id="function.ibase-field-info"> + <refnamediv> + <refname>ibase_field_info</refname> + <refpurpose> + Get information about a field + </refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcprototype> + <funcdef>array <function>ibase_field_info</function></funcdef> + <paramdef>int <parameter>result</parameter></paramdef> + <paramdef>int <parameter>field number</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + Returns an array with information about a field after a select + query has been run. The array is in the form of name, alias, + relation, length, type. + </para> + </refsect1> + </refentry> + <refentry id="function.ibase-free-result"> <refnamediv> <refname>ibase_free_result</refname> @@ -388,6 +435,78 @@ </refsect1> </refentry> + <refentry id="function.ibase-trans"> + <refnamediv> + <refname>ibase_trans</refname> + <refpurpose>Begin a transaction</refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcprototype> + <funcdef>int <function>ibase_trans</function></funcdef> + <paramdef>int + <parameter><optional>trans_args</optional></parameter> + </paramdef> + <paramdef>int + <parameter><optional>link_identifier</optional></parameter> + </paramdef> + </funcprototype> + </funcsynopsis> + <para> + Begins a transaction. + </para> + </refsect1> + </refentry> + + <refentry id="function.ibase-commit"> + <refnamediv> + <refname>ibase_commit</refname> + <refpurpose>Commit a transaction</refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcprototype> + <funcdef>int <function>ibase_commit</function></funcdef> + <paramdef>int + <parameter><optional>link_identifier</optional></parameter> + </paramdef> + <paramdef>int <parameter>trans_number</parameter> + </paramdef> + </funcprototype> + </funcsynopsis> + <para> + Commits transaction <parameter>trans_number</parameter> which was + created with <function>ibase_trans</function>. + </para> + </refsect1> + </refentry> + + <refentry id="function.ibase-rollback"> + <refnamediv> + <refname>ibase_rollback</refname> + <refpurpose>Rolls back a transaction</refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcprototype> + <funcdef>int <function>ibase_rollback</function></funcdef> + <paramdef>int + <parameter><optional>link_identifier</optional></parameter> + </paramdef> + <paramdef>int <parameter>trans_number</parameter> + </paramdef> + </funcprototype> + </funcsynopsis> + <para> + Rolls back transaction <parameter>trans_number</parameter> which was + created with <function>ibase_trans</function>. + </para> + </refsect1> + </refentry> + <refentry id="function.ibase-free-query"> <refnamediv> <refname>ibase_free_query</refname> @@ -517,6 +636,27 @@ in PHP 4. </para> </note> + </refsect1> + </refentry> + + <refentry id="function.ibase-errmsg"> + <refnamediv> + <refname>ibase_errmsg</refname> + <refpurpose> + Returns error messages + </refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcprototype> + <funcdef>string <function>ibase_errmsg</function></funcdef> + <paramdef>void <parameter></parameter></paramdef> + </funcprototype> + </funcsynopsis> + <simpara> + Returns a string containing an error message. + </simpara> </refsect1> </refentry> Index: phpdoc/nl/functions/ldap.xml diff -u phpdoc/nl/functions/ldap.xml:1.3 phpdoc/nl/functions/ldap.xml:1.4 --- phpdoc/nl/functions/ldap.xml:1.3 Fri Oct 27 10:27:55 2000 +++ phpdoc/nl/functions/ldap.xml Tue Nov 7 15:11:07 2000 @@ -424,6 +424,12 @@ already opened link will be returned. If only <parameter>hostname</parameter> is specified, then the port defaults to 389.</para> + <para> + If you are using OpenLDAP 2.x.x you can specify a URL instead of the + hostname. To use LDAP with SSL, compile OpenLDAP 2.x.x with SSL + support, configure PHP with SSL, and use ldaps://hostname/ as + host parameter. The port parameter is not used when using URLs. + URL and SSL support were added in 4.0.4.</para> </refsect1> </refentry> @@ -929,7 +935,7 @@ LDAP_OPT_MATCHED_DN. These are described in <ulink url="&url.ldap.openldap-c-api;">draft-ietf-ldapext-ldap-c-api-xx.txt</ulink> </para> - <para>This function is only available when using OpenLDAP 2.x.x, and was + <para>This function is only available when using OpenLDAP 2.x.x OR Netscape Directory SDK x.x, and was added in PHP 4.0.4</para> <para> @@ -1534,7 +1540,7 @@ LDAP_OPT_RESTART, LDAP_OPT_HOST_NAME, LDAP_OPT_ERROR_STRING, LDAP_OPT_MATCHED_DN. These are described in <ulink url="&url.ldap.openldap-c-api;">draft-ietf-ldapext-ldap-c-api-xx.txt</ulink></para> - <para>This function is only available when using OpenLDAP 2.x.x, and was + <para>This function is only available when using OpenLDAP 2.x.x OR Netscape Directory SDK x.x, and was added in PHP 4.0.4</para> <para> Index: phpdoc/nl/functions/misc.xml diff -u phpdoc/nl/functions/misc.xml:1.1 phpdoc/nl/functions/misc.xml:1.2 --- phpdoc/nl/functions/misc.xml:1.1 Tue Oct 10 15:07:53 2000 +++ phpdoc/nl/functions/misc.xml Tue Nov 7 15:11:07 2000 @@ -171,6 +171,16 @@ <para> Returns true if the named constant given by <parameter>name</parameter> has been defined, false otherwise. + <example> + <title>Checking Constants</title> + <programlisting role="php"> +<?php +if (defined("CONSTANT")){ // Note that it should be quoted + echo CONSTANT; // + } +?> + </programlisting> + </example> </para> <para> See also <function>define</function> and the section on <link @@ -414,7 +424,7 @@ <title>Description</title> <funcsynopsis> <funcprototype> - <funcdef>void <function>highlight_file</function></funcdef> + <funcdef>boolean <function>highlight_file</function></funcdef> <paramdef>string <parameter>filename</parameter></paramdef> </funcprototype> </funcsynopsis> @@ -422,6 +432,7 @@ The <function>highlight_file</function> function prints out a syntax higlighted version of the code contained in <parameter>filename</parameter> using the colors defined in the built-in syntax highlighter for PHP. + It returns true on success, false otherwise (PHP 4). </simpara> <para> <example> @@ -510,6 +521,7 @@ The <function>highlight_string</function> function prints out a syntax highlighted version of <parameter>str</parameter> using the colors defined in the built-in syntax highlighter for PHP. + It returns true on success, false otherwise (PHP 4). </simpara> <simpara> See also <function>highlight_file</function>, @@ -771,7 +783,7 @@ <title>Description</title> <funcsynopsis> <funcprototype> - <funcdef>void <function>show_source</function></funcdef> + <funcdef>boolean <function>show_source</function></funcdef> <paramdef>string <parameter>filename</parameter></paramdef> </funcprototype> </funcsynopsis> @@ -779,6 +791,7 @@ The <function>show_source</function> function prints out a syntax higlighted version of the code contained in <parameter>filename</parameter> using the colors defined in the built-in syntax highlighter for PHP. + It returns true on success, false otherwise (PHP 4). </simpara> <note> <simpara> Index: phpdoc/nl/functions/mysql.xml diff -u phpdoc/nl/functions/mysql.xml:1.1 phpdoc/nl/functions/mysql.xml:1.2 --- phpdoc/nl/functions/mysql.xml:1.1 Tue Oct 10 15:07:53 2000 +++ phpdoc/nl/functions/mysql.xml Tue Nov 7 15:11:07 2000 @@ -399,7 +399,7 @@ $db_list = mysql_list_dbs(); $i = 0; -$cnt = mysql_numrows($db_list); +$cnt = mysql_num_rows($db_list); while ($i < $cnt) { echo mysql_db_name($db_list, $i) . "\n"; $i++; @@ -1524,6 +1524,22 @@ a result set. This command is only valid for SELECT statements. To retrieve the number of rows returned from a INSERT, UPDATE or DELETE, use <function>mysql_affected_rows</function>. + <example> + <title> + <function> + mysql_num_rows example by crubel@trilizio.org + </function> + </title> + <programlisting role="php"> +<?php +$conn = mysql_connect("hostaddress", "username", "password"); +mysql_select_db("database",$conn); // needed if you have m,ultiple db's +$Resultfornummembers = mysql_query("SELECT * FROM Accounts",$conn); +$NumMembers = mysql_num_rows($Resultfornummembers); +echo "$NumMembers Members"; +?> + </programlisting> + </example> </para> <para> See also: Index: phpdoc/nl/functions/oci8.xml diff -u phpdoc/nl/functions/oci8.xml:1.2 phpdoc/nl/functions/oci8.xml:1.3 --- phpdoc/nl/functions/oci8.xml:1.2 Tue Oct 31 00:11:08 2000 +++ phpdoc/nl/functions/oci8.xml Tue Nov 7 15:11:07 2000 @@ -71,7 +71,7 @@ $result = OCIResult($stmt, $n); if (is_object ($result)) $result = $result->load(); -// For INSERT or UPDATE statetment use: +// For INSERT or UPDATE statement use: $sql = "insert into table (field1, field2) values (field1 = 'value', field2 = empty_clob()) returning field2 into :field2"; @@ -110,37 +110,6 @@ </example> </para> </partintro> - -<!-- -OCIBindByName -OCIDefineByName -OCIColumnIsNULL -OCIColumnName -OCIColumnSize -OCIColumnType -OCIExecute -OCIFetch -OCIFetchInto -OCIFetchStatement -OCIInternalDebug -OCILogoff -OCILogon -OCIPLogon -OCINLogon -OCIError -OCICommit -OCIRollback -OCINewCursor -OCINewDescriptor -OCIRowCount -OCINumCols -OCIParse -OCIResult -OCIServerVersion -OCIStatementType -OCIFreeStatement -OCIFreeCursor ---> <refentry id="function.ocidefinebyname"> <refnamediv> @@ -156,8 +125,9 @@ <funcdef>int <function>OCIDefineByName</function></funcdef> <paramdef>int <parameter>stmt</parameter></paramdef> <paramdef>string <parameter>Column-Name</parameter></paramdef> - <paramdef>mixed &<parameter>variable</parameter></paramdef> - <paramdef>int <parameter><optional>type</optional></parameter></paramdef> + <paramdef>mixed <parameter>variable</parameter></paramdef> + <paramdef>int <parameter><optional>type</optional></parameter> + </paramdef> </funcprototype> </funcsynopsis> <para> @@ -187,8 +157,8 @@ /* the define MUST be done BEFORE ociexecute! */ -OCIDefineByName($stmt,"EMPNO",&$empno); -OCIDefineByName($stmt,"ENAME",&$ename); +OCIDefineByName($stmt,"EMPNO",$empno); +OCIDefineByName($stmt,"ENAME",$ename); OCIExecute($stmt); @@ -208,7 +178,9 @@ <refentry id="function.ocibindbyname"> <refnamediv> <refname>OCIBindByName</refname> - <refpurpose>Bind a PHP variable to an Oracle Placeholder</refpurpose> + <refpurpose> + Bind a PHP variable to an Oracle Placeholder + </refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -218,8 +190,9 @@ <paramdef>int <parameter>stmt</parameter></paramdef> <paramdef>string <parameter>ph_name</parameter></paramdef> <paramdef>mixed &<parameter>variable</parameter></paramdef> - <paramdef>int<parameter>length</parameter></paramdef> - <paramdef>int <parameter><optional>type</optional></parameter></paramdef> + <paramdef>int <parameter>length</parameter></paramdef> + <paramdef>int <parameter> + <optional>type</optional></parameter></paramdef> </funcprototype> </funcsynopsis> <para> @@ -228,7 +201,7 @@ <parameter>ph_name</parameter>. Whether it will be used for input or output will be determined run-time, and the necessary storage space will be allocated. The - <parameter>length</parameter> paramter sets the maximum length + <parameter>length</parameter> parameter sets the maximum length for the bind. If you set <parameter>length</parameter> to -1 <function>OCIBindByName</function> will use the current length of <parameter>variable</parameter> to set the maximum length. @@ -249,7 +222,7 @@ <programlisting> <?php /* OCIBindByPos example thies@thieso.net (980221) - inserts 3 resords into emp, and uses the ROWID for updating the + inserts 3 records into emp, and uses the ROWID for updating the records just after the insert. */ @@ -299,6 +272,16 @@ ?> </programlisting> </example> + <warning> + <para> + It is a bad idea to use magic quotes and + <function>OciBindByName</function> simultaneously as no quoting + is needed on quoted variables and any quotes magically applied + will be written into your database as + <function>OciBindByName</function> is not able to distinguish + magically added quotings from those added by intention. + </para> + </warning> </refsect1> </refentry> @@ -314,7 +297,9 @@ <funcdef>int <function>OCILogon</function></funcdef> <paramdef>string <parameter>username</parameter></paramdef> <paramdef>string <parameter>password</parameter></paramdef> - <paramdef>string <parameter><optional>db</optional></parameter></paramdef> + <paramdef>string + <parameter><optional>db</optional></parameter> + </paramdef> </funcprototype> </funcsynopsis> <para> @@ -370,7 +355,7 @@ function commit($conn) { ocicommit($conn); - echo $conn." commited\n\n"; + echo $conn." committed\n\n"; } function rollback($conn) @@ -425,8 +410,8 @@ <refentry id="function.ociplogon"> <refnamediv> <refname>OCIPLogon</refname> - <refpurpose>Connect to an Oracle database and log on using a persistant connection. - Returns a new session.</refpurpose> + <refpurpose>Connect to an Oracle database and log on using a + persistant connection. Returns a new session.</refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -435,7 +420,9 @@ <funcdef>int <function>OCIPLogon</function></funcdef> <paramdef>string <parameter>username</parameter></paramdef> <paramdef>string <parameter>password</parameter></paramdef> - <paramdef>string <parameter><optional>db</optional></parameter></paramdef> + <paramdef>string + <parameter><optional>db</optional></parameter> + </paramdef> </funcprototype> </funcsynopsis> <para> @@ -449,14 +436,16 @@ </para> <simpara> See also <function>OCILogon</function> and - <function>OCINLogon</function>.</simpara> - </refsect1></refentry> + <function>OCINLogon</function>. + </simpara> + </refsect1> + </refentry> <refentry id="function.ocinlogon"> <refnamediv> <refname>OCINLogon</refname> - <refpurpose>Connect to an Oracle database and log on using a new connection. - Returns a new session.</refpurpose> + <refpurpose>Connect to an Oracle database and log on using a new + connection. Returns a new session.</refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -465,7 +454,9 @@ <funcdef>int <function>OCINLogon</function></funcdef> <paramdef>string <parameter>username</parameter></paramdef> <paramdef>string <parameter>password</parameter></paramdef> - <paramdef>string <parameter><optional>db</optional></parameter></paramdef> + <paramdef>string + <parameter><optional>db</optional></parameter> + </paramdef> </funcprototype> </funcsynopsis> <para> @@ -526,7 +517,7 @@ function commit($conn) { ocicommit($conn); - echo $conn." commited\n\n"; + echo $conn." committed\n\n"; } function rollback($conn) @@ -570,11 +561,14 @@ drop_table($c1); print "</PRE></HTML>"; -?></programlisting></example></para> +?></programlisting></example> + </para> <simpara> See also <function>OCILogon</function> and - <function>OCIPLogon</function>.</simpara> - </refsect1></refentry> + <function>OCIPLogon</function>. + </simpara> + </refsect1> + </refentry> <refentry id="function.ocilogoff"> <refnamediv> @@ -606,15 +600,18 @@ <funcprototype> <funcdef>int <function>OCIExecute</function></funcdef> <paramdef>int <parameter>statement</parameter></paramdef> - <paramdef>int <parameter><optional>mode</optional></parameter></paramdef> + <paramdef>int + <parameter><optional>mode</optional></parameter> + </paramdef> </funcprototype> </funcsynopsis> <para> - <function>OCIExecute</function> executes a previously parsed statement. - (see <function>OCIParse</function>). The optional <parameter>mode</parameter> - allows you to specify the execution-mode (default is OCI_COMMIT_ON_SUCCESS). - If you don't want statements to be commited automaticly specify OCI_DEFAULT as - your mode. + <function>OCIExecute</function> executes a previously parsed + statement. (see <function>OCIParse</function>. The optional + <parameter>mode</parameter> allows you to specify the + execution-mode (default is OCI_COMMIT_ON_SUCCESS). If you don't + want statements to be committed automaticly specify OCI_DEFAULT as + your mode. </para> </refsect1> </refentry> @@ -633,8 +630,8 @@ </funcprototype> </funcsynopsis> <para> - <function>OCICommit</function> commits all outstanding statements for - Oracle connection <parameter>connection</parameter>. + <function>OCICommit</function> commits all outstanding statements + for Oracle connection <parameter>connection</parameter>. </para> </refsect1> </refentry> @@ -653,8 +650,8 @@ </funcprototype> </funcsynopsis> <para> - <function>OCIRollback</function> rolls back all outstanding statements for - Oracle connection <parameter>connection</parameter>. + <function>OCIRollback</function> rolls back all outstanding + statements for Oracle connection <parameter>connection</parameter>. </para> </refsect1> </refentry> @@ -662,7 +659,9 @@ <refentry id="function.ocinewdescriptor"> <refnamediv> <refname>OCINewDescriptor</refname> - <refpurpose>Initialize a new empty descriptor LOB/FILE (LOB is default)</refpurpose> + <refpurpose> + Initialize a new empty descriptor LOB/FILE (LOB is default) + </refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -670,16 +669,18 @@ <funcprototype> <funcdef>string <function>OCINewDescriptor</function></funcdef> <paramdef>int <parameter>connection</parameter></paramdef> - <paramdef>int <parameter><optional>type</optional></parameter></paramdef> + <paramdef>int + <parameter><optional>type</optional></parameter> + </paramdef> </funcprototype> </funcsynopsis> <para> <function>OCINewDescriptor</function> Allocates storage to hold descriptors or LOB locators. Valid values for the valid <parameter>type</parameter> are OCI_D_FILE, OCI_D_LOB, OCI_D_ROWID. - For LOB desriptors, the methods load, save, and savefile are - associated with the descriptor, for BFILE only the load method exists. - See the second example usage hints. + For LOB descriptors, the methods load, save, and savefile are + associated with the descriptor, for BFILE only the load method + exists. See the second example usage hints. </para> <example> <title>OCINewDescriptor</title> @@ -766,7 +767,7 @@ </funcsynopsis> <para> <function>OCIRowCount</function> returns the number of rows affected - for eg update-statements. This funtions will not tell you the number + for eg update-statements. This function will not tell you the number of rows that a select will return!</para> <para> <example> @@ -789,15 +790,17 @@ OCIFreeStatement($stmt); OCILogOff($conn); print "</PRE></HTML>"; -?> </programlisting></example></para> - +?> </programlisting></example> + </para> </refsect1> </refentry> <refentry id="function.ocinumcols"> <refnamediv> <refname>OCINumCols</refname> - <refpurpose>Return the number of result columns in a statement</refpurpose> + <refpurpose> + Return the number of result columns in a statement + </refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -842,7 +845,7 @@ <refentry id="function.ociresult"> <refnamediv> <refname>OCIResult</refname> - <refpurpose>Returns coulumn value for fetched row</refpurpose> + <refpurpose>Returns column value for fetched row</refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -857,7 +860,8 @@ <function>OCIResult</function> returns the data for column <parameter>column</parameter> in the current row (see <function>OCIFetch</function>).<function>OCIResult</function> will - return everything as strings except for abstract types (ROWIDs, LOBs and FILEs). + return everything as strings except for abstract types (ROWIDs, + LOBs and FILEs). </para> </refsect1> </refentry> @@ -876,8 +880,8 @@ </funcprototype> </funcsynopsis> <para> - <function>OCIFetch</function> fetches the next row (for SELECT statements) - into the internal result-buffer. + <function>OCIFetch</function> fetches the next row (for SELECT + statements) into the internal result-buffer. </para> </refsect1> </refentry> @@ -894,31 +898,40 @@ <funcdef>int <function>OCIFetchInto</function></funcdef> <paramdef>int <parameter>stmt</parameter></paramdef> <paramdef>array &<parameter>result</parameter></paramdef> - <paramdef>int <parameter><optional>mode</optional></parameter></paramdef> + <paramdef>int + <parameter><optional>mode</optional></parameter> + </paramdef> </funcprototype> </funcsynopsis> <para> - <function>OCIFetchInto</function> fetches the next row (for SELECT statements) - into the <parameter>result</parameter> array. <function>OCIFetchInto</function> - will overwrite the previous content of <parameter>result</parameter>. By default - <parameter>result</parameter> will contain a one-based array of all columns - that are not NULL. + <function>OCIFetchInto</function> fetches the next row (for SELECT + statements) into the <parameter>result</parameter> array. + <function>OCIFetchInto</function> will overwrite the previous + content of <parameter>result</parameter>. By default + <parameter>result</parameter> will contain a one-based array of all + columns that are not NULL. </para> <para> - The <parameter>mode</parameter> parameter allows you to change the default - behaviour. You can specify more than one flag by simply addig them up - (eg OCI_ASSOC+OCI_RETURN_NULLS). The known flags are: - + The <parameter>mode</parameter> parameter allows you to change the + default behaviour. You can specify more than one flag by simply + adding them up (eg OCI_ASSOC+OCI_RETURN_NULLS). The known flags + are: <simplelist> - <member><literal>OCI_ASSOC</literal> Return an associative array.</member> - <member><literal>OCI_NUM</literal> Return an numbered array - starting with one. (DEFAULT)</member> - <member><literal>OCI_RETURN_NULLS</literal> Return empty columns.</member> - <member><literal>OCI_RETURN_LOBS</literal> Return the value of a LOB instead of the desxriptor.</member> + <member> + <literal>OCI_ASSOC</literal> Return an associative array. + </member> + <member> + <literal>OCI_NUM</literal> Return an numbered array starting with + one. (DEFAULT) + </member> + <member> + <literal>OCI_RETURN_NULLS</literal> Return empty columns. + </member> + <member> + <literal>OCI_RETURN_LOBS</literal> Return the value of a LOB + instead of the descriptor. + </member> </simplelist> - - </para> - <para> </para> </refsect1> </refentry> @@ -939,8 +952,9 @@ </funcsynopsis> <para> <function>OCIFetchStatement</function> fetches all the rows from a - result into a user-defined array. <function>OCIFetchStatement</function> - returns the number of rows fetched. + result into a user-defined array. + <function>OCIFetchStatement</function> returns the number of rows + fetched. </para> <example> <title>OCIFetchStatement</title> @@ -980,11 +994,12 @@ OCIFreeStatement($stmt); OCILogoff($conn); - -?></programlisting></example> - +?> + </programlisting> + </example> </refsect1> </refentry> + <refentry id="function.ocicolumnisnull"> <refnamediv> <refname>OCIColumnIsNULL</refname> @@ -1003,12 +1018,71 @@ <function>OCIColumnIsNULL</function> returns true if the returned column <parameter>column</parameter> in the result from the statement <parameter>stmt</parameter> is NULL. You can either use - the column-number (1-Based) or the column-name for the <parameter>col</parameter> - parameter. + the column-number (1-Based) or the column-name for the + <parameter>col</parameter> parameter. </para> </refsect1> </refentry> + <refentry id="function.ocicolumnname"> + <refnamediv> + <refname>OCIColumnName</refname> + <refpurpose>Returns the name of a column.</refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcprototype> + <funcdef>string <function>OCIColumnName</function></funcdef> + <paramdef>int <parameter>stmt</parameter></paramdef> + <paramdef>int <parameter>col</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <simpara> + <function>OCIColumnName</function> returns the name of the column + corresponding to the column number (1-based) that is passed in. + </simpara> + <para> + <example> + <title>OCIColumnName</title> + <programlisting> +<?php + print "<HTML><PRE>\n"; + $conn = OCILogon("scott", "tiger"); + $stmt = OCIParse($conn,"select * from emp"); + OCIExecute($stmt); + print "<TABLE BORDER=\"1\">"; + print "<TR>"; + print "<TH>Name</TH>"; + print "<TH>Type</TH>"; + print "<TH>Length</TH>"; + print "</TR>"; + $ncols = OCINumCols($stmt); + for ( $i = 1; $i <= $ncols; $i++ ) { + $column_name = OCIColumnName($stmt,$i); + $column_type = OCIColumnType($stmt,$i); + $column_size = OCIColumnSize($stmt,$i); + print "<TR>"; + print "<TD>$column_name</TD>"; + print "<TD>$column_type</TD>"; + print "<TD>$column_size</TD>"; + print "</TR>"; + } + OCIFreeStatement($stmt); + OCILogoff($conn); + print "</PRE>"; + print "</HTML>\n"; +?> + </programlisting> + </example> + </para> + <simpara> + See also <function>OCINumCols</function>, + <function>OCIColumnType</function>, + and <function>OCIColumnSize</function>. + </simpara> + </refsect1> + </refentry> <refentry id="function.ocicolumnsize"> <refnamediv> @@ -1027,8 +1101,8 @@ <para> <function>OCIColumnSize</function> returns the size of the column as given by Oracle. You can either use - the column-number (1-Based) or the column-name for the <parameter>col</parameter> - parameter. + the column-number (1-Based) or the column-name for the + <parameter>col</parameter> parameter. </para> <para> <example> @@ -1065,16 +1139,80 @@ </programlisting> </example> </para> + <simpara> + See also <function>OCINumCols</function>, + <function>OCIColumnName</function>, and + <function>OCIColumnSize</function>. + </simpara> + </refsect1> + </refentry> + + <refentry id="function.ocicolumntype"> + <refnamediv> + <refname>OCIColumnType</refname> + <refpurpose>Returns the data type of a column.</refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcprototype> + <funcdef>mixed <function>OCIColumnType</function></funcdef> + <paramdef>int <parameter>stmt</parameter></paramdef> + <paramdef>int <parameter>col</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <simpara> + <function>OCIColumnType</function> returns the data type of the + column corresponding to the column number (1-based) that is passed + in. + </simpara> + <para> + <example> + <title>OCIColumnType</title> + <programlisting> +<?php + print "<HTML><PRE>\n"; + $conn = OCILogon("scott", "tiger"); + $stmt = OCIParse($conn,"select * from emp"); + OCIExecute($stmt); + print "<TABLE BORDER=\"1\">"; + print "<TR>"; + print "<TH>Name</TH>"; + print "<TH>Type</TH>"; + print "<TH>Length</TH>"; + print "</TR>"; + $ncols = OCINumCols($stmt); + for ( $i = 1; $i <= $ncols; $i++ ) { + $column_name = OCIColumnName($stmt,$i); + $column_type = OCIColumnType($stmt,$i); + $column_size = OCIColumnSize($stmt,$i); + print "<TR>"; + print "<TD>$column_name</TD>"; + print "<TD>$column_type</TD>"; + print "<TD>$column_size</TD>"; + print "</TR>"; + } + OCIFreeStatement($stmt); + OCILogoff($conn); + print "</PRE>"; + print "</HTML>\n"; +?> + </programlisting> + </example> + </para> <simpara> - See also <function>OCINumCols</function>, <function>OCIColumnName</function>, - and <function>OCIColumnSize</function>.</simpara> + See also <function>OCINumCols</function>, + <function>OCIColumnName</function>, + and <function>OCIColumnSize</function>. + </simpara> </refsect1> </refentry> <refentry id="function.ociserverversion"> <refnamediv> <refname>OCIServerVersion</refname> - <refpurpose>Return a string containing server version information.</refpurpose> + <refpurpose>Return a string containing server version + information.</refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -1092,8 +1230,10 @@ $conn = OCILogon("scott","tiger"); print "Server Version: " . OCIServerVersion($conn); OCILogOff($conn); -?></programlisting></example></para> - +?> + </programlisting> + </example> + </para> </refsect1> </refentry> @@ -1111,7 +1251,8 @@ </funcprototype> </funcsynopsis> <para> - <function>OCIStatementType</function> returns on of the following values: + <function>OCIStatementType</function> returns one of the following + values: <orderedlist> <listitem><simpara> "SELECT"</simpara></listitem> <listitem><simpara> "UPDATE"</simpara></listitem> @@ -1141,15 +1282,18 @@ OCILogoff($conn); print "</PRE></HTML>"; ?> -</programlisting></example></para> - + </programlisting> + </example> + </para> </refsect1> </refentry> <refentry id="function.ocinewcursor"> <refnamediv> <refname>OCINewCursor</refname> - <refpurpose>return a new cursor (Statement-Handle) - use this to bind ref-cursors!</refpurpose> + <refpurpose> + Return a new cursor (Statement-Handle) - use to bind ref-cursors. + </refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -1160,8 +1304,8 @@ </funcprototype> </funcsynopsis> <para> - <function>OCINewCursor</function> allocates a new statement handle on the specified - connection. + <function>OCINewCursor</function> allocates a new statement handle + on the specified connection. </para> <para> <example> @@ -1235,7 +1379,9 @@ <refentry id="function.ocifreestatement"> <refnamediv> <refname>OCIFreeStatement</refname> - <refpurpose>Free all resources associated with a statement.</refpurpose> + <refpurpose> + Free all resources associated with a statement. + </refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -1246,8 +1392,8 @@ </funcprototype> </funcsynopsis> <para> - <function>OCIFreeStatement</function> returns true if successful, or false if - unsuccessful. + <function>OCIFreeStatement</function> returns true if successful, + or false if unsuccessful. </para> </refsect1> </refentry> @@ -1255,7 +1401,9 @@ <refentry id="function.ocifreecursor"> <refnamediv> <refname>OCIFreeCursor</refname> - <refpurpose>Free all resources associated with a cursor.</refpurpose> + <refpurpose> + Free all resources associated with a cursor. + </refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -1266,8 +1414,8 @@ </funcprototype> </funcsynopsis> <para> - <function>OCIFreeCursor</function> returns true if successful, or false if - unsuccessful. + <function>OCIFreeCursor</function> returns true if successful, or + false if unsuccessful. </para> </refsect1> </refentry> @@ -1285,129 +1433,13 @@ <paramdef>object <parameter>lob</parameter></paramdef> </funcprototype> </funcsynopsis> - <para> - <function>OCIFreeDesc</function> returns true if successful, or false if - unsuccessful. - </para> - </refsect1> - </refentry> - - <refentry id="function.ocicolumnname"> - <refnamediv> - <refname>OCIColumnName</refname> - <refpurpose>Returns the name of a column.</refpurpose> - </refnamediv> - <refsect1> - <title>Description</title> - <funcsynopsis> - <funcprototype> - <funcdef>string <function>OCIColumnName</function></funcdef> - <paramdef>int <parameter>stmt</parameter></paramdef> - <paramdef>int <parameter>col</parameter></paramdef> - </funcprototype> - </funcsynopsis> - <simpara> - <function>OCIColumnName</function> returns the name of the column - corresponding to the column number (1-based) that is passed in.</simpara> - - <para> - <example> - <title>OCIColumnName</title> - <programlisting> -<?php - print "<HTML><PRE>\n"; - $conn = OCILogon("scott", "tiger"); - $stmt = OCIParse($conn,"select * from emp"); - OCIExecute($stmt); - print "<TABLE BORDER=\"1\">"; - print "<TR>"; - print "<TH>Name</TH>"; - print "<TH>Type</TH>"; - print "<TH>Length</TH>"; - print "</TR>"; - $ncols = OCINumCols($stmt); - for ( $i = 1; $i <= $ncols; $i++ ) { - $column_name = OCIColumnName($stmt,$i); - $column_type = OCIColumnType($stmt,$i); - $column_size = OCIColumnSize($stmt,$i); - print "<TR>"; - print "<TD>$column_name</TD>"; - print "<TD>$column_type</TD>"; - print "<TD>$column_size</TD>"; - print "</TR>"; - } - OCIFreeStatement($stmt); - OCILogoff($conn); - print "</PRE>"; - print "</HTML>\n"; -?> - </programlisting> - </example> - </para> - <simpara> - See also <function>OCINumCols</function>, <function>OCIColumnType</function>, - and <function>OCIColumnSize</function>.</simpara> - </refsect1> - </refentry> - - <refentry id="function.ocicolumntype"> - <refnamediv> - <refname>OCIColumnType</refname> - <refpurpose>Returns the data type of a column.</refpurpose> - </refnamediv> - <refsect1> - <title>Description</title> - <funcsynopsis> - <funcprototype> - <funcdef>mixed <function>OCIColumnType</function></funcdef> - <paramdef>int <parameter>stmt</parameter></paramdef> - <paramdef>int <parameter>col</parameter></paramdef> - </funcprototype> - </funcsynopsis> - <simpara> - <function>OCIColumnType</function> returns the data type of the column - corresponding to the column number (1-based) that is passed in.</simpara> - <para> - <example> - <title>OCIColumnType</title> - <programlisting> -<?php - print "<HTML><PRE>\n"; - $conn = OCILogon("scott", "tiger"); - $stmt = OCIParse($conn,"select * from emp"); - OCIExecute($stmt); - print "<TABLE BORDER=\"1\">"; - print "<TR>"; - print "<TH>Name</TH>"; - print "<TH>Type</TH>"; - print "<TH>Length</TH>"; - print "</TR>"; - $ncols = OCINumCols($stmt); - for ( $i = 1; $i <= $ncols; $i++ ) { - $column_name = OCIColumnName($stmt,$i); - $column_type = OCIColumnType($stmt,$i); - $column_size = OCIColumnSize($stmt,$i); - print "<TR>"; - print "<TD>$column_name</TD>"; - print "<TD>$column_type</TD>"; - print "<TD>$column_size</TD>"; - print "</TR>"; - } - OCIFreeStatement($stmt); - OCILogoff($conn); - print "</PRE>"; - print "</HTML>\n"; -?> - </programlisting> - </example> + <function>OCIFreeDesc</function> returns true if successful, or + false if unsuccessful. </para> - <simpara> - See also <function>OCINumCols</function>, <function>OCIColumnName</function>, - and <function>OCIColumnSize</function>.</simpara> - </refsect1> </refentry> + <refentry id="function.ociparse"> <refnamediv> <refname>OCIParse</refname> @@ -1423,10 +1455,11 @@ </funcprototype> </funcsynopsis> <simpara> - <function>OCIParse</function> parses the <parameter>query</parameter> - using <parameter>conn</parameter>. It returns the statement - identity if the query is valid, false if not. The - <parameter>query</parameter> can be any valid SQL statement. + <function>OCIParse</function> parses the + <parameter>query</parameter> using <parameter>conn</parameter>. + It returns the statement identity if the query is valid, false if + not. The <parameter>query</parameter> can be any valid SQL + statement. </simpara> </refsect1> </refentry> @@ -1477,8 +1510,10 @@ </funcprototype> </funcsynopsis> <simpara> - <function>OCIInternalDebug</function> enables internal debug output. Set <parameter>onoff</parameter> - to 0 to turn debug output off, 1 to turn it on.</simpara> + <function>OCIInternalDebug</function> enables internal debug + output. Set <parameter>onoff</parameter> to 0 to turn debug + output off, 1 to turn it on. + </simpara> </refsect1> </refentry> </reference> Index: phpdoc/nl/functions/sockets.xml diff -u phpdoc/nl/functions/sockets.xml:1.1 phpdoc/nl/functions/sockets.xml:1.2 --- phpdoc/nl/functions/sockets.xml:1.1 Tue Oct 10 15:07:53 2000 +++ phpdoc/nl/functions/sockets.xml Tue Nov 7 15:11:07 2000 @@ -397,6 +397,42 @@ </refsect1> </refentry> + <refentry id="function.read"> + <refnamediv> + <refname>read</refname> + <refpurpose>Read from a socket</refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcprototype> + <funcdef>int <function>read</function></funcdef> + <paramdef>int <parameter>socket_des</parameter></paramdef> + <paramdef>string <parameter>&buffer</parameter></paramdef> + <paramdef>int <parameter>length</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + The function <function>read</function> reads from socket + <parameter>socket_des</parameter>created by the + <function>accept_connect</function> function into + <parameter>&buffer</parameter> the number of bytes set by + <parameter>length</parameter>. Otherwise you can use \n, \t or \0 to + end reading. Returns number of bytes that have been read. + </para> + <para> + See also + <function>accept_connect</function>, + <function>bind</function>, + <function>connect</function>, + <function>listen</function>, + <function>strerror</function>, + <function>socket_get_status</function>. and + <function>write</function>. + </para> + </refsect1> + </refentry> + <refentry id="function.socket"> <refnamediv> <refname>socket</refname> @@ -508,6 +544,40 @@ <function>connect</function>, <function>listen</function>, <function>socket</function>, and + <function>socket_get_status</function>. + </para> + </refsect1> + </refentry> + + <refentry id="function.write"> + <refnamediv> + <refname>write</refname> + <refpurpose>Write to a socket</refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcprototype> + <funcdef>int <function>write</function></funcdef> + <paramdef>int <parameter>socket_des</parameter></paramdef> + <paramdef>string <parameter>&buffer</parameter></paramdef> + <paramdef>int <parameter>length</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + The function <function>write</function> writes to the socket + <parameter>socket_des</parameter> from + <parameter>&buffer</parameter> the number of bytes set by + <parameter>length</parameter>. + </para> + <para> + See also + <function>accept_connect</function>, + <function>bind</function>, + <function>connect</function>, + <function>listen</function>, + <function>read</function>, + <function>strerror</function>, and <function>socket_get_status</function>. </para> </refsect1> Index: phpdoc/nl/functions/swf.xml diff -u phpdoc/nl/functions/swf.xml:1.1 phpdoc/nl/functions/swf.xml:1.2 --- phpdoc/nl/functions/swf.xml:1.1 Tue Oct 10 15:07:53 2000 +++ phpdoc/nl/functions/swf.xml Tue Nov 7 15:11:07 2000 @@ -68,7 +68,7 @@ swf_enddoaction (); swf_closefile (); -?> +?> </programlisting> </example> It will produce the animation found at the following <ulink @@ -78,6 +78,11 @@ <para> SWF support was added in PHP 4 RC2. </para> + <para> + The libswf does not have support for Windows. The development of + that library has been stopped, and the source is not available + to port it to another systems. + </para> </note> </partintro> @@ -231,7 +236,7 @@ @mysql_free_result ($sth); @mysql_close ($dbh); } -?> +> </programlisting> </example> </para> @@ -1510,12 +1515,12 @@ <itemizedlist> <listitem> <simpara> - Aheight - The height in pixels of a capital A. + Aheight - The height in pixels of a capital A. </simpara> </listitem> <listitem> <simpara> - xheight - The height in pixels of a lowercase x. + xheight - The height in pixels of a lowercase x. </simpara> </listitem> </itemizedlist> @@ -1634,17 +1639,17 @@ <itemizedlist> <listitem> <simpara> - "size" - The size in bytes of the bitmap. + "size" - The size in bytes of the bitmap. </simpara> </listitem> <listitem> <simpara> - "width" - The width in pixels of the bitmap. + "width" - The width in pixels of the bitmap. </simpara> </listitem> <listitem> <simpara> - "height" - The height in pixels of the bitmap. + "height" - The height in pixels of the bitmap. </simpara> </listitem> </itemizedlist> @@ -1812,42 +1817,42 @@ <itemizedlist> <listitem> <simpara> - IdletoOverUp + IdletoOverUp </simpara> </listitem> <listitem> <simpara> - OverUptoIdle + OverUptoIdle </simpara> </listitem> <listitem> <simpara> - OverUptoOverDown + OverUptoOverDown </simpara> </listitem> <listitem> <simpara> - OverDowntoOverUp + OverDowntoOverUp </simpara> </listitem> <listitem> <simpara> - IdletoOverDown + IdletoOverDown </simpara> </listitem> <listitem> <simpara> - OutDowntoIdle + OutDowntoIdle </simpara> </listitem> <listitem> <simpara> - MenuEnter (IdletoOverUp|IdletoOverDown) + MenuEnter (IdletoOverUp|IdletoOverDown) </simpara> </listitem> <listitem> <simpara> - MenuExit (OverUptoIdle|OverDowntoIdle) + MenuExit (OverUptoIdle|OverDowntoIdle) </simpara> </listitem> </itemizedlist> @@ -1855,47 +1860,47 @@ <itemizedlist> <listitem> <simpara> - IdletoOverUp + IdletoOverUp </simpara> </listitem> <listitem> <simpara> - OverUptoIdle + OverUptoIdle </simpara> </listitem> <listitem> <simpara> - OverUptoOverDown + OverUptoOverDown </simpara> </listitem> <listitem> <simpara> - OverDowntoOverUp + OverDowntoOverUp </simpara> </listitem> <listitem> <simpara> - OverDowntoOutDown + OverDowntoOutDown </simpara> </listitem> <listitem> <simpara> - OutDowntoOverDown + OutDowntoOverDown </simpara> </listitem> <listitem> <simpara> - OutDowntoIdle + OutDowntoIdle </simpara> </listitem> <listitem> <simpara> - ButtonEnter (IdletoOverUp|OutDowntoOverDown) + ButtonEnter (IdletoOverUp|OutDowntoOverDown) </simpara> </listitem> <listitem> <simpara> - ButtonExit (OverUptoIdle|OverDowntoOutDown) + ButtonExit (OverUptoIdle|OverDowntoOutDown) </simpara> </listitem> </itemizedlist> Index: phpdoc/nl/functions/var.xml diff -u phpdoc/nl/functions/var.xml:1.1 phpdoc/nl/functions/var.xml:1.2 --- phpdoc/nl/functions/var.xml:1.1 Tue Oct 10 15:07:54 2000 +++ phpdoc/nl/functions/var.xml Tue Nov 7 15:11:07 2000 @@ -124,12 +124,17 @@ <simpara>"resource"</simpara> </listitem> <listitem> - <simpara>"user function"</simpara> + <simpara>"user function" (PHP 3 only, deprecated)</simpara> </listitem> <listitem> <simpara>"unknown type"</simpara> </listitem> </itemizedlist> + </para> + <para> + For PHP 4, you should use <function>function_exists</function> and + <function>method_exists</function> to replace the prior usage of + <function>gettype</function> on a function. </para> <para> See also <function>settype</function>. Index: phpdoc/nl/functions/xml.xml diff -u phpdoc/nl/functions/xml.xml:1.1 phpdoc/nl/functions/xml.xml:1.2 --- phpdoc/nl/functions/xml.xml:1.1 Tue Oct 10 15:07:54 2000 +++ phpdoc/nl/functions/xml.xml Tue Nov 7 15:11:07 2000 @@ -24,8 +24,8 @@ default, you can use this make rule for that: <programlisting role="makefile"> libexpat.a: $(OBJS) - ar -rc $@ $(OBJS) - ranlib $@ + ar -rc $@ $(OBJS) + ranlib $@ </programlisting> A source RPM package of expat can be found at <ulink url="&url.expat.rpm;">&url.expat.rpm;</ulink>. @@ -77,84 +77,84 @@ <table> <title>Supported XML handlers</title> <tgroup cols="2"> - <thead> - <row> - <entry>PHP function to set handler</entry> - <entry>Event description</entry> - </row> - </thead> - <tbody> - <row> - <entry><function>xml_set_element_handler</function></entry> - <entry> - Element events are issued whenever the XML parser - encounters start or end tags. There are separate handlers - for start tags and end tags. - </entry> - </row> - <row> - <entry> - <function>xml_set_character_data_handler</function> - </entry> - <entry> - Character data is roughly all the non-markup contents of - XML documents, including whitespace between tags. Note - that the XML parser does not add or remove any whitespace, - it is up to the application (you) to decide whether - whitespace is significant. - </entry> - </row> - <row> - <entry> - <function>xml_set_processing_instruction_handler</function> - </entry> - <entry> - PHP programmers should be familiar with processing - instructions (PIs) already. <?php ?> is a processing - instruction, where <replaceable>php</replaceable> is called - the "PI target". The handling of these are - application-specific, except that all PI targets starting - with "XML" are reserved. - </entry> - </row> - <row> - <entry><function>xml_set_default_handler</function></entry> - <entry> - What goes not to another handler goes to the default - handler. You will get things like the XML and document - type declarations in the default handler. - </entry> - </row> - <row> - <entry> - <function>xml_set_unparsed_entity_decl_handler</function> - </entry> - <entry> - This handler will be called for declaration of an unparsed - (NDATA) entity. - </entry> - </row> - <row> - <entry> - <function>xml_set_notation_decl_handler</function> - </entry> - <entry> - This handler is called for declaration of a notation. - </entry> - </row> - <row> - <entry> - <function>xml_set_external_entity_ref_handler</function> - </entry> - <entry> - This handler is called when the XML parser finds a - reference to an external parsed general entity. This can - be a reference to a file or URL, for example. See <link - linkend="example.xml-external-entity">the external entity - example</link> for a demonstration. - </entry> - </row> - </tbody> + <thead> + <row> + <entry>PHP function to set handler</entry> + <entry>Event description</entry> + </row> + </thead> + <tbody> + <row> + <entry><function>xml_set_element_handler</function></entry> + <entry> + Element events are issued whenever the XML parser + encounters start or end tags. There are separate handlers + for start tags and end tags. + </entry> + </row> + <row> + <entry> + <function>xml_set_character_data_handler</function> + </entry> + <entry> + Character data is roughly all the non-markup contents of + XML documents, including whitespace between tags. Note + that the XML parser does not add or remove any whitespace, + it is up to the application (you) to decide whether + whitespace is significant. + </entry> + </row> + <row> + <entry> + <function>xml_set_processing_instruction_handler</function> + </entry> + <entry> + PHP programmers should be familiar with processing + instructions (PIs) already. <?php ?> is a processing + instruction, where <replaceable>php</replaceable> is called + the "PI target". The handling of these are + application-specific, except that all PI targets starting + with "XML" are reserved. + </entry> + </row> + <row> + <entry><function>xml_set_default_handler</function></entry> + <entry> + What goes not to another handler goes to the default + handler. You will get things like the XML and document + type declarations in the default handler. + </entry> + </row> + <row> + <entry> + <function>xml_set_unparsed_entity_decl_handler</function> + </entry> + <entry> + This handler will be called for declaration of an unparsed + (NDATA) entity. + </entry> + </row> + <row> + <entry> + <function>xml_set_notation_decl_handler</function> + </entry> + <entry> + This handler is called for declaration of a notation. + </entry> + </row> + <row> + <entry> + <function>xml_set_external_entity_ref_handler</function> + </entry> + <entry> + This handler is called when the XML parser finds a + reference to an external parsed general entity. This can + be a reference to a file or URL, for example. See <link + linkend="example.xml-external-entity">the external entity + example</link> for a demonstration. + </entry> + </row> + </tbody> </tgroup> </table> </para> @@ -313,29 +313,29 @@ <example> <title>Map XML to HTML</title> <para> - This example maps tags in an XML document directly to HTML - tags. Elements not found in the "map array" are ignored. Of - course, this example will only work with a specific XML - document type. - <programlisting role="php"> + This example maps tags in an XML document directly to HTML + tags. Elements not found in the "map array" are ignored. Of + course, this example will only work with a specific XML + document type. + <programlisting role="php"> $file = "data.xml"; $map_array = array( - "BOLD" => "B", - "EMPHASIS" => "I", - "LITERAL" => "TT" + "BOLD" => "B", + "EMPHASIS" => "I", + "LITERAL" => "TT" ); function startElement($parser, $name, $attrs) { global $map_array; if ($htmltag = $map_array[$name]) { - print "<$htmltag>"; + print "<$htmltag>"; } } function endElement($parser, $name) { global $map_array; if ($htmltag = $map_array[$name]) { - print "</$htmltag>"; + print "</$htmltag>"; } } @@ -360,7 +360,7 @@ } } xml_parser_free($xml_parser); - </programlisting> + </programlisting> </para> </example> </para> @@ -501,7 +501,7 @@ print "parse complete\n"; xml_parser_free($xml_parser); -?> +?> </programlisting> </example> </para> @@ -509,33 +509,33 @@ <example> <title>xmltest.xml</title> <programlisting role="xml"> -<?xml version='1.0'?> +<?xml version='1.0'?> <!DOCTYPE chapter SYSTEM "/just/a/test.dtd" [ -<!ENTITY plainEntity "FOO entity"> -<!ENTITY systemEntity SYSTEM "xmltest2.xml"> -]> -<chapter> - <TITLE>Title &plainEntity;</TITLE> - <para> - <informaltable> - <tgroup cols="3"> - <tbody> - <row><entry>a1</entry><entry morerows="1">b1</entry><entry>c1</entry></row> - <row><entry>a2</entry><entry>c2</entry></row> - <row><entry>a3</entry><entry>b3</entry><entry>c3</entry></row> - </tbody> - </tgroup> - </informaltable> - </para> +<!ENTITY plainEntity "FOO entity"> +<!ENTITY systemEntity SYSTEM "xmltest2.xml"> +]> +<chapter> + <TITLE>Title &plainEntity;</TITLE> + <para> + <informaltable> + <tgroup cols="3"> + <tbody> + <row><entry>a1</entry><entry morerows="1">b1</entry><entry>c1</entry></row> + <row><entry>a2</entry><entry>c2</entry></row> + <row><entry>a3</entry><entry>b3</entry><entry>c3</entry></row> + </tbody> + </tgroup> + </informaltable> + </para> &systemEntity; - <sect1 id="about"> - <title>About this Document</title> - <para> - <!-- this is a comment --> - <?php print 'Hi! This is PHP version '.phpversion(); ?> - </para> - </sect1> -</chapter> + <sect1 id="about"> + <title>About this Document</title> + <para> + <!-- this is a comment --> + <?php print 'Hi! This is PHP version '.phpversion(); ?> + </para> + </sect1> +</chapter> </programlisting> </example> </para> @@ -544,15 +544,15 @@ <example> <title>xmltest2.xml</title> <programlisting role="xml"> -<?xml version="1.0"?> +<?xml version="1.0"?> <!DOCTYPE foo [ -<!ENTITY testEnt "test entity"> -]> -<foo> - <element attrib="value"/> +<!ENTITY testEnt "test entity"> +]> +<foo> + <element attrib="value"/> &testEnt; - <?php print "This is some more PHP code being executed."; ?> -</foo> + <?php print "This is some more PHP code being executed."; ?> +</foo> </programlisting> </example> </para> @@ -580,15 +580,15 @@ <varlistentry> <term><parameter>encoding</parameter> (optional)</term> <listitem> - <para> - Which character encoding the parser should use. The - following character encodings are supported: - <simplelist> - <member><literal>ISO-8859-1</literal> (default)</member> - <member><literal>US-ASCII</literal></member> - <member><literal>UTF-8</literal></member> - </simplelist> - </para> + <para> + Which character encoding the parser should use. The + following character encodings are supported: + <simplelist> + <member><literal>ISO-8859-1</literal> (default)</member> + <member><literal>US-ASCII</literal></member> + <member><literal>UTF-8</literal></member> + </simplelist> + </para> </listitem> </varlistentry> </variablelist> @@ -625,14 +625,14 @@ var $parser; function xml() { - $this->parser = xml_parser_create(); - xml_set_object($this->parser,&$this); - xml_set_element_handler($this->parser,"tag_open","tag_close"); - xml_set_character_data_handler($this->parser,"cdata"); + $this->parser = xml_parser_create(); + xml_set_object($this->parser,&$this); + xml_set_element_handler($this->parser,"tag_open","tag_close"); + xml_set_character_data_handler($this->parser,"cdata"); } function parse($data) { - xml_parse($this->parser,$data); + xml_parse($this->parser,$data); } function tag_open($parser,$tag,$attributes) { @@ -650,8 +650,8 @@ } // end of class xml $xml_parser = new xml(); -$xml_parser->parse("<A ID=\"hallo\">PHP</A>"); -?> +$xml_parser->parse("<A ID=\"hallo\">PHP</A>"); +?> </programlisting> </refsect1> </refentry> @@ -701,43 +701,43 @@ <varlistentry> <term><parameter>parser</parameter></term> <listitem> - <simpara> - The first parameter, <replaceable>parser</replaceable>, is a - reference to the XML parser calling the - handler. - </simpara> + <simpara> + The first parameter, <replaceable>parser</replaceable>, is a + reference to the XML parser calling the + handler. + </simpara> </listitem> </varlistentry> <varlistentry> <term><parameter>name</parameter></term> <listitem> - <simpara> - The second parameter, <parameter>name</parameter>, contains - the name of the element for which this handler is called. If - <link linkend="xml.case-folding">case-folding</link> is in - effect for this parser, the element name will be in uppercase - letters. - </simpara> + <simpara> + The second parameter, <parameter>name</parameter>, contains + the name of the element for which this handler is called. If + <link linkend="xml.case-folding">case-folding</link> is in + effect for this parser, the element name will be in uppercase + letters. + </simpara> </listitem> </varlistentry> <varlistentry> <term><parameter>attribs</parameter></term> <listitem> - <simpara> - The third parameter, <parameter>attribs</parameter>, contains - an associative array with the element's attributes (if any). - The keys of this array are the attribute names, the values - are the attribute values. Attribute names are <link - linkend="xml.case-folding">case-folded</link> on the same - criteria as element names. Attribute values are - <emphasis>not</emphasis> case-folded. - </simpara> - <simpara> - The original order of the attributes can be retrieved by - walking through <parameter>attribs</parameter> the normal - way, using <function>each</function>. The first key in the - array was the first attribute, and so on. - </simpara> + <simpara> + The third parameter, <parameter>attribs</parameter>, contains + an associative array with the element's attributes (if any). + The keys of this array are the attribute names, the values + are the attribute values. Attribute names are <link + linkend="xml.case-folding">case-folded</link> on the same + criteria as element names. Attribute values are + <emphasis>not</emphasis> case-folded. + </simpara> + <simpara> + The original order of the attributes can be retrieved by + walking through <parameter>attribs</parameter> the normal + way, using <function>each</function>. The first key in the + array was the first attribute, and so on. + </simpara> </listitem> </varlistentry> </variablelist> @@ -756,23 +756,23 @@ <varlistentry> <term><parameter>parser</parameter></term> <listitem> - <simpara> - The first parameter, <replaceable>parser</replaceable>, is a - reference to the XML parser calling the - handler. - </simpara> + <simpara> + The first parameter, <replaceable>parser</replaceable>, is a + reference to the XML parser calling the + handler. + </simpara> </listitem> </varlistentry> <varlistentry> <term><parameter>name</parameter></term> <listitem> - <simpara> - The second parameter, <parameter>name</parameter>, contains - the name of the element for which this handler is called. If - <link linkend="xml.case-folding">case-folding</link> is in - effect for this parser, the element name will be in uppercase - letters. - </simpara> + <simpara> + The second parameter, <parameter>name</parameter>, contains + the name of the element for which this handler is called. If + <link linkend="xml.case-folding">case-folding</link> is in + effect for this parser, the element name will be in uppercase + letters. + </simpara> </listitem> </varlistentry> </variablelist> @@ -829,19 +829,19 @@ <varlistentry> <term><parameter>parser</parameter></term> <listitem> - <simpara> - The first parameter, <replaceable>parser</replaceable>, is a - reference to the XML parser calling the handler. - </simpara> + <simpara> + The first parameter, <replaceable>parser</replaceable>, is a + reference to the XML parser calling the handler. + </simpara> </listitem> </varlistentry> <varlistentry> <term><parameter>data</parameter></term> <listitem> - <simpara> - The second parameter, <parameter>data</parameter>, contains - the character data as a string. - </simpara> + <simpara> + The second parameter, <parameter>data</parameter>, contains + the character data as a string. + </simpara> </listitem> </varlistentry> </variablelist></para> @@ -923,14 +923,14 @@ <varlistentry> <term><parameter>target</parameter></term> <listitem><simpara> - The second parameter, <parameter>target</parameter>, contains - the PI target.</simpara></listitem> + The second parameter, <parameter>target</parameter>, contains + the PI target.</simpara></listitem> </varlistentry> <varlistentry> <term><parameter>data</parameter></term> <listitem><simpara> - The third parameter, <parameter>data</parameter>, contains - the PI data.</simpara></listitem> + The third parameter, <parameter>data</parameter>, contains + the PI data.</simpara></listitem> </varlistentry> </variablelist></para> <para> @@ -984,27 +984,27 @@ <variablelist> <varlistentry> <term> - <parameter>parser</parameter> + <parameter>parser</parameter> </term> <listitem> - <simpara> - The first parameter, <replaceable>parser</replaceable>, is a - reference to the XML parser calling the - handler. - </simpara> + <simpara> + The first parameter, <replaceable>parser</replaceable>, is a + reference to the XML parser calling the + handler. + </simpara> </listitem> </varlistentry> <varlistentry> <term> - <parameter>data</parameter> + <parameter>data</parameter> </term> <listitem> - <simpara> - The second parameter, <parameter>data</parameter>, contains - the character data. This may be the XML declaration, - document type declaration, entities or other data for which - no other handler exists. - </simpara> + <simpara> + The second parameter, <parameter>data</parameter>, contains + the character data. This may be the XML declaration, + document type declaration, entities or other data for which + no other handler exists. + </simpara> </listitem> </varlistentry> </variablelist> @@ -1080,54 +1080,54 @@ <varlistentry> <term><parameter>parser</parameter></term> <listitem> - <simpara> - The first parameter, <replaceable>parser</replaceable>, is a - reference to the XML parser calling the - handler. - </simpara> + <simpara> + The first parameter, <replaceable>parser</replaceable>, is a + reference to the XML parser calling the + handler. + </simpara> </listitem> </varlistentry> <varlistentry> <term><parameter>entityName</parameter></term> <listitem> - <simpara> - The name of the entity that is about to be defined. - </simpara> + <simpara> + The name of the entity that is about to be defined. + </simpara> </listitem> </varlistentry> <varlistentry> <term><parameter>base</parameter></term> <listitem><simpara> - This is the base for resolving the system identifier - (<parameter>systemId</parameter>) of the external - entity. Currently this parameter will always be set to - an empty string. - </simpara> + This is the base for resolving the system identifier + (<parameter>systemId</parameter>) of the external + entity. Currently this parameter will always be set to + an empty string. + </simpara> </listitem> </varlistentry> <varlistentry> <term><parameter>systemId</parameter></term> <listitem> - <simpara> - System identifier for the external entity. - </simpara> + <simpara> + System identifier for the external entity. + </simpara> </listitem> </varlistentry> <varlistentry> <term><parameter>publicId</parameter></term> <listitem> - <simpara> - Public identifier for the external entity. - </simpara> + <simpara> + Public identifier for the external entity. + </simpara> </listitem> </varlistentry> <varlistentry> <term><parameter>notationName</parameter></term> <listitem> - <simpara> - Name of the notation of this entity (see - <function>xml_set_notation_decl_handler</function>). - </simpara> + <simpara> + Name of the notation of this entity (see + <function>xml_set_notation_decl_handler</function>). + </simpara> </listitem> </varlistentry> </variablelist></para> @@ -1194,56 +1194,56 @@ <variablelist> <varlistentry> <term> - <parameter>parser</parameter> + <parameter>parser</parameter> </term> <listitem> - <simpara> - The first parameter, <replaceable>parser</replaceable>, is a - reference to the XML parser calling the - handler. - </simpara> + <simpara> + The first parameter, <replaceable>parser</replaceable>, is a + reference to the XML parser calling the + handler. + </simpara> </listitem> </varlistentry> <varlistentry> <term><parameter>notationName</parameter></term> <listitem> - <simpara> - This is the notation's <parameter>name</parameter>, as per - the notation format described above. - </simpara> + <simpara> + This is the notation's <parameter>name</parameter>, as per + the notation format described above. + </simpara> </listitem> </varlistentry> <varlistentry> <term> - <parameter>base</parameter> + <parameter>base</parameter> </term> <listitem> - <simpara> - This is the base for resolving the system identifier - (<parameter>systemId</parameter>) of the notation - declaration. Currently this parameter will always be set to - an empty string. - </simpara> + <simpara> + This is the base for resolving the system identifier + (<parameter>systemId</parameter>) of the notation + declaration. Currently this parameter will always be set to + an empty string. + </simpara> </listitem> </varlistentry> <varlistentry> <term><parameter>systemId</parameter></term> <listitem> - <simpara> - System identifier of the external notation - declaration. - </simpara> + <simpara> + System identifier of the external notation + declaration. + </simpara> </listitem> </varlistentry> <varlistentry> <term> - <parameter>publicId</parameter> + <parameter>publicId</parameter> </term> <listitem> - <simpara> - Public identifier of the external notation - declaration. - </simpara> + <simpara> + Public identifier of the external notation + declaration. + </simpara> </listitem> </varlistentry> </variablelist> @@ -1311,53 +1311,53 @@ <varlistentry> <term><parameter>parser</parameter></term> <listitem> - <simpara> - The first parameter, <replaceable>parser</replaceable>, is a - reference to the XML parser calling the handler. - </simpara> + <simpara> + The first parameter, <replaceable>parser</replaceable>, is a + reference to the XML parser calling the handler. + </simpara> </listitem> </varlistentry> <varlistentry> <term><parameter>openEntityNames</parameter></term> <listitem> - <simpara> - The second parameter, <parameter>openEntityNames</parameter>, - is a space-separated list of the names of the entities that - are open for the parse of this entity (including the name of - the referenced entity). - </simpara> + <simpara> + The second parameter, <parameter>openEntityNames</parameter>, + is a space-separated list of the names of the entities that + are open for the parse of this entity (including the name of + the referenced entity). + </simpara> </listitem> </varlistentry> <varlistentry> <term><parameter>base</parameter></term> <listitem> - <simpara> - This is the base for resolving the system identifier - (<parameter>systemid</parameter>) of the external entity. - Currently this parameter will always be set to an empty - string. - </simpara> + <simpara> + This is the base for resolving the system identifier + (<parameter>systemid</parameter>) of the external entity. + Currently this parameter will always be set to an empty + string. + </simpara> </listitem> </varlistentry> <varlistentry> <term><parameter>systemId</parameter></term> <listitem> - <simpara> - The fourth parameter, <parameter>systemId</parameter>, is the - system identifier as specified in the entity declaration. - </simpara> + <simpara> + The fourth parameter, <parameter>systemId</parameter>, is the + system identifier as specified in the entity declaration. + </simpara> </listitem> </varlistentry> <varlistentry> <term><parameter>publicId</parameter></term> <listitem> - <simpara> - The fifth parameter, <parameter>publicId</parameter>, is the - public identifier as specified in the entity declaration, or - an empty string if none was specified; the whitespace in the - public identifier will have been normalized as required by - the XML spec. - </simpara> + <simpara> + The fifth parameter, <parameter>publicId</parameter>, is the + public identifier as specified in the entity declaration, or + an empty string if none was specified; the whitespace in the + public identifier will have been normalized as required by + the XML spec. + </simpara> </listitem> </varlistentry> </variablelist> @@ -1401,29 +1401,29 @@ <varlistentry> <term><parameter>parser</parameter></term> <listitem> - <simpara> - A reference to the XML parser to use. - </simpara> + <simpara> + A reference to the XML parser to use. + </simpara> </listitem> </varlistentry> <varlistentry> <term><parameter>data</parameter></term> <listitem> - <simpara> - Chunk of data to parse. A document may be parsed piece-wise - by calling <function>xml_parse</function> several times with - new data, as long as the <parameter>isFinal</parameter> - parameter is set and true when the last data is parsed. - </simpara> + <simpara> + Chunk of data to parse. A document may be parsed piece-wise + by calling <function>xml_parse</function> several times with + new data, as long as the <parameter>isFinal</parameter> + parameter is set and true when the last data is parsed. + </simpara> </listitem> </varlistentry> <varlistentry> <term><parameter>isFinal</parameter> (optional)</term> <listitem> - <simpara> - If set and true, <parameter>data</parameter> is the last - piece of data sent in this parse. - </simpara> + <simpara> + If set and true, <parameter>data</parameter> is the last + piece of data sent in this parse. + </simpara> </listitem> </varlistentry> </variablelist> @@ -1464,9 +1464,9 @@ <varlistentry> <term><parameter>parser</parameter></term> <listitem> - <simpara> - A reference to the XML parser to get error code from. - </simpara> + <simpara> + A reference to the XML parser to get error code from. + </simpara> </listitem> </varlistentry> </variablelist> @@ -1498,9 +1498,9 @@ <varlistentry> <term><parameter>code</parameter></term> <listitem> - <simpara> - An error code from <function>xml_get_error_code</function>. - </simpara> + <simpara> + An error code from <function>xml_get_error_code</function>. + </simpara> </listitem> </varlistentry> </variablelist> @@ -1532,9 +1532,9 @@ <varlistentry> <term><parameter>parser</parameter></term> <listitem> - <simpara> - A reference to the XML parser to get line number from. - </simpara> + <simpara> + A reference to the XML parser to get line number from. + </simpara> </listitem> </varlistentry> </variablelist> @@ -1569,9 +1569,9 @@ <varlistentry> <term><parameter>parser</parameter></term> <listitem> - <simpara> - A reference to the XML parser to get column number from. - </simpara> + <simpara> + A reference to the XML parser to get column number from. + </simpara> </listitem> </varlistentry> </variablelist> @@ -1606,9 +1606,9 @@ <varlistentry> <term><parameter>parser</parameter></term> <listitem> - <simpara> - A reference to the XML parser to get byte index from. - </simpara> + <simpara> + A reference to the XML parser to get byte index from. + </simpara> </listitem> </varlistentry> </variablelist> @@ -1637,21 +1637,21 @@ <paramdef>array <parameter>&index</parameter></paramdef> </funcprototype> </funcsynopsis> + <para> + This function parses an XML file into 2 parallel array + structures, one (<parameter>index</parameter>) containing pointers + to the location of the appropriate values in the + <parameter>values</parameter> array. These last two parameters + must be passed by reference. + </para> <para> - This function parses an XML file into 2 parallel array - structures, one (<parameter>index</parameter>) containing pointers - to the location of the appropriate values in the - <parameter>values</parameter> array. These last two parameters - must be passed by reference. - </para> - <para> - Below is an example that illustrates the internal structure of - the arrays being generated by the function. We use a simple - <literal>note</literal> tag embeded inside a - <literal>para</literal> tag, and then we parse this an print out - the structures generated: - <informalexample> - <programlisting> + Below is an example that illustrates the internal structure of + the arrays being generated by the function. We use a simple + <literal>note</literal> tag embeded inside a + <literal>para</literal> tag, and then we parse this an print out + the structures generated: + <informalexample> + <programlisting> $simple = "<para><note>simple note</note></para>"; $p = xml_parser_create(); xml_parse_into_struct($p,$simple,&$vals,&$index); @@ -1660,11 +1660,11 @@ print_r($index); echo "\nVals array\n"; print_r($vals); - </programlisting> - </informalexample> - When we run that code, the output will be: - <informalexample> - <programlisting> + </programlisting> + </informalexample> + When we run that code, the output will be: + <informalexample> + <programlisting> Index array Array ( @@ -1707,93 +1707,93 @@ ) ) - </programlisting> - </informalexample> - </para> - <para> - Event-driven parsing (based on the expat library) can get - complicated when you have an XML document that is complex. - This function does not produce a DOM style object, but it - generates structures amenable of being transversed in a tree - fashion. Thus, we can create objects representing the data - in the XML file easily. Let's consider the following XML file - representing a small database of aminoacids information: - <example> - <title>moldb.xml - small database of molecular information</title> - <programlisting> + </programlisting> + </informalexample> + </para> + <para> + Event-driven parsing (based on the expat library) can get + complicated when you have an XML document that is complex. + This function does not produce a DOM style object, but it + generates structures amenable of being transversed in a tree + fashion. Thus, we can create objects representing the data + in the XML file easily. Let's consider the following XML file + representing a small database of aminoacids information: + <example> + <title>moldb.xml - small database of molecular information</title> + <programlisting> <?xml version="1.0"?> <moldb> - <molecule> - <name>Alanine</name> - <symbol>ala</symbol> - <code>A</code> - <type>hydrophobic</type> - </molecule> - - <molecule> - <name>Lysine</name> - <symbol>lys</symbol> - <code>K</code> - <type>charged</type> - </molecule> + <molecule> + <name>Alanine</name> + <symbol>ala</symbol> + <code>A</code> + <type>hydrophobic</type> + </molecule> + + <molecule> + <name>Lysine</name> + <symbol>lys</symbol> + <code>K</code> + <type>charged</type> + </molecule> </moldb> - </programlisting> - </example> - And some code to parse the document and generate the appropriate - objects: - <example> - <title> - parsemoldb.php - parses moldb.xml into and array of - molecular objects - </title> - <programlisting role="php"> + </programlisting> + </example> + And some code to parse the document and generate the appropriate + objects: + <example> + <title> + parsemoldb.php - parses moldb.xml into and array of + molecular objects + </title> + <programlisting role="php"> <?php class AminoAcid { - var $name; // aa name - var $symbol; // three letter symbol - var $code; // one letter code - var $type; // hydrophobic, charged or neutral - - function AminoAcid ($aa) { - foreach ($aa as $k=>$v) - $this->$k = $aa[$k]; - } + var $name; // aa name + var $symbol; // three letter symbol + var $code; // one letter code + var $type; // hydrophobic, charged or neutral + + function AminoAcid ($aa) { + foreach ($aa as $k=>$v) + $this->$k = $aa[$k]; + } } function readDatabase($filename) { - // read the xml database of aminoacids - $data = implode("",file($filename)); - $parser = xml_parser_create(); - xml_parser_set_option($parser,XML_OPTION_CASE_FOLDING,0); - xml_parser_set_option($parser,XML_OPTION_SKIP_WHITE,1); - xml_parse_into_struct($parser,$data,&$values,&$tags); - xml_parser_free($parser); - - // loop through the structures - foreach ($tags as $key=>$val) { - if ($key == "molecule") { - $molranges = $val; - // each contiguous pair of array entries are the - // lower and upper range for each molecule definition - for ($i=0; $i < count($molranges); $i+=2) { - $offset = $molranges[$i] + 1; - $len = $molranges[$i + 1] - $offset; - $tdb[] = parseMol(array_slice($values, $offset, $len)); - } - } else { - continue; - } - } - return $tdb; + // read the xml database of aminoacids + $data = implode("",file($filename)); + $parser = xml_parser_create(); + xml_parser_set_option($parser,XML_OPTION_CASE_FOLDING,0); + xml_parser_set_option($parser,XML_OPTION_SKIP_WHITE,1); + xml_parse_into_struct($parser,$data,&$values,&$tags); + xml_parser_free($parser); + + // loop through the structures + foreach ($tags as $key=>$val) { + if ($key == "molecule") { + $molranges = $val; + // each contiguous pair of array entries are the + // lower and upper range for each molecule definition + for ($i=0; $i < count($molranges); $i+=2) { + $offset = $molranges[$i] + 1; + $len = $molranges[$i + 1] - $offset; + $tdb[] = parseMol(array_slice($values, $offset, $len)); + } + } else { + continue; + } + } + return $tdb; } function parseMol($mvalues) { - for ($i=0; $i < count($mvalues); $i++) - $mol[$mvalues[$i]["tag"]] = $mvalues[$i]["value"]; - return new AminoAcid($mol); + for ($i=0; $i < count($mvalues); $i++) + $mol[$mvalues[$i]["tag"]] = $mvalues[$i]["value"]; + return new AminoAcid($mol); } $db = readDatabase("moldb.xml"); @@ -1801,14 +1801,14 @@ print_r($db); ?> - </programlisting> - </example> - After executing <filename>parsemoldb.php</filename>, the variable - <varname>$db</varname> contains an array of - <classname>AminoAcid</classname> objects, and the output of the - script confirms that: - <informalexample> - <programlisting> + </programlisting> + </example> + After executing <filename>parsemoldb.php</filename>, the variable + <varname>$db</varname> contains an array of + <classname>AminoAcid</classname> objects, and the output of the + script confirms that: + <informalexample> + <programlisting> ** Database of AminoAcid objects: Array ( @@ -1829,9 +1829,9 @@ ) ) - </programlisting> - </informalexample> - </para> + </programlisting> + </informalexample> + </para> </refsect1> </refentry> @@ -1853,9 +1853,9 @@ <varlistentry> <term><parameter>parser</parameter></term> <listitem> - <simpara> - A reference to the XML parser to free. - </simpara> + <simpara> + A reference to the XML parser to free. + </simpara> </listitem> </varlistentry> </variablelist></para> @@ -1887,25 +1887,25 @@ <varlistentry> <term><parameter>parser</parameter></term> <listitem> - <simpara> - A reference to the XML parser to set an option in. - </simpara> + <simpara> + A reference to the XML parser to set an option in. + </simpara> </listitem> </varlistentry> <varlistentry> <term><parameter>option</parameter></term> <listitem> - <simpara> - Which option to set. See below. - </simpara> + <simpara> + Which option to set. See below. + </simpara> </listitem> </varlistentry> <varlistentry> <term><parameter>value</parameter></term> <listitem> - <simpara> - The option's new value. - </simpara> + <simpara> + The option's new value. + </simpara> </listitem> </varlistentry> </variablelist> @@ -1921,34 +1921,34 @@ <title>XML parser options</title> <tgroup cols="3"> <thead> - <row> - <entry>Option constant</entry> - <entry>Data type</entry> - <entry>Description</entry> - </row> + <row> + <entry>Option constant</entry> + <entry>Data type</entry> + <entry>Description</entry> + </row> </thead> <tbody> - <row> - <entry>XML_OPTION_CASE_FOLDING</entry> - <entry>integer</entry> - <entry> - Controls whether <link - linkend="xml.case-folding">case-folding</link> is enabled - for this XML parser. Enabled by default. - </entry> - </row> - <row> - <entry>XML_OPTION_TARGET_ENCODING</entry> - <entry>string</entry> - <entry> - Sets which <link linkend="xml.encoding">target - encoding</link> to use in this XML parser. By default, it - is set to the same as the source encoding used by - <function>xml_parser_create</function>. Supported target - encodings are <literal>ISO-8859-1</literal>, - <literal>US-ASCII</literal> and <literal>UTF-8</literal>. - </entry> - </row> + <row> + <entry>XML_OPTION_CASE_FOLDING</entry> + <entry>integer</entry> + <entry> + Controls whether <link + linkend="xml.case-folding">case-folding</link> is enabled + for this XML parser. Enabled by default. + </entry> + </row> + <row> + <entry>XML_OPTION_TARGET_ENCODING</entry> + <entry>string</entry> + <entry> + Sets which <link linkend="xml.encoding">target + encoding</link> to use in this XML parser. By default, it + is set to the same as the source encoding used by + <function>xml_parser_create</function>. Supported target + encodings are <literal>ISO-8859-1</literal>, + <literal>US-ASCII</literal> and <literal>UTF-8</literal>. + </entry> + </row> </tbody> </tgroup> </table> @@ -1977,20 +1977,20 @@ <varlistentry> <term><parameter>parser</parameter></term> <listitem> - <simpara> - A reference to the XML parser to get an option - from. - </simpara> + <simpara> + A reference to the XML parser to get an option + from. + </simpara> </listitem> </varlistentry> <varlistentry> <term><parameter>option</parameter></term> <listitem> - <simpara> - Which option to fetch. See - <function>xml_parser_set_option</function> for a list of - options. - </simpara> + <simpara> + Which option to fetch. See + <function>xml_parser_set_option</function> for a list of + options. + </simpara> </listitem> </varlistentry> </variablelist> @@ -2064,33 +2064,33 @@ <title>UTF-8 encoding</title> <tgroup cols="3"> <thead> - <row> - <entry>bytes</entry> - <entry>bits</entry> - <entry>representation</entry> - </row> + <row> + <entry>bytes</entry> + <entry>bits</entry> + <entry>representation</entry> + </row> </thead> <tbody> - <row> - <entry>1</entry> - <entry>7</entry> - <entry>0bbbbbbb</entry> - </row> - <row> - <entry>2</entry> - <entry>11</entry> - <entry>110bbbbb 10bbbbbb</entry> - </row> - <row> - <entry>3</entry> - <entry>16</entry> - <entry>1110bbbb 10bbbbbb 10bbbbbb</entry> - </row> - <row> - <entry>4</entry> - <entry>21</entry> - <entry>11110bbb 10bbbbbb 10bbbbbb 10bbbbbb</entry> - </row> + <row> + <entry>1</entry> + <entry>7</entry> + <entry>0bbbbbbb</entry> + </row> + <row> + <entry>2</entry> + <entry>11</entry> + <entry>110bbbbb 10bbbbbb</entry> + </row> + <row> + <entry>3</entry> + <entry>16</entry> + <entry>1110bbbb 10bbbbbb 10bbbbbb</entry> + </row> + <row> + <entry>4</entry> + <entry>21</entry> + <entry>11110bbb 10bbbbbb 10bbbbbb 10bbbbbb</entry> + </row> </tbody> </tgroup> </table> Index: phpdoc/nl/language/basic-syntax.xml diff -u phpdoc/nl/language/basic-syntax.xml:1.3 phpdoc/nl/language/basic-syntax.xml:1.4 --- phpdoc/nl/language/basic-syntax.xml:1.3 Fri Oct 20 15:44:17 2000 +++ phpdoc/nl/language/basic-syntax.xml Tue Nov 7 15:11:07 2000 @@ -12,24 +12,24 @@ <example> <title>Manieren om PHP te embedden in HTML</title> <programlisting> -1. <? echo ("dit is de makkelijste, als een SGML processing instructie\n"); ?> +1. <? echo ("dit is de makkelijste, als een SGML processing instructie\n"); ?> -2. <?php echo("als je XML documenten wilt publiceren, gebruik dan deze methode\n"); ?> +2. <?php echo("als je XML documenten wilt publiceren, gebruik dan deze methode\n"); ?> -3. <script language="php"> +3. <script language="php"> echo ("sommige editors (zoals FrontPage) gaan slecht met processing instructies om"); - </script> + </script> -4. <% echo ("Optioneel kun je ASP-stijl tags gebruiken"); %> - <%= $variable; # Dit is kort voor: "<%echo .." %> +4. <% echo ("Optioneel kun je ASP-stijl tags gebruiken"); %> + <%= $variable; # Dit is kort voor: "<%echo .." %> </programlisting> </example></para> <para> De als eerste beschreven manier is alleen beschikbaar als "short - tags" zijn aangezet. Dit kan worden gedaan met de - <function>short_tags</function> functie, die aan te zetten is door + tags" zijn aangezet. Dit kan worden gedaan met + <!-- de <function>short_tags</function> functie, die aan te zetten is door--> de <link linkend="ini.short-open-tag">short_open_tag</link> configuratie setting in het PHP configuratie bestand, of door PHP te compileren met de <command>configure</command> optie --enable-short-tags.</para> Index: phpdoc/nl/language/functions.xml diff -u phpdoc/nl/language/functions.xml:1.1 phpdoc/nl/language/functions.xml:1.2 --- phpdoc/nl/language/functions.xml:1.1 Tue Oct 10 15:07:54 2000 +++ phpdoc/nl/language/functions.xml Tue Nov 7 15:11:07 2000 @@ -258,14 +258,14 @@ <para> To return a reference from a function, you have to use the reference operator & in both the function declaration and - when assigning the return value to a variable: + when assigning the returned value to a variable: <informalexample> <programlisting role="php"> function &returns_reference() { - return &$someref; + return $someref; } -$newref = &returns_reference(); +$newref =&returns_reference(); </programlisting> </informalexample> </para>