mirror of
https://github.com/php/doc-es.git
synced 2026-04-29 10:03:21 +02:00
107 lines
2.9 KiB
XML
107 lines
2.9 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- EN-Revision: f03806fcd8fe03a0501bd40b6e3939ff6589a1d2 Maintainer: PhilDaiguille Status: ready -->
|
|
<!-- Reviewed: no -->
|
|
<refentry xml:id="pharfileinfo.chmod" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>PharFileInfo::chmod</refname>
|
|
<refpurpose>Fija los bits de permiso específicos de los ficheros</refpurpose>
|
|
</refnamediv>
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis role="PharFileInfo">
|
|
<modifier>public</modifier> <type>void</type><methodname>PharFileInfo::chmod</methodname>
|
|
<methodparam><type>int</type><parameter>perms</parameter></methodparam>
|
|
</methodsynopsis>
|
|
|
|
<para>
|
|
<function>PharFileInfo::chmod</function> permite fijar los bits de ejecución
|
|
de los ficheros, así como los de solo lectura. Los de escritura son ignorados ya que se fijan
|
|
al inicio por la variable INI <link linkend="ini.phar.readonly">phar.readonly</link>.
|
|
Al igual que con todas las funcionalidades que modifican el contenido de un phar, la variable INI
|
|
<link linkend="ini.phar.readonly">phar.readonly</link> debe estar en off para tener éxito si el fichero
|
|
se encuentra dentro de un archivo <classname>Phar</classname>. Los ficheros dentro de un archivo
|
|
<classname>PharData</classname> no tienen esta restricción.
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>perms</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Los permisos (ver <function>chmod</function>)
|
|
</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::chmod</function></title>
|
|
<para>
|
|
</para>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
// se asegura de que el phar no exista
|
|
@unlink('nouveauphar.phar');
|
|
try {
|
|
$p = new Phar('nouveauphar.phar', 0, 'nouveauphar.phar');
|
|
$p['fichier.sh'] = '#!/usr/local/lib/php
|
|
<?php echo "salut"; ?>';
|
|
// establece el bit de ejecución
|
|
$p['fichier.sh']->chmod(0555);
|
|
var_dump($p['fichier.sh']->isExecutable());
|
|
} catch (Exception $e) {
|
|
echo 'No puede crear/modificar el phar: ', $e;
|
|
}
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs;
|
|
<screen>
|
|
<![CDATA[
|
|
bool(true)
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</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
|
|
-->
|