cvs: phpdoc-he /appendices migration4.xml

[email protected] ("Hadar Porat") Thu, 17 Jul 2003 19:16:10 -0000
Newsgroups php.doc.he
Message-ID <cvshadar_p1058469370@cvsserver>
hadar_p		Thu Jul 17 15:16:10 2003 EDT

  Modified files:              
    /phpdoc-he/appendices	migration4.xml 
  Log:
  Updated to latest English version
hadar_p-20030717151610.txt (text/plain, 13 KB)
Index: phpdoc-he/appendices/migration4.xml
diff -u phpdoc-he/appendices/migration4.xml:1.3 phpdoc-he/appendices/migration4.xml:1.4
--- phpdoc-he/appendices/migration4.xml:1.3	Sat May 17 15:40:08 2003
+++ phpdoc-he/appendices/migration4.xml	Thu Jul 17 15:16:10 2003
@@ -1,51 +1,52 @@
 <?xml version="1.0" encoding="WINDOWS-1255"?>
-<!--EN-Revision: 1.20 Maintainer: tal Status: working -->
+<!-- $Revision: 1.4 $ -->
+<!-- HE-Revision: 1.00 Maintainer: hadar_p Status: half-done -->
  <appendix id="migration4">
-  <title>Migrating from PHP 3 to PHP 4</title>
+  <title>îòáø î- PHP 3 àì PHP 4</title>
 	
   <section id='migration4.changes'>
-   <title>What has changed in PHP 4</title>
+   <title>îä äùúðä á- PHP 4</title>
    <para>
-    PHP 4 and the integrated Zend engine have greatly improved PHPs
-    performance and capabilities, but great care has been taken to
-    break as little existing code as possible. So migrating your code
-    from PHP 3 to 4 should be much easier than migrating from
-    PHP/FI 2 to PHP 3. A lot of existing PHP 3 code should be
-    ready to run without changes, but you should still know about the
-    few differences and take care to test your code before switching
-    versions in production environments. The following should give you
-    some hints about what to look for.
+    PHP 4 åäîðåò Zend äàéèâøìé ùéôøå áàåôï îùîòåúé ùì áéöåòé
+    åéëåìåú ùì PHP, àáì æäéøåú îéøáéú ðì÷çä áçùáåï ìùáåø ëîä
+    ùôçåú ÷åã ùàôùø. ìëï, îòáø ä÷åã ùìê î- PHP 3 àì PHP 4 öøéê
+    ìäéåú ÷ì äøáä éåúø îàùø îòáø î- PHP/FI 2 àì PHP 3. øåá ä÷åã
+    ä÷ééí ùì PHP 3 öøéê ìäéåú îåëï ììà ùéðåééí, àáì àúä òãééå öøéê
+    ìãòú òì îòè ääáãìéí ìãàåâ ìáãå÷ àú ä÷åã ùìê ìôðé äçìôú äâøñàåú
+    áúåê äùøú ùìê. äîéãò äáà öøéê ìúú ìê îñôø òöåú îä ìçôù.
+
    </para>
   </section>
 
   <section id="migration4.php4.with.php3">
-   <title>Running PHP 3 and PHP 4 concurrently</title>
+   <title>äøöú PHP 3 å- PHP áå-æîðéú</title>
    <simpara>
-    Recent operating systems provide the ability to perform
-    versioning and scoping. This features make it possible to let
-    PHP 3 and PHP 4 run as concurrent modules in one Apache server.
+    îòøëåú äôòìä àçøåðåú ñéô÷å àú äéëåìú ìáöò äôøãú âøñàåú.
+    úëåðä æàú îàôùøú ì- PHP 3 åì- PHP 4 ìøåõ ëîåãåìéí áå-æîðéú 
+    áùøú Apache éçéã.
    </simpara>
    <simpara>
-    This feature is known to work on the following platforms: 
+    úëåðä æàú ðáã÷ä òì äôìèôåøîåú äáàåú:
    </simpara>
    <itemizedlist>
-     <listitem><simpara>Linux with recent binutils (binutils 2.9.1.0.25 tested) </simpara></listitem>
-     <listitem><simpara>Solaris 2.5 or better</simpara></listitem>
-     <listitem><simpara>FreeBSD (3.2, 4.0 tested)</simpara></listitem>
+     <listitem><simpara>Linux òí binutils äàçøåðéí (binutils 2.9.1.0.25 ðáã÷å) </simpara></listitem>
+     <listitem><simpara>Solaris 2.5 àå çãù éåúø</simpara></listitem>
+     <listitem><simpara>FreeBSD (3.2, 4.0 ðáã÷å)</simpara></listitem>
    </itemizedlist>
    <para>
