mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 17:08:54 +00:00
updated docs for get_required_files/get_included_files to reflect the
changes in PHP 4.0.4 git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@43743 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
76827a16de
commit
652d0df057
1 changed files with 61 additions and 69 deletions
|
@ -1103,8 +1103,8 @@ print_r (get_extension_funcs ("gd"));
|
|||
<refnamediv>
|
||||
<refname>get_required_files</refname>
|
||||
<refpurpose>
|
||||
Returns an array with the names of the files require_once()'d in
|
||||
a script
|
||||
Returns an array with the names of the files require_once()'d or
|
||||
included_once()'d in a script
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
|
@ -1116,63 +1116,23 @@ print_r (get_extension_funcs ("gd"));
|
|||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para>
|
||||
This function returns an associtative array of the names of all
|
||||
This function returns an array of the names of all
|
||||
the files that have been loaded into a script using
|
||||
<function>require_once</function>. The indexes of the array are
|
||||
the file names as used in the <function>require_once</function>
|
||||
without the ".php" extension.
|
||||
</para>
|
||||
<para>
|
||||
The example below
|
||||
<example>
|
||||
<title>Printing the required and included files</title>
|
||||
<programlisting>
|
||||
<?php
|
||||
|
||||
require_once ("local.php");
|
||||
require_once ("../inc/global.php");
|
||||
|
||||
for ($i=1; $i<5; $i++)
|
||||
include "util".$i."php";
|
||||
|
||||
echo "Required_once files\n";
|
||||
print_r (get_required_files());
|
||||
|
||||
echo "Included_once files\n";
|
||||
print_r (get_included_files());
|
||||
?>
|
||||
</programlisting>
|
||||
</example>
|
||||
will generate the following output:
|
||||
<informalexample>
|
||||
<programlisting>
|
||||
Required_once files
|
||||
Array
|
||||
(
|
||||
[local] => local.php
|
||||
[../inc/global] => /full/path/to/inc/global.php
|
||||
)
|
||||
|
||||
Included_once files
|
||||
Array
|
||||
(
|
||||
[util1] => util1.php
|
||||
[util2] => util2.php
|
||||
[util3] => util3.php
|
||||
[util4] => util4.php
|
||||
)
|
||||
</programlisting>
|
||||
</informalexample>
|
||||
</para>
|
||||
<para>
|
||||
<note>
|
||||
<para>
|
||||
As of PHP 4.0.1pl2 this function assumes that the
|
||||
<varname>required_once</varname> files end in the extension
|
||||
".php", other extensions do not work.
|
||||
</para>
|
||||
</note>
|
||||
<function>require_once</function> or <function>include_once</function>.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
In PHP 4.0.1pl2 this function assumed that the
|
||||
<varname>required_once</varname> files end in the extension
|
||||
".php", other extensions do not work. Also, in that
|
||||
version the array returned was an associative array, and this
|
||||
function was not an alias for <function>get_included_files</function>
|
||||
</para>
|
||||
<para>
|
||||
As of PHP 4.0.4, this function is an alias for
|
||||
<function>get_included_files</function>
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
See also: <function>require_once</function>,
|
||||
<function>include_once</function>,
|
||||
|
@ -1198,21 +1158,53 @@ Array
|
|||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para>
|
||||
This function returns an associtative array of the names of all
|
||||
the files that have been loaded into a script using
|
||||
<function>include_once</function>. The indexes of the array are
|
||||
the file names as used in the <function>include_once</function>
|
||||
without the ".php" extension.
|
||||
This function returns an array of the names of all
|
||||
the files that have been loaded into a script using
|
||||
<function>require_once</function> or
|
||||
<function>include_once</function>.
|
||||
</para>
|
||||
<para>
|
||||
<note>
|
||||
<para>
|
||||
As of PHP 4.0.1pl2 this function assumes that the
|
||||
<varname>include_once</varname> files end in the extension
|
||||
".php", other extensions do not work.
|
||||
</para>
|
||||
</note>
|
||||
The example below
|
||||
<example>
|
||||
<title>Printing the required and included files</title>
|
||||
<programlisting>
|
||||
<?php
|
||||
|
||||
require_once ("local.php");
|
||||
require_once ("../inc/global.php");
|
||||
|
||||
for ($i=1; $i<5; $i++)
|
||||
include "util".$i."php";
|
||||
|
||||
echo "Required_once/Included_once files\n";
|
||||
print_r (get_required_files());
|
||||
</programlisting>
|
||||
</example>
|
||||
will generate the following output:
|
||||
<informalexample>
|
||||
<programlisting>
|
||||
Required_once/Included_once files
|
||||
Array
|
||||
(
|
||||
[0] => local.php
|
||||
[1] => /full/path/to/inc/global.php
|
||||
[2] => util1.php
|
||||
[3] => util2.php
|
||||
[4] => util3.php
|
||||
[5] => util4.php
|
||||
)
|
||||
</programlisting>
|
||||
</informalexample>
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
In PHP 4.0.1pl2 this function assumed that the
|
||||
<varname>include_once</varname> files end in the extension
|
||||
".php", other extensions do not work. Also, in that
|
||||
version the array returned was an associative array, and
|
||||
listed only the included files.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
See also: <function>require_once</function>,
|
||||
<function>include_once</function>,
|
||||
|
|
Loading…
Reference in a new issue