cvs: phpdoc /en/language/control-structures include-once.xml
| From: | Philip Olson | Date: | Fri, 27 Feb 2009 21:33:44 +0000 |
| Subject: | cvs: phpdoc /en/language/control-structures include-once.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-3363@lists.php.net to get a copy of this message | ||
philip Fri Feb 27 21:33:44 2009 UTC
Modified files:
/phpdoc/en/language/control-structures include-once.xml
Log:
Simplied these docs, as this is documented in include().
http://cvs.php.net/viewvc.cgi/phpdoc/en/language/control-structures/include-once.xml?r1=1.2&r2=1.3&diff_format=u
Index: phpdoc/en/language/control-structures/include-once.xml
diff -u phpdoc/en/language/control-structures/include-once.xml:1.2
phpdoc/en/language/control-structures/include-once.xml:1.3
--- phpdoc/en/language/control-structures/include-once.xml:1.2 Sat Dec 27 06:51:51 2008
+++ phpdoc/en/language/control-structures/include-once.xml Fri Feb 27 21:33:44 2009
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
-<!-- $Revision: 1.2 $ -->
+<!-- $Revision: 1.3 $ -->
<sect1 xml:id="function.include-once" xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink">
<title><function>include_once</function></title>
@@ -12,62 +12,39 @@
it will be included just once.
</para>
<para>
- <function>include_once</function> should be used in cases where
+ <function>include_once</function> may 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.
+ particular execution of a script, so in this case it may help avoid
+ problems such as 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
- <link xlink:href="&url.php.pear;">PEAR</link> code included in the
latest
- PHP source code distributions.
- </para>
- <para>
- Return values are the same as with <function>include</function>. If the file
- was already included, this function returns &true;
+ See the <function>include</function> documentation for information about
+ how this function works.
</para>
<para>
<note>
- <para>
- <function>include_once</function> was added in PHP 4.0.1
- </para>
- </note>
- </para>
- <para>
- <note>
<para>
- Be aware, that the behaviour of <function>include_once</function>
- and <function>require_once</function> may not be what you expect
- on a non case sensitive operating system (such as Windows).
+ With PHP 4, <literal>_once</literal> functionality differs with case-insensitive
+ operating systems (like Windows) so for example:
<example>
- <title><function>include_once</function> is case insensitive on
Windows</title>
+ <title><function>include_once</function> with a case insensitive OS in PHP
4</title>
<programlisting role="php">
<![CDATA[
<?php
include_once "a.php"; // this will include a.php
-include_once "A.php"; // this will include a.php again on Windows! (PHP 4 only)
+include_once "A.php"; // this will include a.php again! (PHP 4 only)
?>
]]>
</programlisting>
</example>
- This behaviour changed in PHP 5 - the path is normalized first so that
+ </para>
+ <para>
+ This behaviour changed in PHP 5, so for example with Windows the path is normalized first so
that
<filename>C:\PROGRA~1\A.php</filename> is realized the same as
<filename>C:\Program Files\a.php</filename> and the file is included just once.
</para>
</note>
</para>
-
- &warn.no-win32-fopen-wrapper;
-
- <para>
- See also <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>.
- </para>
</sect1>
<!-- Keep this comment at the end of the file