-    To enable it, configure PHP3 and PHP4 to use APXS
-    (--with-apxs) and the necessary link extensions
-    (--enable-versioning). Otherwise, all standard installations
-    instructions apply. For example:
+    òì îðú ìäôòéì æàú, äâãø PHP3 å- PHP4 ìäùúîù á- APXS
+    (--with-apxs) åúåñôåú ä÷éùåøéí äçéåðééí (--enable-versioning).
+    àçøú, äåøàåú ääú÷ðä äøâéìåú éçåìå. ìãåâîà,
     <informalexample>
      <programlisting role="configure">
 <![CDATA[
+<div dir="ltr">
 $ ./configure \
   --with-apxs=/apache/bin/apxs \
   --enable-versioning \
   --with-mysql \
   --enable-track-vars
+</div>
 ]]>
 		 </programlisting>
 		</informalexample>
@@ -53,69 +54,90 @@
   </section>
 
   <section id="migration4.configuration">
-   <title>Migrating Configuration Files</title>
+   <title>îòáø ùì ÷áöé ääâãøåú</title>
    <para>
-    The global configuration file, <filename>php3.ini</filename>,
-    has changed its name to <filename>php.ini</filename>.
+    ÷åáõ ääâãøåú äâìåáìé, <filename>php3.ini</filename>,
+    ùéðä àú ùîå àì &php.ini;.
    </para>
    <para>
-    For the Apache configuration file, there are slightly more
-    changes. The MIME types recognized by the PHP module have
-    changed.
+    ì÷åáõ ääâãøåú ùì Apache, éùðí ÷öú éåúø ùéðåééí.
+    ñåâé ä- MINE äîåëøéí ò"é îåãåì ä- PHP äùúðå.
     <informalexample>
 		 <programlisting role="apache">
 <![CDATA[
+<div dir="ltr">
 application/x-httpd-php3        -->    application/x-httpd-php
 application/x-httpd-php3-source -->    application/x-httpd-php-source
+</div>
 ]]>
 		 </programlisting>
 		</informalexample>
    </para>
    <para>
-    You can make your configuration files work with both versions
-    of PHP (depending on which one is currently compiled into the
-    server), using the following syntax:
+    àúä éëåì ìäùúîù á÷áöé ääâãøåì ùìê ùéòáãå òí ùðé âøñàåú ä- PHP
+    (æä úìåé áàéæä àçã äî÷åîôì ìúåê äùøú), áòæøú äúçáéø äáà:
     <informalexample>
 		 <programlisting>
 <![CDATA[
+<div dir="ltr">
 AddType  application/x-httpd-php3        .php3
 AddType  application/x-httpd-php3-source .php3s
 
 AddType  application/x-httpd-php         .php
 AddType  application/x-httpd-php-source  .phps
+</div>
 ]]>
      </programlisting>
 		</informalexample>
    </para>
    <simpara>
-    In addition,  the PHP directive names for Apache have changed.
+    áðåñó, ùîåú ääðçéåú PHP ùì Apache äùúðå.
    </simpara>
    <para>
-    Starting with PHP 4.0, there are only four Apache directives
-    that relate to PHP:
+    îàæ PHP 4.0, éùðï ø÷ àøáò äðçéåú Apache ä÷ùåøåú àì PHP:
     <informalexample>
 		 <programlisting role="apache">
 <![CDATA[
+<div dir="ltr">
 php_value [PHP directive name] [value]
 php_flag [PHP directive name] [On|Off]
 php_admin_value [PHP directive name] [value]
 php_admin_flag [PHP directive name] [On|Off]
+</div>
 ]]>
 		 </programlisting>
 		</informalexample>
    </para>
    <simpara>
-    There are two differences between the Admin values and the non admin values:
+    éùðí ùðé äáãìéí áéï òøëé Admin åòøëé Non Admin:
    </simpara>
    <itemizedlist>
