mirror of
https://github.com/php/doc-pt_br.git
synced 2026-03-24 07:02:09 +01:00
* adicionados arquivos iniciais com revisão * inclusão de arquivos originais com revisão * tradução de globiterator * Update construct.xml * Update construct.xml
152 lines
4.0 KiB
XML
152 lines
4.0 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- EN-Revision: d51166ca16fda8e766849505b84f9306ef443f71 Maintainer: fernandowobeto Status: ready --><!-- CREDITS: fernandowobeto -->
|
|
<refentry xml:id="globiterator.construct" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<refnamediv>
|
|
<refname>GlobIterator::__construct</refname>
|
|
<refpurpose>Constrói um diretório usando glob</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<constructorsynopsis role="GlobIterator">
|
|
<modifier>public</modifier> <methodname>GlobIterator::__construct</methodname>
|
|
<methodparam><type>string</type><parameter>pattern</parameter></methodparam>
|
|
<methodparam choice="opt"><type>int</type><parameter>flags</parameter><initializer>FilesystemIterator::KEY_AS_PATHNAME | FilesystemIterator::CURRENT_AS_FILEINFO</initializer></methodparam>
|
|
</constructorsynopsis>
|
|
<para>
|
|
Constrói um novo iterador de diretório a partir de uma expressão glob.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>pattern</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Um padrão <function>glob</function>.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>flags</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Sinalizadores de opção, os sinalizadores podem ser uma máscara de bits das
|
|
constantes <classname>FilesystemIterator</classname>.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="errors">
|
|
&reftitle.errors;
|
|
<para>
|
|
Lança uma <classname>UnexpectedValueException</classname>
|
|
se o diretório definido em <parameter>directory</parameter> não existir.
|
|
</para>
|
|
<para>
|
|
Lança um <classname>ValueError</classname>
|
|
se o diretório definido em <parameter>directory</parameter> for uma string vazia.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="changelog">
|
|
&reftitle.changelog;
|
|
<para>
|
|
<informaltable>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>&Version;</entry>
|
|
<entry>&Description;</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry>8.0.0</entry>
|
|
<entry>
|
|
Agora lança um <classname>ValueError</classname> se
|
|
<parameter>directory</parameter> for uma string vazia;
|
|
anteriormente lançava um <classname>RuntimeException</classname>.
|
|
</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Exemplo de <classname>GlobIterator</classname></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$iterator = new GlobIterator('*.dll', FilesystemIterator::KEY_AS_FILENAME);
|
|
|
|
if (!$iterator->count()) {
|
|
echo 'Sem correspondência';
|
|
} else {
|
|
$n = 0;
|
|
|
|
printf("Corresponderam %d item(s)\r\n", $iterator->count());
|
|
|
|
foreach ($iterator as $item) {
|
|
printf("[%d] %s\r\n", ++$n, $iterator->key());
|
|
}
|
|
}
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs.similar;
|
|
<screen>
|
|
<![CDATA[
|
|
Corresponderam 2 item(s)
|
|
[1] php5ts.dll
|
|
[2] php_gd2.dll
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><methodname>DirectoryIterator::__construct</methodname></member>
|
|
<member><methodname>GlobIterator::count</methodname></member>
|
|
<member><function>glob</function></member>
|
|
</simplelist>
|
|
</para>
|
|
</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
|
|
-->
|