luk Mon Jun 3 16:52:41 2002 EDT
Modified files:
/phpdoc-cs translation.xml
/phpdoc-cs/language control-structures.xml variables.xml
Log:
Index: phpdoc-cs/translation.xml
diff -u phpdoc-cs/translation.xml:1.6 phpdoc-cs/translation.xml:1.7
--- phpdoc-cs/translation.xml:1.6 Thu Apr 25 17:58:12 2002
+++ phpdoc-cs/translation.xml Mon Jun 3 16:52:41 2002
@@ -17,7 +17,6 @@
<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="language/control-structures.xml" person="luk" type="translation" />
<file name="language/oop.xml" person="luk" type="translation" />
<file name="language/types.xml" person="luk" type="translation" />
<file name="language/variables.xml" person="luk" type="translation" />
Index: phpdoc-cs/language/control-structures.xml
diff -u phpdoc-cs/language/control-structures.xml:1.7
phpdoc-cs/language/control-structures.xml:1.8
--- phpdoc-cs/language/control-structures.xml:1.7 Thu May 23 17:07:57 2002
+++ phpdoc-cs/language/control-structures.xml Mon Jun 3 16:52:41 2002
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-2"?>
-<!-- EN-Revision: 1.55 Maintainer: luk Status: mixed -->
+<!-- EN-Revision: 1.55 Maintainer: luk Status: ready -->
<chapter id="control-structures">
<title>��dic� struktury</title>
@@ -1107,16 +1107,16 @@
include 'vars.php';
- echo "A $color $fruit";
+ echo "Vid�m $color $fruit";
}
-/* vars.php is in the scope of foo() so *
- * $fruit is NOT available outside of this *
- * scope. $color is because we declared it *
- * as global. */
+/* vars.php je v kontextu foo(), tak�e *
+ * $fruit NEN� dostupn� mimo tento kontext. *
+ * Naopak $color JE, proto�e je deklarov�na *
+ * jako glob�ln�. */
-foo(); // A green apple
-echo "A $color $fruit"; // A green
+foo(); // Vid�m zelen� jablko
+echo "Vid�m $color $fruit"; // Vid�m zelen�
?>
]]>
@@ -1124,79 +1124,76 @@
</example>
</para>
<simpara>
- When a file is included, parsing drops out of PHP mode and
- into HTML mode at the beginning of the target file, and resumes
- again at the end. For this reason, any code inside the target
- file which should be executed as PHP code must be enclosed within
- <link linkend="language.basic-syntax.phpmode">valid PHP start
- and end tags</link>.
- </simpara>
- <simpara>
- If "<link linkend="ini.allow-url-fopen">URL fopen wrappers</link>"
- are enabled in PHP (which they are in the default configuration),
- you can specify the file to be included using an URL (via HTTP)
- instead of a local pathname. If the target server interprets
- the target file as PHP code, variables may be passed to the included
- file using an URL request string as used with HTTP GET. This is
- not strictly speaking the same thing as including the file and having
- it inherit the parent file's variable scope; the script is actually
- being run on the remote server and the result is then being
- included into the local script.
+ P�i vkl�d�n� souboru p�ejde parsing na za��tku souboru z PHP re�imu do
+ m�du HTML a na jeho konci se vrac� zp�t do m�du PHP. Z tohoho d�vodu
+ mus� b�t prov�d�n� PHP k�d ve vkl�dan�m souboru uzav�en mezi
+ <link linkend="language.basic-syntax.phpmode">platnou po��te�n� a
+ koncovou PHP zna�ku</link>.
+ </simpara>
+ <simpara>
+ Pokud jsou v PHP povoleny
+ "<link linkend="ini.allow-url-fopen">URL fopen wrappery</link>"
+ (co� tak implicitn� je), m��ete specifikovat soubor ke vlo�en� pomoc�
+ URL (p�es HTTP) nam�sto lok�ln�ho um�st�n�. Pokud p��sku�n� server
+ interpretuje po�adovan� soubor jako PHP k�d, prom�nn� mohou b�t odkazov�ny
+ pomoc� �et�zce URL po�adavku jako u HTTP GET. Nen� to �pln� tot� jako
+ vlo�en� souboru s d�d�n�m kontextu prom�nn�ch od rodi�ovsk�ho souboru;
+ skript b�� na vzd�len�m serveru a v�sledek se potom vlo�� do lok�ln�ho
+ skriptu.
</simpara>
<para>
<example>
- <title><function>include</function> through HTTP</title>
+ <title><function>include</function> p�es HTTP</title>
<programlisting role="php">
<![CDATA[
<?php
-/* This example assumes that www.example.com is configured to parse .php *
- * files and not .txt files. Also, 'Works' here means that the variables *
- * $foo and $bar are available within the included file. */
+/* Tento p��klad p�edpokl�d�, �e www.example.com je konfigurov�n k parsov�n� *
+ * soubor� .php a nikoli soubor� .txt. Tedy, 'funguje' zde znamen�, �e *
+ * prom�nn� $foo a $bar jsou dostupn� uvnit� vkl�dan�ho souboru. */
-// Won't work; file.txt wasn't handled by www.example.com as PHP
+// Nefunguje; file.txt nebyl na www.example.com zpracov�n jako PHP
include 'http://www.example.com/file.txt?foo=1&bar=2';
-// Won't work; looks for a file named 'file.php?foo=1&bar=2' on the
-// local filesystem.
+// Nefunguje; hled� soubor 'file.php?foo=1&bar=2' v lok�ln�m syst�mu soubor�.
include 'file.php?foo=1&bar=2';
-// Works.
+// Funguje.
include 'http://www.example.com/file.php?foo=1&bar=2';
$foo = 1;
$bar = 2;
-include 'file.txt'; // Works.
-include 'file.php'; // Works.
+include 'file.txt'; // Funguje.
+include 'file.php'; // Funguje.
?>
]]>
</programlisting>
</example>
- See also <link linkend="features.remote-files">Remote files</link>,
- <function>fopen</function> and <function>file</function> for related
- information.
+ Souvisej�c� informace -- viz tak�
+ <link linkend="features.remote-files">Vzd�len� soubory</link>,
+ <function>fopen</function> a <function>file</function>.
</para>
<para>
- Because <function>include</function> and <function>require</function>
- are special language constructs, you must enclose them within a statement
- block if it's inside a conditional block.
+ Proto�e <function>include</function> a <function>require</function>
+ jsou speci�ln� jazykov� konstrukty, pokud se prov�d�j� podm�n�n�,
+ mus�te je uzav��t do bloku.
</para>
<para>
<example>
- <title>include() and conditional blocks</title>
+ <title>include() a podm�n�n� bloky</title>
<programlisting role="php">
<![CDATA[
<?php
-// This is WRONG and will not work as desired.
+// Toto je �PATN� a (jak bylo �e�eno) nebude to fungovat.
if ($condition)
include $file;
else
include $other;
-// This is CORRECT.
+// Tohle je SPR�VN�.
if ($condition) {
include $file;
} else {
@@ -1209,22 +1206,21 @@
</example>
</para>
<simpara>
- Handling Returns: It is possible to execute a <function>return</function>
- statement inside an included file in order to terminate processing in that
- file and return to the script which called it. Also, it's possible to return
- values from included files. You can take the value of the include call as
- you would a normal function.
+ Obsluha n�vrat�: Uvnit� vkl�dan�ho souboru lze prov�st konstrukt
+ <function>return</function> k ukon�en� prov�d�n� souboru a n�vrat do
+ volaj�c�ho skriptu. Je tedy mo�n� z vlo�en�ch soubor� vracet hodnoty.
+ M��ete vz�t hodnotu vol�n� include, jako by to byla norm�ln� funkce.
</simpara>
<note>
<simpara>
- In PHP 3, the return may not appear inside a block unless it's
- a function block, in which case the <function>return</function> applies
- to that function and not the whole file.
+ V PHP 3 se return nesm� objevit uvnit� bloku, pokud to nen� funk�n� blok;
+ tehdy v�ak se v�ak <function>return</function> t�k� t�to funkce a ne
+ cel�ho souboru.
</simpara>
</note>
<para>
<example>
- <title><function>include</function> and the <function>return</function>
statement</title>
+ <title><function>include</function> a konstrukt
+<function>return</function></title>
<programlisting role="php">
<![CDATA[
return.php
@@ -1248,11 +1244,11 @@
$foo = include 'return.php';
-echo $foo; // prints 'PHP'
+echo $foo; // vyp��e 'PHP'
$bar = include 'noreturn.php';
-echo $bar; // prints 1
+echo $bar; // vyp��e 1
?>
]]>
@@ -1260,19 +1256,19 @@
</example>
</para>
<simpara>
- <literal>$bar</literal> is the value <literal>1</literal> because the include
- was successful. Notice the difference between the above examples. The first
uses
- <function>return</function> within the included file while the other does not.
- A few other ways to "include" files into variables are with
- <function>fopen</function>, <function>file</function> or by using
- <function>include</function> along with
- <link linkend="ref.outcontrol">Output Control Functions</link>.
+ <literal>$bar</literal> m� hodnotu <literal>1</literal>, proto�e p��kaz
+ include byl �sp�n�. V�imn�te si rozd�lu mezi v��e uveden�mi p��klady.
+ Prvn� pou��v� ve vkl�dan�m souboru <function>return</function>, druh�
+ nikoli. Dal��mi zp�soby, jak p�i�adit hodnotu souboru do prom�nn�, jsou
+ funkce <function>fopen</function>, <function>file</function> a pou�it�
+ <function>include</function> spole�n� s
+ <link linkend="ref.outcontrol">funkcemi ��zen� v�stupu</link>.
</simpara>
<simpara>
- See also <function>require</function>, <function>require_once</function>,
+ Viz tak� <function>require</function>, <function>require_once</function>,
<function>include_once</function>, <function>readfile</function>,
- <function>virtual</function>, and
+ <function>virtual</function>, a
<link linkend="ini.include-path">include_path</link>.
</simpara>
@@ -1281,75 +1277,70 @@
<sect1 id="function.require-once">
<title><function>require_once</function></title>
<para>
- The <function>require_once</function> statement includes and evaluates
- the specified file during the execution of the script.
- This is a behavior similar to the <function>require</function> statement,
- with the only difference being that if the code from a file has already
- been included, it will not be included again. See the documentation for
- <function>require</function> for more information on how this statement
- works.
- </para>
- <para>
- <function>require_once</function> should be used in cases where
- the same file might be included and evaluated more than once during a
- particular execution of a script, and you want to be sure that it is
- included exactly once to avoid problems with function redefinitions,
- variable value reassignments, etc.
- </para>
- <para>
- For examples on using <function>require_once</function> and
- <function>include_once</function>, look at the
- <ulink url="&url.php.pear;">PEAR</ulink> code included in the
- latest PHP source code distributions.
+ Konstrukt <function>require_once</function> vlo�� a ohodnot� specifikovan�
+ soubor b�hem prov�d�n� skriptu. Chov� se tedy podobn� jako
+ <function>require</function>, s t�m rozd�lem, �e pokud u� byl k�d ze
+ souboru d��ve vlo�en do skriptu, nebude znovu vkl�d�n. V�ce informac� o
+ chov�n� p��kazu -- viz p��kaz <function>require</function>.
+ </para>
+ <para>
+ P��kaz <function>require_once</function> by se m�l pou��vat v p��padech,
+ kde by mohl b�t b�hem prov�d�n� skriptu tent�� soubor vlo�en a ohodnocen
+ v�ckr�t, a p�itom chcete zajistit pr�v� jedno vlo�en� (je t�eba se vyhnout
+ redefinic�m funkc�, nov�mu p�i�azen� hodnot atd.).
+ </para>
+ <para>
+ P��klady na pou�it� <function>require_once</function> a
+ <function>include_once</function> najdete v k�du
+ <ulink url="&url.php.pear;">PEAR</ulink> p�ilo�en�m v nejnov�j��ch
+ distribuc�ch zdrojov�ch k�d� PHP.
</para>
<note>
<para>
- <function>require_once</function> was added in PHP 4.0.1pl2
+ P��kaz <function>require_once</function> byl p�id�n v PHP 4.0.1pl2.
</para>
</note>
<para>
- See also: <function>require</function>,
+ Viz tak�: <function>require</function>,
<function>include</function>, <function>include_once</function>,
<function>get_required_files</function>,
<function>get_included_files</function>, <function>readfile</function>,
- and <function>virtual</function>.
+ a <function>virtual</function>.
</para>
</sect1>
<sect1 id="function.include-once">
<title><function>include_once</function></title>
<para>
- The <function>include_once</function> statement includes and evaluates
- the specified file during the execution of the script.
- This is a behavior similar to the <function>include</function> statement,
- with the only difference being that if the code from a file has already
- been included, it will not be included again. As the name suggests,
- it will be included just once.
- </para>
- <para>
- <function>include_once</function> should be used in cases where
- the same file might be included and evaluated more than once during a
- particular execution of a script, and you want to be sure that it is
- included exactly once to avoid problems with function redefinitions,
- variable value reassignments, etc.
- </para>
- <para>
- For more examples on using <function>require_once</function> and
- <function>include_once</function>, look at the
- <ulink url="&url.php.pear;">PEAR</ulink> code included in the latest
- PHP source code distributions.
+ Konstrukt <function>include_once</function> vlo�� a ohodnot� specifikovan�
+ soubor b�hem prov�d�n� skriptu. Chov� se tedy podobn� jako
+ <function>include</function> , s t�m rozd�lem, �e pokud u� byl k�d ze
+ souboru d��ve vlo�en do skriptu, nebude znovu vkl�d�n. Jak n�zev napov�d�,
+ bude vlo�en pr�v� jednou.
+ </para>
+ <para>
+ P��kaz <function>include_once</function> by se m�l pou��vat v p��padech,
+ kde by mohl b�t b�hem prov�d�n� skriptu tent�� soubor vlo�en a ohodnocen
+ v�ckr�t, a p�itom chcete zajistit pr�v� jedno vlo�en� (je t�eba se vyhnout
+ redefinic�m funkc�, nov�mu p�i�azen� hodnot atd.).
+ </para>
+ <para>
+ P��klady na pou�it� <function>require_once</function> and
+ <function>include_once</function> najdete v k�du
+ <ulink url="&url.php.pear;">PEAR</ulink> p�ilo�en�m v nejnov�j��ch
+ distribuc�ch zdrojov�ch k�d� PHP.
</para>
<note>
<para>
- <function>include_once</function> was added in PHP 4.0.1pl2
+ P��kaz <function>include_once</function> byl p�id�n v PHP 4.0.1pl2.
</para>
</note>
<para>
- See also <function>include</function>,
+ Viz tak� <function>include</function>,
<function>require</function>, <function>require_once</function>,
<function>get_required_files</function>,
<function>get_included_files</function>, <function>readfile</function>,
- and <function>virtual</function>.
+ a <function>virtual</function>.
</para>
</sect1>
Index: phpdoc-cs/language/variables.xml
diff -u phpdoc-cs/language/variables.xml:1.1 phpdoc-cs/language/variables.xml:1.2
--- phpdoc-cs/language/variables.xml:1.1 Fri Apr 26 16:35:27 2002
+++ phpdoc-cs/language/variables.xml Mon Jun 3 16:52:41 2002
@@ -413,13 +413,13 @@
</simpara>
<simpara>
- Static variables also provide one way to deal with recursive
- functions. A recursive function is one which calls itself. Care
- must be taken when writing a recursive function because it is
- possible to make it recurse indefinitely. You must make sure you
- have an adequate way of terminating the recursion. The following
- simple function recursively counts to 10, using the static
- variable <varname>$count</varname> to know when to stop:
+ Statick� prom�nn� tak� poskytuj� zp�sob, jak �e�it rekurz�vn� funkce.
+ Rekurz�vn� funkce je takov� funkce, kter� vol� sama sebe. Psan�
+ rekurz�vn�ch funkc� je t�eba v�novat zvl�tn� p��i, proto�e m��e vzniknout
+ nekone�n� cyklus vol�n�. Mus�te se ujistit, �e m�te rekurzi adekv�tn�
+ ukon�enu. N�sleduj�c� jednoduch� funkce rekurz�vn� po��t� do 10 za pou�it�
+ statick� prom�nn� <varname>$count</varname> ke zji�t�n� okam�iku pro
+ ukon�en�:
</simpara>
<informalexample>
@@ -443,42 +443,41 @@
</sect1>
<sect1 id="language.variables.variable">
- <title>Variable variables</title>
+ <title>Prom�nn� s prom�nn�mi n�zvy</title>
<simpara>
- Sometimes it is convenient to be able to have variable variable
- names. That is, a variable name which can be set and used
- dynamically. A normal variable is set with a statement such as:
+ N�kdy je vhodn�, aby se n�zvy prom�nn�ch mohly m�nit, tj. aby mohly b�t
+ dynamicky nastavov�ny a pou��v�ny. Norm�ln� prom�nn� se nastavuje
+ takov�mto konstruktem:
</simpara>
<informalexample>
<programlisting role="php">
<![CDATA[
-$a = "hello";
+$a = "ahoj";
]]>
</programlisting>
</informalexample>
<simpara>
- A variable variable takes the value of a variable and treats that
- as the name of a variable. In the above example,
- <emphasis>hello</emphasis>, can be used as the name of a variable
- by using two dollar signs. i.e.
+ Prom�nn� s prom�nn�m n�zvem vezme hodnotu prom�nn� a pou�ije ji jako
+ n�zev prom�nn�. Ve v��e uveden�m p��kladu,
+ <emphasis>ahoj</emphasis> lze pou��t jako n�zev prom�nn� uveden�m dvou
+ symbol� dolaru:
</simpara>
<informalexample>
<programlisting role="php">
<![CDATA[
-$$a = "world";
+$$a = "sv�te";
]]>
</programlisting>
</informalexample>
<simpara>
- At this point two variables have been defined and stored in the
- PHP symbol tree: <varname>$a</varname> with contents "hello" and
- <varname>$hello</varname> with contents "world". Therefore, this
- statement:
+ V t�to chv�li byly definov�ny dv� prom�nn� a byly ulo�eny do stromu
+ symbol� PHP: <varname>$a</varname> s obsahem "ahoj" a
+ <varname>$ahoj</varname> s obsahem "sv�te". Proto konstrukt:
</simpara>
<informalexample>
@@ -490,61 +489,58 @@
</informalexample>
<simpara>
- produces the exact same output as:
+ provede p�esn� tot� jako:
</simpara>
<informalexample>
<programlisting role="php">
<![CDATA[
-echo "$a $hello";
+echo "$a $ahoj";
]]>
</programlisting>
</informalexample>
<simpara>
- i.e. they both produce: <computeroutput>hello world</computeroutput>.
+ tedy oba vyprodukuj�: <computeroutput>ahoj sv�te</computeroutput>.
</simpara>
<simpara>
- In order to use variable variables with arrays, you have to
- resolve an ambiguity problem. That is, if you write
- <varname>$$a[1]</varname> then the parser needs to know if you
- meant to use <varname>$a[1]</varname> as a variable, or if you
- wanted <varname>$$a</varname> as the variable and then the [1]
- index from that variable. The syntax for resolving this ambiguity
- is: <varname>${$a[1]}</varname> for the first case and
- <varname>${$a}[1]</varname> for the second.
+ P�i pou�it� prom�nn�ch s prom�nn�mi n�zvy s poli mus�te vy�e�it probl�m
+ v�cezna�nosti. Tj. kdy� nap��ete
+ <varname>$$a[1]</varname>, parser pot�ebuje v�d�t, m�te-li na mysli pou�it�
+ <varname>$a[1]</varname> jako prom�nn� nebo chcete <varname>$$a</varname>
+ jako prom�nnou a potom index [1] v t�to prom�nn�. Syntaxe pro �e�en�
+ t�to v�cezna�nosti je <varname>${$a[1]}</varname> pro prvn� p��pad a
+ <varname>${$a}[1]</varname> pro druh�.
</simpara>
</sect1>
<sect1 id="language.variables.external">
- <title>Variables from outside PHP</title>
+ <title>Promm�n� zven�� PHP</title>
<sect2 id="language.variables.external.form">
- <title>HTML Forms (GET and POST)</title>
+ <title>HTML formul��e (GET a POST)</title>
<simpara>
- When a form is submitted to a PHP script, any variables from that
- form will be automatically made available to the script by
- PHP. If the <link linkend="ini.track-vars">track_vars</link>
- configuration option is turned on, then these variables will be
- located in the associative arrays
+ Kdy� se ode�le formul�� do PHP skriptu, jak�koli prom�nn� z tohoto
+ formul��e budou automaticky dostupn� v tomto skriptu.
+ Je-li zapnuta konfigura�n� volba
+ <link linkend="ini.track-vars">track_vars</link>, budou tyto prom�nn�
+ um�st�ny v asociativn�ch pol�ch
<varname>$HTTP_POST_VARS</varname>,
- <varname>$HTTP_GET_VARS</varname>, and/or
- <varname>$HTTP_POST_FILES</varname>, according to the
- source of the variable in question.
+ <varname>$HTTP_GET_VARS</varname>, a/nebo
+ <varname>$HTTP_POST_FILES</varname> v z�vislosti na zdroji prom�nn�ch.
</simpara>
<para>
- For more information on these variables, please read <link
- linkend="language.variables.predefined">Predefined
- variables</link>.
+ Pro v�ce informac� o t�chto prom�nn�ch si laskav� p�e�t�te <link
+ linkend="language.variables.predefined">P�eddefinovan� prom�nn�</link>.
</para>
<para>
<example>
- <title>Simple form variable</title>
+ <title>Jednoduch� prom�nn� formul��e</title>
<programlisting role="php">
<![CDATA[
<form action="foo.php" method="post">
@@ -557,12 +553,12 @@
</para>
<para>
- When the above form is submitted, the value from the text input
- will be available in
- <varname>$HTTP_POST_VARS['username']</varname>. If the <link
- linkend="ini.register-globals">register_globals</link>
- configuration directive is turned on, then the variable will also
- be available as <varname>$username</varname> in the global scope.
+ Kdy� se v��e uveden� formul�� ode�le, hodnota vstupn�ho textu bude
+ dostupn� v <varname>$HTTP_POST_VARS['username']</varname>. Je-li
+ zapnuta konfigura�n� direktiva
+ <link linkend="ini.register-globals">register_globals</link>,
+ prom�nn� bude dostupn� i jako <varname>$username</varname> v glob�ln�m
+ kontextu.
</para>
<note>