mirror of
https://github.com/php/doc-pt_br.git
synced 2026-03-24 07:02:09 +01:00
* Updates to abandoned/outdated pages in reference/array/functions/ * Updates to outdated/abandoned pages and new translations in reference/classobj/ * Updates to abandoned/outdated pages in reference/ctype/ * Correction to double-byte UTF-8 character which is similar to 'E' * Correction of translation * Updates to abandoned/outdated files and new translations in reference/dir/ * Updates to abandoned/outdated files in reference/mysqli/ * New translation of reference/sockets/functions/socket-atmark.xml * New translation of reference/stream/* * Corrections after QA scripts * Delete reference/stream/versions.xml Arquivo marcado para não tradução. --------- Co-authored-by: LEONARDO LARA RODRIGUES <leonardolara@github.com> Co-authored-by: alfsb <alfsb@users.noreply.github.com>
146 lines
3.8 KiB
XML
146 lines
3.8 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- EN-Revision: b0b19b66183b28cebc1ffbcf1e2b8763f9d9c7b3 Maintainer: felipe Status: ready --><!-- CREDITS: ae, rarruda, thiago, leonardolara -->
|
|
<!-- splitted from ./en/functions/dir.xml, last change in rev 1.2 -->
|
|
<refentry xml:id="function.dir" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>dir</refname>
|
|
<refpurpose>Retorna uma instância da classe Directory</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type class="union"><type>Directory</type><type>false</type></type><methodname>dir</methodname>
|
|
<methodparam><type>string</type><parameter>directory</parameter></methodparam>
|
|
<methodparam choice="opt"><type class="union"><type>resource</type><type>null</type></type><parameter>context</parameter><initializer>&null;</initializer></methodparam>
|
|
</methodsynopsis>
|
|
|
|
<para>
|
|
Um mecanismo pseudo-orientado a objeto para ler um diretório.
|
|
O diretório fornecido pelo parâmetro <parameter>directory</parameter> é aberto.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>directory</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Diretório a ser aberto
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>context</parameter></term>
|
|
<listitem>
|
|
¬e.context-support;
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Retorna uma instância de <classname>Directory</classname>, ou &false; em caso de erro.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="changelog">
|
|
&reftitle.changelog;
|
|
<informaltable>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>&Version;</entry>
|
|
<entry>&Description;</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry>8.0.0</entry>
|
|
<entry>
|
|
<parameter>context</parameter> agora pode ser nulo.
|
|
</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Exemplo da <function>dir</function></title>
|
|
<para>
|
|
Repare nos detalhes de como o valor retornado de <function>Directory::read</function>
|
|
é verificado no exemplo abaixo. É testado explicitamente
|
|
se o valor de retorno é idêntico a (igual e do
|
|
mesmo tipo que - consulte <link linkend="language.operators.comparison">
|
|
operadores de comparação</link> para mais informação) &false;, caso
|
|
contrário, qualquer entrada de diretório cujo nome seja interpretado como &false; fará
|
|
parar o loop.
|
|
</para>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$d = dir("/etc/php5");
|
|
echo "Handle: " . $d->handle . "\n";
|
|
echo "Caminho: " . $d->path . "\n";
|
|
while (false !== ($entry = $d->read())) {
|
|
echo $entry."\n";
|
|
}
|
|
$d->close();
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs.similar;
|
|
<screen>
|
|
<![CDATA[
|
|
Handle: Resource id #2
|
|
Caminho: /etc/php5
|
|
.
|
|
..
|
|
apache
|
|
cgi
|
|
cli
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="notes">
|
|
&reftitle.notes;
|
|
<note>
|
|
<para>
|
|
A ordem em que as entradas do diretório são retornadas pelo método de leitura é
|
|
dependente do sistema operacional.
|
|
</para>
|
|
</note>
|
|
</refsect1>
|
|
</refentry>
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|