-    <listitem><simpara>Admin values (or flags) can only appear in the server-wide apache configuration files (e.g., httpd.conf).</simpara></listitem>
-    <listitem><simpara>Standard values (or flags) cannot control certain PHP directives, for example - safe mode (if you could override safe mode settings in .htaccess files, it would defeat safe-mode's purpose).  In contrast, Admin values can modify the value of any PHP directive.</simpara></listitem>
+    <listitem>
+     <simpara>
+      Admin values (or flags) can only appear in the server-wide Apache configuration
+      files (e.g., &httpd.conf;).
+     </simpara>
+    </listitem>
+    <listitem>
+     <simpara>
+      Standard values (or flags) cannot control certain PHP directives, for example: 
+      &safemode; (if you could override safe mode settings in 
+      &htaccess; files, it 
+      would defeat &safemode;'s purpose).  In contrast, Admin values can modify 
+      the value of any PHP directive.
+     </simpara>
+    </listitem>
    </itemizedlist>
    <simpara>
-    To make the transition process easier, PHP 4 is bundled with scripts that automatically convert your Apache configuration and .htaccess files to work with both PHP 3 and PHP 4. These scripts do NOT convert the mime type lines! You have to convert these yourself.
+    To make the transition process easier, PHP 4 is bundled with scripts 
+    that automatically convert your Apache configuration and 
+    &htaccess; files 
+    to work with both PHP 3 and PHP 4. These scripts do NOT convert the mime 
+    type lines! You have to convert these yourself.
    </simpara>
    <para>
-    To convert your Apache configuration files, run the apconf-conv.sh script (available in the scripts/apache/ directory).  For example:
+    To convert your Apache configuration files, run the apconf-conv.sh 
+    script (available in the scripts/apache/ directory).  For example:
     <informalexample>
 		 <programlisting role="shell">
 <![CDATA[
@@ -128,17 +150,20 @@
     Your original configuration file will be saved in httpd.conf.orig.
    </simpara>
    <para>
-    To convert your .htaccess files, run the aphtaccess-conv.sh script (available in the scripts/apache/ directory as well):
+    To convert your &htaccess; files, run the 
+    <filename>aphtaccess-conv.sh</filename> script (available in 
+    the <filename>scripts/apache/</filename> directory as well):
     <informalexample>
 		 <programlisting role="shell">
 <![CDATA[
 ~/php4/scripts/apache:#  find / -name .htaccess -exec ./aphtaccess-conv.sh {} \;
 ]]>
-		 </programlisting>
-		</informalexample>
+	 </programlisting>
+    </informalexample>
    </para>
    <simpara>
-    Likewise, your old .htaccess files will be saved with an .orig prefix.
+    Likewise, your old &htaccess; files will be saved with 
+    an .orig prefix.
    </simpara>
    <simpara>
     The conversion scripts require awk to be installed.
@@ -173,7 +198,7 @@
     string).
    </para>
    <para>
-    This should not harm to much as spreading code like this should be
+    This should not harm too much as spreading code like this should be
     considered as very bad style anyway.
    </para>
    <para>
@@ -191,7 +216,7 @@
     <para>
      With PHP 3 the error reporting level was set as a simple
      numeric value formed by summing up the numbers related to
-     different error levels. Usual values where 15 for reporting all
+     different error levels. Usual values were 15 for reporting all
      errors and warnings or 7 for reporting everything but simple
      notice messages reporting bad style and things like that.
     </para>
@@ -208,7 +233,7 @@
      want the error reporting system to report all but the simple
      style warnings that are categorized by the symbolic constant
      <literal>E_NOTICE</literal>.  Then you'll put the following into
-     your <filename>php.ini</filename>: <literal>error_reporting =
+     your &php.ini;: <literal>error_reporting =
      E_ALL &amp; ~ ( E_NOTICE )</literal>.  If you want to suppress
      warnings too you add up the appropriate constant within the
      braces using the binary or operator '|':
@@ -217,6 +242,16 @@
     </para>
     <warning>
      <para>
+      When upgrading code or servers from PHP 3 to PHP 4 you should
+      check these settings and calls to
+      <function>error_reporting</function> or you might disable
+      reporting the new error types, especially E_COMPILE_ERROR. This
+      may lead to empty documents without any feedback of what happened
+      or where to look for the problem.
+     </para>
+    </warning>
+    <warning>
+     <para>
       Using the old values 7 and 15 for setting up error reporting is
       a very bad idea as this suppresses some of the newly added error
       classes including parse errors. This may lead to very strange
@@ -261,8 +296,8 @@
      that makes your script give him access rights he wasn't intended
      to have. So PHP 4 will now warn you whenever you use unquoted
      string constants as for example in
-     <literal>$HTTP_SERVER_VARS[REQUEST_METHOD]</literal>. Changing it
-     to <literal>$HTTP_SERVER_VARS['REQUEST_METHOD']</literal> will
+     <literal>$_SERVER[REQUEST_METHOD]</literal>. Changing it
+     to <literal>$_SERVER['REQUEST_METHOD']</literal> will
      make the parser happy and greatly improve the style and security
      of your code.
     </para>
@@ -302,7 +337,7 @@
     This new behavior makes sense in web applications, with all input
     fields returning strings even if numeric input is requested, and
     with PHP's capabilities of automatic type conversion.  But on the
-    other had it might break your code in a rather subtle way,
+    other hand it might break your code in a rather subtle way,
     leading to misbehavior that is hard to track down if you do not
     know about what to look for.
    </para>
@@ -331,7 +366,7 @@
      the Zend engine) at runtime as parsing already happened by
      then. So the function <function>short_tags</function> no longer
      exists. You can still change the parsers behavior by setting
-     appropriate values in the <filename>php.ini</filename> file.
+     appropriate values in the &php.ini; file.
     </para>
     <para>
      Another feature of PHP 3 that is not a part of PHP 4 is the bundled
@@ -448,6 +483,7 @@
 }
 test();
 echo($id); // This will print out 1 in PHP 4
+?>
 ]]>
     </programlisting>
    </example>