cvs: phpdoc-cs /language control-structures.xml
| From: | Lukas Jelinek | Date: | Thu, 23 May 2002 21:07:57 +0000 |
| Subject: | cvs: phpdoc-cs /language control-structures.xml | ||
| Groups: | php.doc | ||
| Request: | Send a blank email to phpdoc+get-969345782@lists.php.net to get a copy of this message | ||
luk Thu May 23 17:07:57 2002 EDT
Modified files:
/phpdoc-cs/language control-structures.xml
Log:
Index: phpdoc-cs/language/control-structures.xml
diff -u phpdoc-cs/language/control-structures.xml:1.6 phpdoc-cs/language/control-structures.xml:1.7
--- phpdoc-cs/language/control-structures.xml:1.6 Thu May 9 17:15:33 2002
+++ phpdoc-cs/language/control-structures.xml Thu May 23 17:07:57 2002
@@ -1014,73 +1014,75 @@
</example>
</para>
<simpara>
- Více pøíkladù -- viz dokumentace <function>include</function>.
+ Dal¹í pøíklady -- viz dokumentace <function>include</function>.
</simpara>
<note>
<simpara>
- Prior to PHP 4.0.2, the following applies: <function>require</function> will
- always attempt to read the target file, even if the line it's on never executes.
- The conditional statement won't affect <function>require</function>. However,
- if the line on which the <function>require</function> occurs is not executed,
- neither will any of the code in the target file be executed. Similarly, looping
- structures do not affect the behaviour of <function>require</function>. Although
- the code contained in the target file is still subject to the loop, the
- <function>require</function> itself happens only once.
+ U verzí pøed PHP 4.0.2 platí toto: <function>require</function> se v¾dy
+ pokusí pøeèíst pøíslu¹ný soubor, kromì pøípadu, ¾e se øádek s tímto
+ pøíkazem nemù¾e nikdy provést. Podmínìný výraz
+ <function>require</function> neovlivòuje. Av¹ak pokud se øádek, na kterém
+ <function>require</function> le¾í, vùbec neprovádí, nebude se provádìt
+ ani kód v pøíslu¹ném souboru. Podobnì je tomu i v pøípadì cyklù -- ani
+ ty neovlivòují chování <function>require</function>. Pøesto¾e kód
+ obsa¾ený ve vkládaném souboru je stále pøedmìtem opakování, samotné
+ <function>require</function> se provede pouze jednou.
</simpara>
</note>
<simpara>
- See also <function>include</function>,
<function>require_once</function>,
+ Viz také <function>include</function>,
<function>require_once</function>,
<function>include_once</function>, <function>eval</function>,
<function>file</function>, <function>readfile</function>,
- <function>virtual</function> and <link
linkend="ini.include-path">include_path</link>.
+ <function>virtual</function> a <link
linkend="ini.include-path">include_path</link>.
</simpara>
</sect1>
<sect1 id="function.include">
<title><function>include</function></title>
<simpara>
- The <function>include</function> statement includes and evaluates
- the specified file.
+ Konstrukt <function>include</function> vlo¾í a ohodnotí specifikovaný
+ soubor.
</simpara>
<simpara>
- The documentation below also applies to <function>require</function>.
- The two constructs are identical in every way except how they handle
- failure. <function>include</function> produces a
- <link linkend="internal.e-warning">Warning</link> while
<function>require</function>
- results in a <link linkend="internal.e-error">Fatal Error</link>.
- In other words, use <function>require</function> if you want
- a missing file to halt processing of the page. <function>include</function> does
- not behave this way, the script will continue regardless. Be sure to have an
- appropriate <link linkend="ini.include-path">include_path</link> setting
as well.
+ Ní¾e popsané platí i pro <function>require</function>. Tyto dva konstrukty
+ jsou zcela toto¾né, kromì toho, jak zpracovávají chyby.
+ <function>include</function> produkuje
+ <link linkend="internal.e-warning">Warning</link> (varování), zatímco
+ <function>require</function> skonèí s chybou typu
+ <link linkend="internal.e-error">Fatal Error</link>.
+ Jinými slovy, <function>require</function> pou¾ijte tehdy, chcete-li,
+ aby se pøi chybìjícím souboru zastavilo zpracovávání.
+ <function>include</function> se tak nechová, skript bude neru¹enì
+ pokraèovat. Ujistìte se také, ¾e máte v poøádku nastavení
+ <link linkend="ini.include-path">include_path</link>.
</simpara>
<simpara>
- When a file is included, the code it contains inherits the
- <link linkend="language.variables.scope">variable scope</link> of the
- line on which the include occurs. Any variables available at that line
- in the calling file will be available within the called file, from that
- point forward.
+ Pokud se vlo¾í soubor, potom kód v nìm obsa¾ený dìdí
+ <link linkend="language.variables.scope">kontext promìnné</link>
+ øádku, kde byl vlo¾en. V¹echny promìnné dostupné na tomto øádku
+ volajícího souboru budou (od této chvíle) dostupné i ve volaném souboru.
</simpara>
<para>
<example>
- <title>Basic <function>include</function> example</title>
+ <title>Základní pøíklad -- <function>include</function></title>
<programlisting role="php">
<![CDATA[
vars.php
<?php
-$color = 'green';
-$fruit = 'apple';
+$color = 'zelené';
+$fruit = 'jablko';
?>
test.php
<?php
-echo "A $color $fruit"; // A
+echo "Vidím $color $fruit"; // Vidím
include 'vars.php';
-echo "A $color $fruit"; // A green apple
+echo "Vidím $color $fruit"; // Vidím zelené jablko
?>
]]>
@@ -1088,14 +1090,13 @@
</example>
</para>
<simpara>
- If the include occurs inside a function within the calling file,
- then all of the code contained in the called file will behave as
- though it had been defined inside that function. So, it will follow
- the variable scope of that function.
+ Pokud ke vlo¾ení dojde uvnitø funkce ve volajícím souboru, potom se v¹echen
+ kód obsa¾ený ve volaném souboru bude chovat, jako by byl definován
+ uvnitø této funkce -- tedy v rámci kontextu promìnných funkce.
</simpara>
<para>
<example>
- <title>Including within functions</title>
+ <title>Vkládání uvnitø funkcí</title>
<programlisting role="php">
<![CDATA[
<?php