mirror of
https://github.com/php/doc-es.git
synced 2026-04-23 15:18:07 +02:00
39c3713884
- Single quotes -> double quotes in XML declarations - Fix attribute ordering to match doc-en - Fix namespace declarations
133 lines
4.2 KiB
XML
133 lines
4.2 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- EN-Revision: f03806fcd8fe03a0501bd40b6e3939ff6589a1d2 Maintainer: PhilDaiguille Status: ready -->
|
|
<!-- Reviewed: yes -->
|
|
<refentry xml:id="pharfileinfo.setmetadata" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>PharFileInfo::setMetadata</refname>
|
|
<refpurpose>Establece las metadatos específicas de un fichero</refpurpose>
|
|
</refnamediv>
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis role="PharFileInfo">
|
|
<modifier>public</modifier> <type>void</type><methodname>PharFileInfo::setMetadata</methodname>
|
|
<methodparam><type>mixed</type><parameter>metadata</parameter></methodparam>
|
|
</methodsynopsis>
|
|
|
|
<para>
|
|
<function>PharFileInfo::setMetadata</function> debe ser utilizada únicamente para almacenar datos
|
|
personalizados en un fichero que no pueden ser almacenados con las informaciones normalmente
|
|
almacenadas con el fichero. Las metadatos pueden degradar el rendimiento de carga de un archivo phar
|
|
si los datos son demasiado pesados o si hay muchos ficheros con metadatos.
|
|
Es importante señalar que los permisos de ficheros son soportados nativamente en un phar; es posible
|
|
fijarlos con el método <function>PharFileInfo::chmod</function>. Al igual que con todas las
|
|
funcionalidades que modifican el contenido del phar, la variable INI
|
|
<link linkend="ini.phar.readonly">phar.readonly</link> debe estar a off para tener éxito si el fichero está
|
|
dentro de un archivo <classname>Phar</classname>. Los ficheros dentro de archivos <classname>PharData</classname>
|
|
no tienen esta restricción.
|
|
</para>
|
|
<para>
|
|
Un uso posible de las metadatos es el paso de un usuario/grupo
|
|
que debería ser utilizado cuando un fichero es extraído del phar hacia el disco. También puede
|
|
especificarse un tipo MIME a devolver. En general, puede almacenarse cualquier dato útil que describa
|
|
un fichero pero que no pueda ser inscrito directamente en él.
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>metadata</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Cualquier variable PHP que contenga información a almacenar aparte del fichero
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
&return.void;
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Un ejemplo con <function>PharFileInfo::setMetadata</function></title>
|
|
<para>
|
|
</para>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
// se asegura de que el phar no exista 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 el 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::hasMetadata</function></member>
|
|
<member><function>PharFileInfo::getMetadata</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
|
|
-->
|