cvs: phpdoc /nl chapters.ent /nl/chapters install.xml /nl/functions errorfunc.xml imap.xml nis.xml pcre.xml /nl/language control-structures.xml

From: Date: Mon, 20 Nov 2000 18:20:33 +0000
Subject: cvs: phpdoc /nl chapters.ent /nl/chapters install.xml /nl/functions errorfunc.xml imap.xml nis.xml pcre.xml /nl/language control-structures.xml
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969332980@lists.php.net to get a copy of this message
derick Mon Nov 20 10:20:33 2000 EDT Modified files: /phpdoc/nl chapters.ent /phpdoc/nl/chapters install.xml /phpdoc/nl/functions errorfunc.xml imap.xml nis.xml pcre.xml /phpdoc/nl/language control-structures.xml Log: - Updates from English tree

Index: phpdoc/nl/chapters.ent diff -u phpdoc/nl/chapters.ent:1.3 phpdoc/nl/chapters.ent:1.4 --- phpdoc/nl/chapters.ent:1.3 Mon Nov 13 03:12:34 2000 +++ phpdoc/nl/chapters.ent Mon Nov 20 10:20:32 2000 @@ -61,6 +61,7 @@ <!ENTITY reference.image SYSTEM "functions/image.xml"> <!ENTITY reference.imap SYSTEM "functions/imap.xml"> <!ENTITY reference.info SYSTEM "functions/info.xml"> +<!ENTITY reference.ingres_ii SYSTEM "functions/ingres_ii.xml"> <!ENTITY reference.ldap SYSTEM "functions/ldap.xml"> <!ENTITY reference.mail SYSTEM "functions/mail.xml"> <!ENTITY reference.math SYSTEM "functions/math.xml"> Index: phpdoc/nl/chapters/install.xml diff -u phpdoc/nl/chapters/install.xml:1.4 phpdoc/nl/chapters/install.xml:1.5 --- phpdoc/nl/chapters/install.xml:1.4 Fri Oct 27 10:27:55 2000 +++ phpdoc/nl/chapters/install.xml Mon Nov 20 10:20:32 2000 @@ -295,7 +295,7 @@ <sect2 id="install.benchmarking"> <title>Benchmarking</title> <simpara> - If you have built PHP as a CGI program, you may benchmark your + If you have built PHP 3 as a CGI program, you may benchmark your build by typing <command>make bench</command>. Note that if safe mode is on by default, the benchmark may not be able to finish if it takes longer then the 30 seconds allowed. This is because the @@ -306,6 +306,11 @@ scripts. <command>make bench</command> ignores the <link linkend="configuration.file">configuration file</link>. </simpara> + <note> + <simpara> + <command>make bench</command> is only available for PHP 3. + </simpara> + </note> </sect2> </sect1> @@ -618,8 +623,7 @@ <listitem> <para> PHP 3, PHP 4: Include InterBase support. DIR is the InterBase base - install directory, which defaults to - <filename>/usr/interbase</filename>. + install directory, which defaults to <filename>/usr/interbase</filename>. </para> <simpara> <link linkend="ref.ibase">Interbase functions</link> @@ -1542,7 +1546,7 @@ </term> <listitem> <para> - PHP 3, PHP 4: Compile with memory limit support. + PHP 3, PHP 4: Compile with memory limit support. [default=no] </para> </listitem> </varlistentry> @@ -1668,8 +1672,8 @@ <filename>/usr/local/lib</filename> </para> <para> - PHP 4: Sets the path in which to look for <filename>php.ini</filename>. - Defaults to <filename>/usr/local/lib</filename> + PHP 4: Sets the path in which to look for <filename>php.ini</filename>. + Defaults to <filename>/usr/local/lib</filename> </para> </listitem> </varlistentry> @@ -3066,7 +3070,7 @@ </sect2> - <sect2 id="install.windowsnt.installer"> + <sect2 id="install.windows.installer"> <title>Windows Installshield</title> <para> Index: phpdoc/nl/functions/errorfunc.xml diff -u phpdoc/nl/functions/errorfunc.xml:1.1 phpdoc/nl/functions/errorfunc.xml:1.2 --- phpdoc/nl/functions/errorfunc.xml:1.1 Tue Oct 10 15:07:53 2000 +++ phpdoc/nl/functions/errorfunc.xml Mon Nov 20 10:20:32 2000 @@ -317,7 +317,14 @@ </para> <para> The user function needs to accept 2 parameters: the error code, and a - string describing the error. The example below shows the handling of + string describing the error. From PHP 4.0.2, an additional 3 optional + parameters are supplied: the filename in which the error occured, the + line number in which the error occured, and the context in which the + error occured (an array that points to the active symbol table at the + point the error occurred). + </para> + <para> + The example below shows the handling of internal execptions by triggering errors and handling them with a user defined function: <example> @@ -334,46 +341,46 @@ define (WARNING,E_USER_NOTICE); // set the error reporting level for this script -error_reporting (FATAL + ERROR + WARNING); +error_reporting (FATAL | ERROR | WARNING); // error handler function -function myErrorHandler ($errno, $errstr) { - switch ($errno) { - case FATAL: +function myErrorHandler ($errno, $errstr, $errfile, $errline) { + switch ($errno) { + case FATAL: echo &quot;&lt;b&gt;FATAL&lt;/b&gt; [$errno] $errstr&lt;br&gt;\n&quot;; - echo &quot; Fatal error in line &quot;.__LINE__.&quot; of file &quot;.__FILE__; + echo &quot; Fatal error in line &quot;.$errline.&quot; of file &quot;.$errfile; echo &quot;, PHP &quot;.PHP_VERSION.&quot; (&quot;.PHP_OS.&quot;)&lt;br&gt;\n&quot;; echo &quot;Aborting...&lt;br&gt;\n&quot;; exit -1; break; - case ERROR: + case ERROR: echo &quot;&lt;b&gt;ERROR&lt;/b&gt; [$errno] $errstr&lt;br&gt;\n&quot;; break; - case WARNING: + case WARNING: echo &quot;&lt;b&gt;WARNING&lt;/b&gt; [$errno] $errstr&lt;br&gt;\n&quot;; break; default: echo &quot;Unkown error type: [$errno] $errstr&lt;br&gt;\n&quot;; break; - } + } } // function to test the error handling function scale_by_log ($vect, $scale) { - if ( !is_numeric($scale) || $scale &lt;= 0 ) - trigger_error(&quot;log(x) for x &lt;= 0 is undefined, you used: scale = $scale&quot;, + if ( !is_numeric($scale) || $scale &lt;= 0 ) + trigger_error(&quot;log(x) for x &lt;= 0 is undefined, you used: scale = $scale&quot;, FATAL); - if (!is_array($vect)) { + if (!is_array($vect)) { trigger_error(&quot;Incorrect input vector, array of values expected&quot;, ERROR); return null; - } - for ($i=0; $i&lt;count($vect); $i++) { + } + for ($i=0; $i&lt;count($vect); $i++) { if (!is_numeric($vect[$i])) - trigger_error(&quot;Value at position $i is not a number, using 0 (zero)&quot;, - WARNING); + trigger_error(&quot;Value at position $i is not a number, using 0 (zero)&quot;, + WARNING); $temp[$i] = log($scale) * $vect[$i]; - } - return $temp; + } + return $temp; } // set to the user defined error handler @@ -433,10 +440,25 @@ ---- vector d - fatal error &lt;b&gt;FATAL&lt;/b&gt; [256] log(x) for x &lt;= 0 is undefined, you used: scale = -2.5&lt;br&gt; - Fatal error in line 16 of file trigger_error.php, PHP 4.0.1pl2 (Linux)&lt;br&gt; + Fatal error in line 36 of file trigger_error.php, PHP 4.0.2 (Linux)&lt;br&gt; Aborting...&lt;br&gt; </programlisting> </informalexample> + </para> + <para> + It is important to remember that the standard PHP error handler is completely + bypassed. <function>error_reporting</function> settings will have no effect + and your error handler will be called regardless - however you are still + able to read the current value of <function>error_reporting</function> and + act appropriately. Of particular note is that this value will be 0 if the + statement that caused the error was prepended by the + <link linkend="language.operators.errorcontrol">@ error-control + operator</link>. + </para> + <para> + Also note that it is your responsibility to <function>die</function> if + necessary. If the error-handler function returns, script execution + will continue with the next statement after the one that caused an error. </para> <para> See also <function>error_reporting</function>, Index: phpdoc/nl/functions/imap.xml diff -u phpdoc/nl/functions/imap.xml:1.1 phpdoc/nl/functions/imap.xml:1.2 --- phpdoc/nl/functions/imap.xml:1.1 Tue Oct 10 15:07:53 2000 +++ phpdoc/nl/functions/imap.xml Mon Nov 20 10:20:32 2000 @@ -1731,7 +1731,7 @@ print "Deleted: " . $check->Deleted ."&lt;br>\n" ; print "Size: " . $check->Size ."&lt;br>\n" ; } else { - print "imap_check() failed: ".imap_lasterror(). "&lt;br>\n"; + print "imap_check() failed: ".imap_last_error(). "&lt;br>\n"; } imap_close($mbox); Index: phpdoc/nl/functions/nis.xml diff -u phpdoc/nl/functions/nis.xml:1.1 phpdoc/nl/functions/nis.xml:1.2 --- phpdoc/nl/functions/nis.xml:1.1 Tue Oct 10 15:07:53 2000 +++ phpdoc/nl/functions/nis.xml Mon Nov 20 10:20:32 2000 @@ -12,7 +12,8 @@ </para> <para> To get these functions to work, you have to configure PHP with - <option role="configure">--with-yp</option>. + <option role="configure">--with-yp</option>(PHP 3) or + <option role="configure">--enable-yp</option>(PHP 4). </para> </partintro> Index: phpdoc/nl/functions/pcre.xml diff -u phpdoc/nl/functions/pcre.xml:1.1 phpdoc/nl/functions/pcre.xml:1.2 --- phpdoc/nl/functions/pcre.xml:1.1 Tue Oct 10 15:07:53 2000 +++ phpdoc/nl/functions/pcre.xml Mon Nov 20 10:20:32 2000 @@ -315,15 +315,15 @@ matches are replaced. </para> <para> - <parameter>Replacement</parameter> may contain references of the - form <literal>\\<replaceable>n</replaceable></literal>. Every - such reference will be replaced by the text captured by the - <replaceable>n</replaceable>'th parenthesized pattern. + <parameter>Replacement</parameter> may contain references of the form + <literal>\\<replaceable>n</replaceable></literal> or (since PHP 4.0.4) + <literal><replaceable>$n</replaceable></literal>, with the latter form + being the preferred one. Every such reference will be replaced by the text + captured by the <replaceable>n</replaceable>'th parenthesized pattern. <replaceable>n </replaceable>can be from 0 to 99, and - <literal>\\0</literal> refers to the text matched by the whole - pattern. Opening parentheses are counted from left to right - (starting from 1) to obtain the number of the capturing - subpattern. + <literal>\\0</literal> or <literal>$0</literal> refers to the text matched + by the whole pattern. Opening parentheses are counted from left to right + (starting from 1) to obtain the number of the capturing subpattern. </para> <para> If no matches are found in <parameter>subject</parameter>, then @@ -692,7 +692,7 @@ <listitem> <simpara> If this modifier is set, <function>preg_replace</function> - does normal substitution of \\ references in the + does normal substitution of backreferences in the replacement string, evaluates it as PHP code, and uses the result for replacing the search string. </simpara> Index: phpdoc/nl/language/control-structures.xml diff -u phpdoc/nl/language/control-structures.xml:1.8 phpdoc/nl/language/control-structures.xml:1.9 --- phpdoc/nl/language/control-structures.xml:1.8 Sun Nov 12 14:55:50 2000 +++ phpdoc/nl/language/control-structures.xml Mon Nov 20 10:20:32 2000 @@ -849,10 +849,9 @@ </simpara> <para> Al dit betekend dat je niet kunt verwachten dat - <function>require</function> binnen een loop structuur - statement inside of a loop structure and expect it to include the - contents of a different file on each iteration. To do that, use an - <function>include</function> statement. + <function>require</function> binnen een loop structuur per iteratie + een ander besstand kan invoegen. Om zoiets te doen, kun je het + <function>include</function> statement gebruiken. <informalexample> <programlisting role="php"> require ('header.inc'); @@ -860,7 +859,7 @@ </informalexample> </para> <simpara> - When a file is <function>require</function>ed, the code it + Als een bestand is ge<function>require</function>ed, the code it contains inherits the variable scope of the line on which the <function>require</function> occurs. Any variables available at that line in the calling file will be available within the called
« previous php.doc (#969332980) next »