luk             Thu Mar 14 18:17:34 2002 EDT

  Added files:                 
    /phpdoc/cs/faq      using.xml 
    /phpdoc/cs/language references.xml 

  Modified files:              
    /phpdoc/cs  translation.xml 
    /phpdoc/cs/faq      installation.xml 
  Log:
  
  
  
Index: phpdoc/cs/translation.xml
diff -u phpdoc/cs/translation.xml:1.2 phpdoc/cs/translation.xml:1.3
--- phpdoc/cs/translation.xml:1.2       Tue Mar 12 16:21:52 2002
+++ phpdoc/cs/translation.xml   Thu Mar 14 18:17:32 2002
@@ -14,11 +14,18 @@
  </translators>
  
  <work-in-progress>
-  <file name="appendices/phpdevel.xml"  person="luk"      type="translation" />
-  <file name="faq/installation.xml"     person="luk"      type="translation" />
-  <file name="faq/mailinglist.xml"      person="luk"      type="translation" />  
-  <file name="faq/using.xml"            person="luk"      type="translation" />
-  <file name="functions/mysql.xml"      person="costra"   type="translation" />  
+  <file name="appendices/phpdevel.xml"        person="luk"      type="translation" />
+  <file name="appendices/predefined.xml"      person="luk"      type="translation" />
+  <file name="appendices/resources.xml"       person="luk"      type="translation" />
+  <file name="functions/mysql.xml"            person="costra"   type="translation" /> 
+ 
+  <file name="language/control-structures.xml person="luk"      type="translation" />
+  <file name="language/expressions.xml        person="luk"      type="translation" />
+  <file name="language/functions.xml          person="luk"      type="translation" />
+  <file name="language/operators.xml          person="luk"      type="translation" />
+  <file name="language/oop.xml                person="luk"      type="translation" />
+  <file name="language/references.xml         person="luk"      type="translation" />
+  <file name="language/types.xml              person="luk"      type="translation" />
+  <file name="language/variables.xml          person="luk"      type="translation" />
  </work-in-progress>
 
 </translation>
Index: phpdoc/cs/faq/installation.xml
diff -u phpdoc/cs/faq/installation.xml:1.1 phpdoc/cs/faq/installation.xml:1.2
--- phpdoc/cs/faq/installation.xml:1.1  Wed Mar 13 16:43:21 2002
+++ phpdoc/cs/faq/installation.xml      Thu Mar 14 18:17:33 2002
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="iso-8859-2"?>
-<!-- EN-Revision: 1.13 Maintainer: luk Status: mixed -->
+<!-- EN-Revision: 1.13 Maintainer: luk Status: ready -->
 
  <chapter id="faq.installation">
   <title>Instalace</title>
@@ -23,25 +23,25 @@
    <qandaentry id="faq.installation.phpini">
     <question>
      <para>
-      Unix/Windows: Where should my php.ini file be located?
+      Unix/Windows: Kde by m�l b�t ulo�en soubor php.ini?
      </para>
     </question>
     <answer>
      <para>
-      By default on UNIX it should be in <filename>/usr/local/lib</filename>. 
-      Most people will want to change this at compile-time with the 
-      <link 
linkend="install.configure.with-config-file-path">--with-config-file-path</link>
-      flag. You would, for example, set it with something like:
+      V UNIXu m� b�t implicitn� v adres��i <filename>/usr/local/lib</filename>.
+      Mnoho lid� to bude cht�t p�i kompilaci zm�nit pomoc� parametru
+      <link 
+linkend="install.configure.with-config-file-path">--with-config-file-path</link>.
+      Mohli byste ho, nap��klad, nastavit zhruba takto:
       <programlisting>
 --with-config-file-path=/etc
       </programlisting>
-      And then you would copy <filename>php.ini-dist</filename> from 
-      the distribution to <filename>/etc/php.ini</filename> and
-      edit it to make any local changes you want.
+      Pak byste zkop�rovali soubor <filename>php.ini-dist</filename> z
+      distribuce do <filename>/etc/php.ini</filename> a upravili tak, jak
+      chcete.
      </para>
      <para>
-      On Windows the default path for the <filename>php.ini</filename>
-      file is the Windows directory.
+      Pod Windows je soubor <filename>php.ini</filename> implicint� um�st�n
+      v adres��i syst�mu Windows.
      </para>
     </answer>
    </qandaentry>
@@ -49,23 +49,22 @@
    <qandaentry id="faq.installation.nodata">
     <question>
      <para>
-      Unix: I installed PHP, but every time I load a document, I get the 
-      message 'Document Contains No Data'! What's going on here?
+      UNIX: Nainstaloval jsem PHP, ale v�dy, kdy� na��t�m dokument, dostanu
+      zpr�vu 'Document Contains No Data'! O co jde?
      </para>
     </question>
     <answer>
      <para>
-      This probably means that PHP is having some sort of problem
-      and is core-dumping. Look in your server error log to see if
-      this is the case, and then try to reproduce the problem with
-      a small test case. If you know how to use 'gdb', it is very
-      helpful when you can provide a backtrace with your bug report
-      to help the developers pinpoint the problem.  If you are using
-      PHP as an Apache module try something like:
+      Pravd�pobn� to znamen�, �e PHP m� n�jak� probl�m a pad�. Pod�vejte se
+      do protokolu chyb, zda se jedn� o tento p��pad a pak zkuste probl�m
+      reprodukovat mal�m testem. Pokud v�te, jak pou��vat 'gdb', velmi pom��e,
+      kdy� m��ete s va��m hl�en�m chyby poskytnout v�pis (backtrace).
+      V�voj��i tak mohou snadn�ji lokalizovat probl�m. Pou��v�te-li PHP jako
+      modul do serveru Apache, zkuste n�co jako:
       <itemizedlist>
        <listitem>
         <para>
-         Stop your httpd processes
+         Zastavte httpd procesy
         </para>
        </listitem>
        <listitem>
