mirror of
https://github.com/php/doc-es.git
synced 2026-03-24 15:32:36 +01:00
154 lines
3.9 KiB
XML
154 lines
3.9 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: d51166ca16fda8e766849505b84f9306ef443f71 Maintainer: PhilDaiguille Status: ready -->
|
|
<!-- Reviewed: yes -->
|
|
<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>Construye un iterador de tipo 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>
|
|
Construye un iterador de tipo glob.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>pattern</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Un patrón <function>glob</function>.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>flags</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Las opciones, que pueden ser un campo de bits
|
|
de constantes de clase <classname>FilesystemIterator</classname>.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="errors">
|
|
&reftitle.errors;
|
|
<para>
|
|
Se lanza una excepción <classname>UnexpectedValueException</classname>
|
|
si el directorio no existe.
|
|
</para>
|
|
<para>
|
|
Se lanza una excepción <classname>ValueError</classname>
|
|
si <parameter>directory</parameter> es una cadena vacía.
|
|
</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>
|
|
Ahora se lanza una excepción <classname>ValueError</classname>
|
|
cuando <parameter>directory</parameter> es una cadena vacía;
|
|
Anteriormente, se lanzaba una <classname>RuntimeException</classname>.
|
|
</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Ejemplo con <classname>GlobIterator</classname></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$iterator = new GlobIterator('*.dll', FilesystemIterator::KEY_AS_FILENAME);
|
|
|
|
if (!$iterator->count()) {
|
|
echo 'No matches';
|
|
} else {
|
|
$n = 0;
|
|
|
|
printf("Matched %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[
|
|
Matched 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
|
|
-->
|