1
0
mirror of https://github.com/php/doc-es.git synced 2026-03-24 07:22:16 +01:00
Files
archived-doc-es/reference/phar/PharFileInfo/getMetadata.xml
2025-07-11 18:27:48 +02:00

130 lines
3.4 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: f03806fcd8fe03a0501bd40b6e3939ff6589a1d2 Maintainer: PhilDaiguille Status: ready -->
<!-- Reviewed: no -->
<refentry xml:id="pharfileinfo.getmetadata" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>PharFileInfo::getMetadata</refname>
<refpurpose>Devuelve las metadatos específicas adjuntas a un fichero</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis role="PharFileInfo">
<modifier>public</modifier> <type>mixed</type><methodname>PharFileInfo::getMetadata</methodname>
<methodparam choice="opt"><type>array</type><parameter>unserializeOptions</parameter><initializer>[]</initializer></methodparam>
</methodsynopsis>
<para>
Devuelve las metadatos que han sido guardadas en el manifiesto del archivo Phar para este fichero.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Cualquier variable PHP que pueda ser serializada y que se almacena como metadatos para el fichero,
o &null; si no se almacenan metadatos.
</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>
El argumento <parameter>unserializeOptions</parameter> ha sido añadido.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Un ejemplo con <function>PharFileInfo::getMetadata</function></title>
<para>
</para>
<programlisting role="php">
<![CDATA[
<?php
// se asegura de que el phar no esté ya
@unlink('nouveauphar.phar');
try {
$p = new Phar(dirname(__FILE__) . '/nouveauphar.phar', 0, 'nouveauphar.phar');
$p['fichier.txt'] = 'salut';
$p['fichier.txt']->setMetadata(array('utilisateur' => 'PhilDaiguille', 'mime-type' => 'text/plain'));
var_dump($p['fichier.txt']->getMetadata());
} catch (Exception $e) {
echo 'No puede crear/modificar nouveauphar.phar: ', $e;
}
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
array(2) {
["utilisateur"]=>
string(7) "PhilDaiguille"
["mime-type"]=>
string(10) "text/plain"
}
]]>
</screen>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>PharFileInfo::setMetadata</function></member>
<member><function>PharFileInfo::hasMetadata</function></member>
<member><function>PharFileInfo::delMetadata</function></member>
<member><function>Phar::setMetadata</function></member>
<member><function>Phar::hasMetadata</function></member>
<member><function>Phar::getMetadata</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
-->