@@ -75,7 +74,7 @@
        </listitem>
        <listitem>
         <para>
-         Stop your httpd processes
+         Zastavte httpd procesy
         </para>
        </listitem>
        <listitem>
@@ -85,7 +84,7 @@
        </listitem>
        <listitem>
         <para>
-         Then fetch the URL causing the problem with your browser
+         Potom na�t�te do prohl��e�e URL, kde se vyskytl probl�m         
         </para>
        </listitem>      
        <listitem>
@@ -95,28 +94,28 @@
        </listitem>      
        <listitem>
         <para>
-         If you are getting a core dump, gdb should inform you of this now
+         Dostanete-li core dump (PHP spadne), gdb by v�s o tom m�l informovat
         </para>
        </listitem>      
        <listitem>
         <para>
-         type: bt
+         napi�te: bt
         </para>
        </listitem>
        <listitem>
         <para>
-         You should include your backtrace in your bug report. This should be 
submitted to 
+         Z�skan� v�pis (backtrace) byste m�li p�ilo�it k hl�en� chyby.
+         To by se m�lo poslat na 
          <ulink url="&faqurl.php.bugs;">&faqurl.php.bugs;</ulink> 
         </para>
        </listitem>
       </itemizedlist>
      </para>
      <para>
-      If your script uses the regular expression functions
-      (<function>ereg</function> and friends), you should make sure 
-      that you compiled PHP and Apache with the same regular 
-      expression package. This should happen automatically with
-      PHP and Apache 1.3.x
+      Pokud v� skript pou��v� funkce pro regul�rn� v�razy
+      (<function>ereg</function> a dal��), m�li byste se ujistit, �e jste
+      zkompilovali PHP a Apache se stejn�m bal��kem pro regul�rn� v�razy.
+      S PHP a Apachem 1.3.x by se to m�lo d�t automaticky.
      </para>
     </answer>
    </qandaentry>
@@ -124,15 +123,16 @@
    <qandaentry id="faq.installation.processing">
     <question>
      <para>
-      Unix: I installed PHP using RPMS, but Apache isn't processing the 
-      PHP pages! What's going on here?
+      UNIX: Instaloval jsem PHP z bal��k� RPM, ale Apache nezpracov�v� str�nky
+      s PHP! O co tu jde?
      </para>
     </question>
     <answer>
      <para>
-      Assuming you installed both Apache and PHP from RPM packages, 
-      you need to uncomment or add some or all of the following lines
-      in your <filename>http.conf</filename> file:
+      Za p�edpokladu, �e se oboj�, jak Apache, tak PHP, instalovalo z
+      bal��k� RPM, bude t�eba "odkomentovat" nebo p�idat do souboru
+      <filename>http.conf</filename> n�kter� z n�sleduj�c�ch ��dk� (nebo
+      v�echny):
       <programlisting>
 # Extra Modules
 AddModule mod_php.c
@@ -141,17 +141,17 @@
 
 # Extra Modules
 LoadModule php_module         modules/mod_php.so
-LoadModule php3_module        modules/libphp3.so     /* for PHP 3 */
-LoadModule php4_module        modules/libphp4.so     /* for PHP 4 */
+LoadModule php3_module        modules/libphp3.so     /* pro PHP 3 */
+LoadModule php4_module        modules/libphp4.so     /* pro PHP 4 */
 LoadModule perl_module        modules/libperl.so
       </programlisting>
-      And add:
+      P�idejte tak�:
       <programlisting>
-AddType application/x-httpd-php3 .php3    /* for PHP 3 */
-AddType application/x-httpd-php .php      /* for PHP 4 */
+AddType application/x-httpd-php3 .php3    /* pro PHP 3 */
+AddType application/x-httpd-php .php      /* pro PHP 4 */
       </programlisting>
-      ... to the global properties, or to the properties of the 
-      VirtualDomain you want to have PHP support added to.
+      ... do glob�ln�ch vlastnost� nebo do vlastnost� virtu�ln� dom�ny
+      (VirtualDomain) by se m�la p�idat podpora PHP.
      </para>
     </answer>
    </qandaentry>
@@ -159,37 +159,37 @@
    <qandaentry id="faq.installation.compile">
     <question>
      <para>
-      Unix: I installed PHP 3 using RPMS, but it doesn't compile with
-      the database support I need! What's going on here?
+      UNIX: Instaloval jsem PHP 3 z bal��k� RPM, ale nekompiluje se s podporou
+      datab�ze, kterou pot�ebuji! O co tu jde?
      </para>
     </question>
     <answer>
      <para>
-      Due to the way PHP 3 built, it is not easy to build a
-      complete flexible PHP RPM.  This issue is addressed in PHP 4.
-      For PHP 3, we currently suggest you use the mechanism described in the
-      INSTALL.REDHAT file in the PHP distribution.  If you insist on using
-      an RPM version of PHP 3, read on...
+      Kv�li tomu, jak se PHP 3 budovalo, nen� snadn� sestavit kompletn�
+      flexibiln� RPM bal��ek s PHP. Probl�m je vy�e�en v PHP 4. Pro PHP 3
+      nyn� doporu�ujeme pou��vat mechanismus popsan� v souboru
+      INSTALL.REDHAT v distribuci PHP. Pokud trv�te na pou�it� RPM verze PHP 3,
+      �t�te d�l...
      </para>
      <para>
-      The RPM packagers are setting up the RPMS to install
-      without database support to simplify installations <emphasis>and</emphasis>
-      because RPMS use /usr/ instead of the standard /usr/local/ directory for
-      files. You need to tell the RPM spec file which databases to support
-      and the location of the top-level of your database server.
+      RPM pakova�e jsou nastaveny na tvorbu RPM bal��k� k instalaci bez
+      podpory datab�z� kv�li zjednodu�en� instalac� <emphasis>a</emphasis>
+      proto, �e RPM pou��v� adres�� /usr/ nam�sto standardn�ho /usr/local/.
+      Mus�t sd�lit RPM souboru spec, kter� datab�ze podporovat a um�st�n�
+      adres��e nejvy��� �rovn� datab�zov�ho serveru.
      </para>
      <para>
