<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <HTML ><HEAD ><TITLE >get_included_files</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK REL="HOME" TITLE="Manual do PHP" HREF="index.html"><LINK REL="UP" TITLE="PHP Opções e Informações" HREF="ref.info.html"><LINK REL="PREVIOUS" TITLE="get_include_path" HREF="function.get-include-path.html"><LINK REL="NEXT" TITLE="get_loaded_extensions" HREF="function.get-loaded-extensions.html"><META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=UTF-8"></HEAD ><BODY CLASS="refentry" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >Manual do PHP</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="function.get-include-path.html" ACCESSKEY="P" >Anterior</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="function.get-loaded-extensions.html" ACCESSKEY="N" >Próxima</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><H1 ><A NAME="function.get-included-files" ></A >get_included_files</H1 ><DIV CLASS="refnamediv" ><A NAME="AEN176371" ></A ><P > (PHP 4, PHP 5)</P >get_included_files -- Retorna uma matriz com os nomes dos arquivos incluídos ou requeridos </DIV ><DIV CLASS="refsect1" ><A NAME="AEN176374" ></A ><H2 >Descrição</H2 >array <B CLASS="methodname" >get_included_files</B > ( void )<BR ></BR ><P > Retorna uma matriz com os nomes de todos os arquivos que foram incluídos usando as funções <A HREF="function.include.html" ><B CLASS="function" >include()</B ></A >, <A HREF="function.include-once.html" ><B CLASS="function" >include_once()</B ></A >, <A HREF="function.require.html" ><B CLASS="function" >require()</B ></A > ou <A HREF="function.require-once.html" ><B CLASS="function" >require_once()</B ></A >. </P ><P > O script chamado originalmente é considerado um "arquivo incluído", assim será listado junto com os arquivos referenciados por <A HREF="function.include.html" ><B CLASS="function" >include()</B ></A > e família. </P ><P > Arquivos que forem incluídos ou requeridos varias vezes aparecem somente uma vez na matriz. </P ><DIV CLASS="note" ><BLOCKQUOTE CLASS="note" ><P ><B >Nota: </B > Arquivos incluídos usando a diretiva de configuração <TT CLASS="literal" >auto_prepend_file</TT > não são incluídos na matriz retornada. </P ></BLOCKQUOTE ></DIV ><P > <TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" CLASS="EXAMPLE" ><TR ><TD ><DIV CLASS="example" ><A NAME="AEN176392" ></A ><P ><B >Exemplo 1. Exemplo <B CLASS="function" >get_included_files()</B > (<TT CLASS="filename" >abc.php</TT >)</B ></P ><TABLE BORDER="0" BGCOLOR="#E0E0E0" CELLPADDING="5" ><TR ><TD ><code><font color="#000000"> <font color="#0000BB"><?php<br /><br /></font><font color="#007700">include </font><font color="#DD0000">'test1.php'</font><font color="#007700">;<br />include_once </font><font color="#DD0000">'test2.php'</font><font color="#007700">;<br />require </font><font color="#DD0000">'test3.php'</font><font color="#007700">;<br />require_once </font><font color="#DD0000">'test4.php'</font><font color="#007700">;<br /><br /></font><font color="#0000BB">$included_files </font><font color="#007700">= </font><font color="#0000BB">get_included_files</font><font color="#007700">();<br /><br />foreach (</font><font color="#0000BB">$included_files </font><font color="#007700">as </font><font color="#0000BB">$filename</font><font color="#007700">) {<br /> echo </font><font color="#DD0000">"$filename</font><font color="#007700">\n</font><font color="#DD0000">"</font><font color="#007700">;<br />}<br /><br /></font><font color="#0000BB">?></font> </font> </code></TD ></TR ></TABLE ><P > Irá gerar a seguinte saída: </P ><TABLE BORDER="0" BGCOLOR="#E0E0E0" CELLPADDING="5" ><TR ><TD ><PRE CLASS="screen" >abc.php test1.php test2.php test3.php test4.php</PRE ></TD ></TR ></TABLE ></DIV ></TD ></TR ></TABLE > </P ><DIV CLASS="note" ><BLOCKQUOTE CLASS="note" ><P ><B >Nota: </B > No PHP 4.0.1pl2 e versões anteriores <B CLASS="function" >get_included_files()</B > assume que os arquivos requeridos terminem com a extensão <TT CLASS="literal" >.php</TT >; outras extensões não serão retornadas. A matriz retornada por <B CLASS="function" >get_included_files()</B > era uma matriz associativa e listava somente os arquivos incluídos pelas funções <A HREF="function.include.html" ><B CLASS="function" >include()</B ></A > e <A HREF="function.include-once.html" ><B CLASS="function" >include_once()</B ></A >. </P ></BLOCKQUOTE ></DIV ><P > Veja também <A HREF="function.include.html" ><B CLASS="function" >include()</B ></A >, <A HREF="function.include-once.html" ><B CLASS="function" >include_once()</B ></A >, <A HREF="function.require.html" ><B CLASS="function" >require()</B ></A >, <A HREF="function.require-once.html" ><B CLASS="function" >require_once()</B ></A > e <A HREF="function.get-required-files.html" ><B CLASS="function" >get_required_files()</B ></A >. </P ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="function.get-include-path.html" ACCESSKEY="P" >Anterior</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" ACCESSKEY="H" >Principal</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="function.get-loaded-extensions.html" ACCESSKEY="N" >Próxima</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >get_include_path</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="ref.info.html" ACCESSKEY="U" >Acima</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >get_loaded_extensions</TD ></TR ></TABLE ></DIV ></BODY ></HTML >