-      This example will explain the process of adding support for the
-      popular MySQL database server, using the mod installation for Apache.
+      Tento p��klad vysv�tluje proces p�id�n� podpory popul�rn�ho datab�zov�ho
+      serveru MySQL, pro instalaci PHP jako modulu do Apache.
      </para>
      <para>
-      Of course all of this information can be adjusted for any database
-      server that PHP supports. We will assume you installed MySQL and Apache
-      completely with RPMS for this example as well.
+      V�echny tyto informace smaoz�ejm� mohou b�t upraveny pro libovoln�
+      datab�zov� server, kter� PHP podporuje. Pro tento p��klad budeme
+      p�edpokl�dat, �e jste instalovali MySQL a Apache pln� z bal��k� RPM.
       <itemizedlist>
        <listitem>
              <para>
-         First remove mod_php3 : 
+         Nejd��ve odstra�te mod_php3 : 
          <programlisting>
 rpm -e mod_php3
          </programlisting>
@@ -197,7 +197,7 @@
             </listitem>
             <listitem>
              <para>
-         Then get the source rpm and INSTALL it, NOT --rebuild
+         Potom vezm�te zdrojov� bal��ek RPM a spus�te na n�m, NE --rebuild
          <programlisting>
 rpm -Uvh mod_php3-3.0.5-2.src.rpm
          </programlisting>
@@ -205,17 +205,19 @@
             </listitem>
             <listitem>
              <para>
-              Then edit the <filename>/usr/src/redhat/SPECS/mod_php3.spec</filename> 
file
+              Upravte soubor
+               <filename>/usr/src/redhat/SPECS/mod_php3.spec</filename>
              </para>
              <para>
-         In the %build section add the database support you want, and the path.
+         V sekci %build p�idejte datab�zovou podporu, kterou chcete, a nastavte
+         cestu.
              </para>
              <para>
-         For MySQL  you would add
+         Pro MySQL byste p�idali
          <programlisting>
 --with-mysql=/usr \
          </programlisting>
-         The %build section will look something like this:
+         Sekce %build bude vypadat p�ibli�n� takto:
          <programlisting>
        ./configure --prefix=/usr \
        --with-apxs=/usr/sbin/apxs \
@@ -230,7 +232,7 @@
             </listitem>
             <listitem>
              <para>
-              Once this modification is made then build the binary rpm as follows:
+              Pot�, co jsou provedeny tyto zm�ny, zkompilujte bal��ek takto:
          <programlisting>
 rpm -bb /usr/src/redhat/SPECS/mod_php3.spec
          </programlisting>
@@ -238,17 +240,17 @@
             </listitem>
             <listitem>
              <para>
-              Then install the rpm
+              Potom bal��ek nainstalujte:
          <programlisting>
 rpm -ivh /usr/src/redhat/RPMS/i386/mod_php3-3.0.5-2.i386.rpm
          </programlisting>
              </para>
             </listitem>
       </itemizedlist>
-      Make sure you restart Apache, and you now have PHP 3 with MySQL support
-      using RPM's. Note that it is probably much easier to just build
-      from the distribution tarball of PHP 3 and follow the instructions in
-      <filename>INSTALL.REDHAT</filename> found in that distribution.
+      Ujist�te se, �e jste restartovali Apache, a nyn� ji� m�te PHP 3 s
+      podporou MySQL. Uv�domte si, �e je pravd�podobn� mnohem jednodu���
+      zkompilovat distribu�n� bal��ek tar a dr�et se instrukc� v souboru
+      <filename>INSTALL.REDHAT</filename> z distribuce.
         </para>
     </answer>
    </qandaentry>
@@ -256,17 +258,17 @@
    <qandaentry id="faq.installation.frontpage">
     <question>
      <para>
-      Unix: I patched Apache with the FrontPage extensions patch, and
-      suddenly PHP stopped working. Is PHP incompatible with the
-      Apache FrontPage extensions?
+      UNIX: P�idal jsem do Apache patch pro FrontPage Extension a PHP n�hle
+      p�estalo pracovat. Je PHP nekompatibiln� s FrontPage Extension pro
+      Apache?
      </para>
     </question>
     <answer>
      <para>
-      No, PHP works fine with the FrontPage extensions. The problem
-      is that the FrontPage patch modifies several Apache structures,
-      that PHP relies on. Recompiling PHP (using 'make clean ; make')
-      after the FP patch is applied would solve the problem.
+      Ne, PHP pracuje dob�e i s FrontPage Extension. Probl�m je v tom, �e
+      FrontPage patch modifikuje n�kter� struktury Apache, na kter� PHP
+      spol�h�. P�ekompilov�n� PHP (pou�it�m 'make clean ; make') po instalaci
+      FP patche by m�lo probl�m vy�e�it.
      </para>
     </answer>
    </qandaentry>
@@ -274,18 +276,16 @@
    <qandaentry id="faq.installation.blankscreen">
     <question>
      <para>
-      Unix/Windows: I have installed PHP, but when I try to
-      access a PHP script file via my browser, I get a blank screen.
+      UNIX/Windows: Nainstaloval jsem PHP, ale p�i pokusu na��st soubor PHP
+      skriptu do prohl��e�e se zobraz� pouze pr�zdn� obrazovka.
      </para>
     </question>
     <answer>
      <para>
-      Do a 'view source' in the web browser and you will probably
-      find that you can see the source code of your PHP script.
-      This means that the web server did not send the script to
-      PHP for interpretation. Something is wrong with the server
-      configuration - double check the server configuration against
-      the PHP installation instructions.
+      V prohl��e�i vyberte funkci 'zobrazit zdrojov� k�d', nejsp�� uvid�te
+      zdrojov� k�d va�eho PHP skriptu. To znamen�, �e server nepos�l� skript
+      k interpretaci. Chyba je n�kde v konfiguraci serveru - rad�ji dvakr�t
+      zkontrolujte konfiguraci podle instrukc� k instalaci PHP.
      </para>
     </answer>
    </qandaentry>
@@ -293,24 +293,20 @@
    <qandaentry id="faq.installation.500error">
     <question>
      <para>
-      Unix/Windows: I have installed PHP, but when try to
-      access a PHP script file via my browser, I get a
-      server 500 error.
+      UNIX/Windows: Nainstaloval jsem PHP a kdy� chci na��st PHP soubor do
+      prohl��e�e, objev� se "500 Internal Server Error".      
      </para>
     </question>
     <answer>
      <para>
-      Something went wrong when the server tried to run PHP. To
-      get to see a sensible error message, from the command line,
-      change to the directory containing the PHP executable
-      (<filename>php.exe</filename> on Windows) and run
-      <literal>php -i</literal>. If PHP has any problems running,
-      then a suitable error message will be displayed which will
-      give you a clue as to what needs to be done next. If you
-      get a screen full of html codes (the output of the
-      <function>phpinfo</function> function) then PHP is working,
-      and your problem may be related to your server configuration
-      which you should double check.
+      P�i pokusu spustit PHP do�lo k n�jak� chyb�. Abyste vid�li detailn�j��
+      chybovou zpr�vu, z p��kazov� ��dky, p�ejd�te do adres��e se souborem
+      PHP (pod Windows <filename>php.exe</filename>) a spus�te
+      <literal>php -i</literal>. Pokud p�i b�hu PHP dojde k chyb�, bude
+      zobrazena odpov�daj�c� chybovou zpr�va, kter� v�m �ekne, co se m� d�l
+      ud�lat. Pokud z�sk�te obrazovku plnou HTML k�du (v�stup funkce
+      <function>phpinfo</function>), pak PHP funguje a v� probl�m m��e
+      souviset s konfigurac� serveru, kterou je pak t�eba dob�e zkontrolovat.
      </para>
     </answer>
    </qandaentry>
@@ -318,8 +314,8 @@
    <qandaentry id="faq.installation.undefinedsyms">
     <question>
      <para> 
-      Some operating systems: I have installed PHP without errors,
-      but when I try to start apache I get undefined symbol errors:
+      N�kter� opera�n� syst�my: Nainstaloval jsem PHP bez chyb, ale nyn�,
+      kdy� zkus�m spustit Apache, ohl�s� se chyby o nedefinovan�ch symbolech:
       <programlisting>
 [mybox:user /src/php4] root# apachectl configtest
  apachectl: /usr/local/apache/bin/httpd Undefined symbols:
@@ -330,9 +326,9 @@
     </question>
     <answer>
      <para>
-      This has actually nothing to do with PHP, but with the MySQL
-      client libraries. Some need --with-zlib, others do not. This
-      is also covered in the MySQL FAQ.
+      To aktu�ln� nem� nic spole�n�ho s PHP, ale s knihovnami klienta MySQL.
+      N�kter� pot�ebuj� --with-zlib, jin� nikoli. T�mto se zab�v� tak�
+      MySQL FAQ.
      </para>
     </answer>
    </qandaentry>
@@ -340,8 +336,8 @@
    <qandaentry id="faq.installation.cgierror">
     <question>
      <para>
-      Windows: I have installed PHP, but when I to access
-      a PHP script file via my browser, I get the error:
+      Windows: Nainstaloval jsem PHP, ale p�i na�ten� str�nky do prohl��e�e
+      se zobraz� chyba:
       <programlisting>
 cgi error:
  The specified CGI application misbehaved by not
@@ -352,42 +348,38 @@
     </question>
     <answer>
      <para>
-      This error message means that PHP failed to output anything
-      at all. To get to see a sensible error message, from the
-      command line, change to the directory containing the PHP
-      executable (<filename>php.exe</filename> on Windows) and run
-      <literal>php -i</literal>. If PHP has any problems running,
-      then a suitable error message will be displayed which will
-      give you a clue as to what needs to be done next. If you
-      get a screen full of html codes (the output of the
-      <function>phpinfo</function> function) then PHP is working.
+      Tato chybov� zpr�va znamen�, �e z PHP nemohou vych�zet ��dn� data.
+      Abyste vid�li detailn�j��
+      chybovou zpr�vu, z p��kazov� ��dky, p�ejd�te do adres��e se souborem
+      PHP (pod Windows <filename>php.exe</filename>) a spus�te
+      <literal>php -i</literal>. Pokud p�i b�hu PHP dojde k chyb�, bude
+      zobrazena odpov�daj�c� chybovou zpr�va, kter� v�m �ekne, co se m� d�l
+      ud�lat. Pokud z�sk�te obrazovku plnou HTML k�du (v�stup funkce
+      <function>phpinfo</function>), PHP funguje.
      </para>
      <para>
-      Once PHP is working at the command line, try accessing the
-      script via the browser again. If it still fails then it
-      could be one of the following:
+      Jestli�e PHP pracuje v p��kazov� ��dce, zkuste to znovu z prohl��e�e.
+      Pokud to st�le nefunguje, m��e to b�t jedn�m z t�chto d�vod�:
      </para>
      <itemizedlist>
       <listitem>
        <simpara>
-        File permissions on your PHP script,
+        Nastaven� p��stupov�ch pr�v k souboru se skriptem, k
         <filename>php.exe</filename>, <filename>php4ts.dll</filename>,
-        <filename>php.ini</filename> or any PHP extensions you are
-        trying to load are such that the anonymous internet user
-        <literal>ISUR_&lt;machinename&gt;</literal> cannot access them.
+        <filename>php.ini</filename> nebo n�jak�mu roz���en� PHP, kter� se
+        pokou��te na��st, je takov�, �e k nim anonymn� internetov� u�ivatel
+        <literal>ISUR_&lt;machinename&gt;</literal> nem� p��stup.
        </simpara>
       </listitem>
       <listitem>
        <simpara>
-        The script file does not exist (or possibly isn't where you
-        think it is relative to your web root directory). Note that
-        for IIS you can trap this error by ticking the 'check file
-        exists' box when setting up the script mappings in the
-        Internet Services Manager. If a script file does not exist
-        then the server will return a 404 error instead. There is
-        also the additional benefit that IIS will do any
-        authentication required for you based on the NTLanMan
-        permissions on your script file.
+        Soubor se skriptem neexistuje (nebo p��padn� nen� tam, kde si mysl�te,
+        �e je, relativn� ke ko�enov�mu adres��i webu). Uv�domte si, �e
+        na IIS m��ete tuto chybu zachytit za�krtnut�m volby 'check file
+        exists' p�i nastavov�n� skriptov�ch slu�eb v Internet Services
+        Manageru. Pokud skript neexistuje, server vr�t� chybu 404. Dal��
+        v�hodou je to, �e IIS provede na souboru se skriptem v�echny pot�ebn�
+        autentikace zalo�en� NTLanMan.
        </simpara>
       </listitem>
      </itemizedlist>
@@ -397,18 +389,18 @@
    <qandaentry id="faq.install.phpandiis">
     <question>
      <para>
-      Windows: I've followed all the instructions, but still can't
-      get PHP and IIS to work together!
+      Windows: Dodr�el jsem v�echny instrukce, ale PHP a IIS st�le odm�taj�
+      spolupracovat!
      </para>
     </question>
     <answer>
      <para>
-      Make sure any user who needs to run a PHP script has the rights
-      to run <filename>php.exe</filename>! IIS uses an anonymous user
-      which is added at the time IIS is installed. This user needs
-      rights to <filename>php.exe</filename>. Also, any authenticated
-      user will also need rights to execute <filename>php.exe</filename>.
-      And for IIS4 you need to tell it that PHP is a script engine.
+      Ujist�te se, �e ka�d� u�ivatel, kter� pot�ebuje spou�t�t PHP skripty m�
+      pr�va pro spou�t�n� <filename>php.exe</filename>! IIS pou��v� anonymn�ho
+      u�ivatele, kter� se p�id� p�i instalaci IIS. Tento u�ivatel pot�ebuje
+      pr�va k <filename>php.exe</filename>. Tak� ka�d� autentikovan� u�ivatel
+      bude pot�ebovat pr�va na spou�t�n� <filename>php.exe</filename>.
+      A IIS4 mus�te sd�lit, �e PHP je skriptovac� engine.
      </para>
     </answer>
    </qandaentry>

Index: phpdoc/cs/faq/using.xml
+++ phpdoc/cs/faq/using.xml
<?xml version="1.0" encoding="iso-8859-2"?>
<!-- EN-Revision: 1.14 Maintainer: luk Status: ready -->

<chapter id="faq.using">
  <title>Pou��v�n� PHP</title>
  <titleabbrev>Pou��v�n� PHP</titleabbrev>

  <para>
   Tato ��st shrnuje nej�ast�j�� chyby, se kter�mi se m��ete setkat p�i psan�
   PHP skript�.
  </para>

  <qandaset>
   <qandaentry id="faq.using.anyform">
    <question>
     <para>
      Cht�l bych napsat generick� PHP skript, kter� by um�l zpracovat data
      z jak�hokoli formul��e. Jak se dozv�m, kter� prom�nn� metody POST jsou
      k dispozici?
     </para>
    </question>
    <answer>
     <para>
      Ujist�te se, �e m�te v souboru <filename>php.ini</filename> zapnuto
      <link linkend="ini.track-vars">track_vars</link>
      Od PHP 4.0.3 je tato mo�nost v�dy zapnuta. Pokud tomu tak je, vytvo��
      se n�jak� asociativn� pole, z nich� nejd�le�it�j�� je
      <literal>$HTTP_POST_VARS</literal>. Tak�e pro psan� generick�ho skriptu
      pro obsluhu prom�nn�ch metody POST budete pot�ebovat p�ibli�n� toto:
      <programlisting role="php">
<![CDATA[
foreach ($HTTP_POST_VARS as $var => $value) {
    echo "$var = $value<br>\n";
}
]]>
      </programlisting>
     </para>
    </answer>
   </qandaentry>

   <qandaentry id="faq.using.singlequotes">
    <question>
     <para>
      Pot�ebuji p�ev�st v�echny apostrofy (') na zp�tn� lom�tka n�sledovan�
      apostrofy. Jak se to d� ud�lat pomoc� regul�rn�ho v�razu?
     </para>
    </question>
    <answer>
     <para>
      Nejd��ve se pod�vejte na funkci <function>addslashes</function>.
      D�l� p�esn� to, co pot�ebujete. M�li byste se tak� pod�vat na
      direktivu <link linkend="ini.magic-quotes-gpc">magic_quotes_gpc</link> 
      v souboru <filename>php.ini</filename>.
     </para>
    </answer>
   </qandaentry>

   <qandaentry id="faq.using.wrong-order">
    <question>
     <para>
      Kdy� nap��u n�sleduj�c� k�d, v�stup se tiskne v nespr�vn�m po�ad�:
     <programlisting role="php">
function myfunc($argument)
{
    echo $argument + 10;
}
$variable = 10;
echo "myfunc($variable) = " . myfunc($variable);
    </programlisting>
     what's going on?
     </para>
    </question>
    <answer>
     <para>
      Pro pou�it� v�sledk� va�� funkce ve v�razu (jako je spojen� s jin�m
      �et�zcem v p��kladu v��e), mus�te hodnotu <emphasis>vracet</emphasis>
      (pomoc� <emphasis>vracet</emphasis>), ne <function>tisknout</function> 
      (pomoc� <function>echo</function>).
     </para>
    </answer>
   </qandaentry>

   <qandaentry id="faq.using.newlines">
    <question>
     <para>
      Hej, co se stalo s m�mi konci ��dk�?
      <programlisting role="php">
<![CDATA[
<pre>
<?php echo "Tohle by m�l b�t prvn� ��dek."; ?>
<?php echo "Tohle by se m�lo uk�zat na nov�m ��dku."; ?>
</pre>
]]>
      </programlisting>
     </para>
    </question>
    <answer>
     <para>
      V PHP se blok k�du zakon�uje bu� "?&gt;", nebo "?&gt;\n" (kde \n
      znamen� nov� ��dek). Tak�e ve v��e uveden�m p��kladu budou vypsan�
      v�ty na jedin�m ��dku, proto�e PHP vynech�v� konce ��dk� za koncem
      bloku. To znamen�, �e mus�te p�id�vat zvl�tn� konce ��dk� za ka�d�
      blok PHP k�du, aby se vytisklo od��dkov�n� jedin�.
     </para>
     <para>
      Pro� to PHP d�l�? P�i form�tov�n� norm�ln�ho HTML to obvykle
      zjednodu�uje �ivot, proto�e nechcete konce ��dk�, n�br� chcete
      vytvo�it extr�mn� dlouh� ��dky nebo jinak zne�itelnit zdrojov� k�d.
     </para>
    </answer>
   </qandaentry>

   <qandaentry id="faq.using.headers-sent">
    <question>
     <para>
      Zobrazila se mi zpr�va 'Warning: Cannot send session cookie - headers already
      sent...' nebo 'Cannot add header information - headers already sent...'.
     </para>
    </question>
    <answer>
     <para>
      Funkce <function>header</function>,
      <function>set_cookie</function> a funkce session mus� do v�stupu p�idat
      hlavi�ky. Hlavi�ky je mo�no pos�lat pouze p�ed vlastn�m obsahem. Funkce
      to ud�laj�, pokud PHP b�� jako modul Apache. N�sleduj�c� kus k�du
      zobraz� v�echny hlavi�ky v po�adavku:
      <programlisting role="php">
<![CDATA[
$headers = getallheaders();
foreach ($headers as $name => $content) {
    echo "headers[$name] = $content<br>\n";
}
]]>
      </programlisting>
     </para>
    </answer>
   </qandaentry>

   <qandaentry id="faq.using.header">
    <question>
     <para>
      Pot�ebuji p��mo p�istupovat k hlavi�ce po�adavku. Jak to ud�lat?
     </para>
    </question>
    <answer>
     <para>
      Funkce <function>getallheaders</function> to ud�l�, pokud PHP b�� jako
      modul do Apache. N�sleduj�c� kus k�du zobraz� v�echny hlavi�ky
      v po�adavku:
      <programlisting role="php">
<![CDATA[
$headers = getallheaders();
foreach ($headers as $name => $content) {
    echo "headers[$name] = $content<br>\n";
}
]]>
      </programlisting>
     </para>
    </answer>
   </qandaentry>

   <qandaentry id="faq.using.authentication">
    <question>
     <para>
      Kdy� zkus�m autentikaci s IIS, dostanu 'No Input file specified'.
     </para>
    </question>
    <answer>
     <para>
      Bezpe�nostn� model IIS je s t�m na �t�ru. Je to probl�m spole�n� v�em
      CGI program�m b��c�m pod IIS. �e�en�m je vytvo�it oby�ejn� HTML
      soubor (neparsovan� PHP) jako vstupn� str�nku do autentikovan�ho
      adres��e. Potom se pou�ije META tag k p�esm�rov�n� na PHP str�nku nebo
      odkaz k ru�n�mu p�echodu. PHP pak autentikaci zpracuje spr�vn�. S
      modulem ISAPI toto nen� probl�mem. Jin�ch NT webovsk�ch server�
      se probl�m net�k�. V�ce informac� - viz 
      <ulink url="&faqurl.iis;">&faqurl.iis;</ulink>.
     </para>
    </answer>
   </qandaentry>

   <qandaentry id="faq.using.netscape">
    <question>
     <para>
      M�j PHP skript pracuje na IE a Lynxu, ale v Netscapu ��st v�stupu
      miz�. Kdy� si zapnu "Zobrazit zdrojov� k�d", v IE vid�m obsah,
      v Netscapu nikoliv.
     </para>
    </question>
    <answer>
     <para>
      Netscape je striktn�j�� ohledn� HTML tag� (nap�. tabulek) n� IE.
      Kontrola HTML v�stupu pomoc� HTML valid�toru, jako je 
      <ulink url="&faqurl.w3.validator;">validator.w3.org</ulink>, m��e b�t
      n�pomocna. Nap��klad chyb�j�c� &lt;/table&gt; zp�sobuje v��e uveden�
      probl�m.
     </para>
     <para>
      IE i Lynx tak� ignoruj� jak�koliv nulov� (<literal>\0</literal>) znaky
      v HTML proudu, Netscape nikoli. Nejlep�� cestou k ov��en� je zkompilovat
      verzi PHP pro <link linkend="commandline">p��kazovou ��dku</link>
      (zn�mou jako CGI verze) a spustit skript z p��kazov� ��dky. Na *NIXech
      to p�esm�rujte do <literal>od -c</literal> a hledejte znaky
      <literal>\0</literal>.  Pod Windows mus�te naj�t editor nebo jin�
      program, kter� umo��uje prohl��en� bin�rn�ch soubor�. Kdy� Netscape
      uvid� v souboru nulov� znak, typicky nic dal��ho nezobraz�, a�koli
      IE i Lynx ano. 
     </para>
    </answer>
   </qandaentry>

   <qandaentry id="faq.using.mixml">
    <question>
     <para>
      Jak� jsou p�edpoklady m�ch�n� XML a PHP? St�uje si to na moje 
      &lt;?xml&gt; tagy!
     </para>
    </question>
    <answer>
     <para>
      Mus�te vypnout kr�tk� tagy v souboru <filename>php.ini</filename>
      nastaven�m <link linkend="ini.short-open-tag">short_tags</link> na 0
      nebo pou�it�m odpov�daj�c� direktivy Apache. M��ete tak� pou��t sekci
      &lt;File&gt; k selektivn�mu nastaven�.
     </para>
    </answer>
   </qandaentry>

   <qandaentry id="faq.using.editor">
    <question>
     <para>
      Jak mohu pou��t PHP s FrontPagem nebo jin�m HTML editorem, kter� trv�
      na odsunut� m�ho k�du?
     </para>
    </question>
    <answer>
     <para>
      Jedn�m z nejjednodu���ch zp�sob� je povolit pou�it� ASP tag� v PHP
      k�du. To umo�n� pou��vat odd�lova�e v ASP stylu (&lt;% a %&gt;).
      N�kter� popul�rn� HTML editory s pracuj� (v tuto chv�li) inteligentn�ji.
      K zapnut� ASP tag� mus�te v souboru <filename>php.ini</filename> nastavit
      prom�nnou <link linkend="ini.asp-tags">asp_tags</link> nebo pou��t
      p��slu�nou direktivu Apache.
     </para>
    </answer>
   </qandaentry>

   <qandaentry id="faq.using.variables">
    <question>
     <para>
      Kde najdi �pln� seznam dostupn�ch p�ednastaven�ch prom�nn�ch, a pro�
      to nen� zdokumentov�no v dokumentaci PHP?
     </para>
    </question>
    <answer>
     <para>
      Nejlep�� metodou je vlo�it do str�nky
      <literal>&lt;?php phpinfo(); ?&gt;</literal> a na��st to do prohl��e�e.
      Zobraz� se informace  v�eho druhu o nainstalovan�m PHP, v�etn� seznamu
      prom�nn�ch prost�ed� i speci�ln�ch prom�nn�ch nastavovan�ch HTTP
      serverem. Tento seznam opravdu nem��e b�t zdokumentov�n v dokumentaci
      k PHP, prot�e se li�� server od serveru.
     </para>
    </answer>
   </qandaentry>

   <qandaentry id="faq.using.cgi-vars">
    <question>
     <para>
      Zkou��m p�istupovat k jedn� ze standardn�ch CGI prom�nn�ch (jako je
      $DOCUMENT_ROOT nebo $HTTP_REFERER) v u�ivatelsky definovan� funkci,
      a nem��e ji to naj�t. Co je �patn�?
     </para>
    </question>
    <answer>
     <para>
      Prom�nn� prost�ed� jsou norm�ln� glob�ln� prom�nn�, tak�e je mus�te
      bu� deklarovat ve funkci jako glob�ln� prom�nn� (nap��klad pou�it�m
      "<literal>global $DOCUMENT_ROOT;</literal>") nebo pou��t pole glob�ln�ch
      prom�nn�ch (nap�. "<literal>$GLOBALS["DOCUMENT_ROOT"]</literal>").
     </para>
    </answer>
   </qandaentry>

  </qandaset>
 </chapter>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
-->

Index: phpdoc/cs/language/references.xml
+++ phpdoc/cs/language/references.xml
<?xml version="1.0" encoding="iso-8859-2"?>
<!-- EN-Revision: 1.22 Maintainer: luk Status: mixed -->

 <chapter id="language.references">
  <title>Vysv�tlen� referenc� (odkaz�)</title>

  <sect1 id="language.references.whatare">
   <title>Co jsou reference</title>
   <simpara>    
    References are a means in PHP to access the same variable content 
    by different names. They are not like C pointers, they are symbol
    table aliases. Note that in PHP, variable name and variable content 
    are different, so the same content can have different names.
    The most close analogy is with Unix filenames and files -
    variable names are directory entries, while variable contents is
    the file itself. References can be thought of as hardlinking in
    Unix filesystem.
   </simpara>
  </sect1>

  <sect1 id="language.references.whatdo">
   <title>What References Do</title>
   <para>
    PHP references allow you to make two variables to refer to the
    same content. Meaning, when you do:
    <informalexample>
     <programlisting role="php">
<![CDATA[
$a =& $b 
]]>
     </programlisting>
    </informalexample>
    it means that <varname>$a</varname> and <varname>$b</varname>
    point to the same variable.
    <note>
     <para>
      <varname>$a</varname> and <varname>$b</varname> are completely
      equal here, that's not <varname>$a</varname> is pointing to
      <varname>$b</varname> or vice versa, that's
      <varname>$a</varname> and <varname>$b</varname> pointing to the
      same place.
     </para>
    </note>
   </para>
   <para>
   The same syntax can be used with functions, that return references,
   and with <literal>new</literal> operator (in PHP 4.0.4 and later):
    <informalexample>
     <programlisting role="php">
<![CDATA[
$bar =& new fooclass();
$foo =& find_var ($bar);
]]>
    </programlisting>
    </informalexample>
    </para>
    <note>
     <para>
     Not using the <literal>&amp;</literal> operator causes a copy of the
     object to be made. If you use <literal>$this</literal> in the class it
     will operate on the current instance of the class. The assignment without
     <literal>&amp;</literal> will copy the instance (i.e. the object) and
     <literal>$this</literal> will operate on the copy, which is not always
     what is desired. Usually you want to have a single instance to work with,
     due to performance and memory consumption issues.
     </para>
   </note>
   <para>
    The second thing references do is to pass variables
    by-reference. This is done by making a local variable in a function and
    a variable in the calling scope reference to the same content. Example:
    <informalexample>
     <programlisting role="php">
<![CDATA[
function foo (&$var)
{
    $var++;
}

$a=5;
foo ($a);
]]>
     </programlisting>
    </informalexample>
    will make <varname>$a</varname> to be 6. This happens because in
    the function <varname>foo</varname> the variable
    <varname>$var</varname> refers to the same content as
    <varname>$a</varname>. See also more detailed explanations about <link
    linkend="language.references.pass">passing by reference</link>.
   </para>
   <simpara>
    The third thing reference can do is <link
    linkend="language.references.return">return by reference</link>.
   </simpara>
  </sect1>

  <sect1 id="language.references.arent">
   <title>What References Are Not</title>
   <para>
    As said before, references aren't pointers. That means, the
    following construct won't do what you expect:
    <informalexample>
     <programlisting role="php">
<![CDATA[
function foo (&$var)
{
    $var =& $GLOBALS["baz"];
}
foo($bar); 
]]>
     </programlisting>
    </informalexample>
   </para>
   <simpara>
    What happens is that <varname>$var</varname> in
    <varname>foo</varname> will be bound with
    <varname>$bar</varname> in caller, but then it will be
    re-bound with <varname>$GLOBALS["baz"]</varname>. There's no way
    to bind <varname>$bar</varname> in the calling scope to something else
    using the reference mechanism, since <varname>$bar</varname> is not
    available in the function <varname>foo</varname> (it is represented by
    <varname>$var</varname>, but <varname>$var</varname> has only
    variable contents and not name-to-value binding in the calling
    symbol table).
   </simpara>
  </sect1>

  <sect1 id="language.references.pass">
   <title>Passing by Reference</title>
   <para>
   You can pass variable to function by reference, so that function could modify
   its arguments. The syntax is as follows:
    <informalexample>
     <programlisting role="php">
<![CDATA[
function foo (&$var)
{
    $var++;
}

$a=5;
foo ($a);
// $a is 6 here
]]>
     </programlisting>
    </informalexample>
  Note that there's no reference sign on function call - only on
  function definition. Function definition alone is enough to
  correctly pass the argument by reference. 
  </para>
  <para>
  Following things can be passed by reference:
   <itemizedlist>
    <listitem>
     <simpara>
      Variable, i.e. <literal>foo($a)</literal>
     </simpara>
    </listitem>
    <listitem>
     <simpara>
      New statement, i.e. <literal>foo(new foobar())</literal>
     </simpara>
    </listitem>
    <listitem>
     <para>
      Reference, returned from a function, i.e.:
    <informalexample>
     <programlisting role="php">
<![CDATA[
function &bar()
{
    $a = 5;
    return $a;
}
foo(bar());
]]>
     </programlisting>
    </informalexample>
    See also explanations about <link
    linkend="language.references.return">returning by reference</link>. 
     </para>
    </listitem>
  </itemizedlist>
  </para>
  <para>
  Any other expression should not be passed by reference, as the
  result is undefined. For example, the following examples of passing
  by reference are invalid:
    <informalexample>
     <programlisting role="php">
<![CDATA[
function bar() // Note the missing &
{
    $a = 5;
    return $a;
}
foo(bar());

foo($a = 5) // Expression, not variable
foo(5) // Constant, not variable
]]>
     </programlisting>
    </informalexample>
                These requirements are for PHP 4.0.4 and later.
  </para>
  </sect1>

  <sect1 id="language.references.return">
   <title>Returning References</title>
   <para>
    Returning by-reference is useful when you want to use a function
    to find which variable a reference should be bound to. When
    returning references, use this syntax:
    <informalexample>
     <programlisting role="php">
<![CDATA[
function &find_var ($param)
{
    ...code...
    return $found_var;
}

$foo =& find_var ($bar);
$foo->x = 2; 
]]>
     </programlisting>
    </informalexample>
    In this example, the property of the object returned by the
    <varname>find_var</varname> function would be set, not the
    copy, as it would be without using reference syntax.
   </para>
   <note>
    <simpara>
     Unlike parameter passing, here you have to use
     <literal>&amp;</literal> in both places - to indicate that you
     return by-reference, not a copy as usual, and to indicate that
     reference binding, rather than usual assignment, should be done
     for <varname>$foo</varname>.
    </simpara>
   </note>
  </sect1>

  <sect1 id="language.references.unset">
   <title>Unsetting References</title>
   <para>
    When you unset the reference, you just break the binding between
    variable name and variable content. This does not mean that
    variable content will be destroyed. For example:
    <informalexample>
     <programlisting role="php">
<![CDATA[
$a = 1;
$b =& $a;
unset ($a); 
]]>
     </programlisting>
    </informalexample>
    won't unset <varname>$b</varname>, just <varname>$a</varname>. 
   </para>
   <simpara>
    Again, it might be useful to think about this as analogous to Unix
    <command>unlink</command> call.
   </simpara>
  </sect1>

  <sect1 id="language.references.spot">
   <title>Spotting References</title>
   <simpara>
    Many syntax constructs in PHP are implemented via referencing
    mechanisms, so everything told above about reference binding also
    apply to these constructs. Some constructs, like passing and
    returning by-reference, are mentioned above. Other constructs that
    use references are:
   </simpara>

   <sect2 id="references.global">
    <title><literal>global</literal> References</title>
    <para>
     When you declare variable as <command>global $var</command> you
     are in fact creating reference to a global variable. That means,
     this is the same as:
     <informalexample>
      <programlisting role="php">
<![CDATA[
$var =& $GLOBALS["var"];
]]>
      </programlisting>
     </informalexample>
    </para>
    <simpara>
     That means, for example, that unsetting <varname>$var</varname>
     won't unset global variable.
    </simpara>
   </sect2>

   <sect2 id="references.this">
    <title><literal>$this</literal></title>
    <simpara>
     In an object method, <varname>$this</varname> is always reference
     to the caller object.
    </simpara>
   </sect2>
  </sect1>

 </chapter>
 
 <!-- Keep this comment at the end of the file
 Local variables:
 mode: sgml
 sgml-omittag:t
 sgml-shorttag:t
 sgml-minimize-attributes:nil
 sgml-always-quote-attributes:t
 sgml-indent-step:1
 sgml-indent-data:t
indent-tabs-mode:nil
 sgml-parent-document:nil
 sgml-default-dtd-file:"../manual.ced"
 sgml-exposed-tags:nil
 sgml-local-catalogs:nil
 sgml-local-ecat-files:nil
 End:
 -->

Reply via email to