mirror of
https://github.com/macintoshplus/doc-fr.git
synced 2026-03-25 17:32:07 +01:00
108 lines
2.9 KiB
XML
108 lines
2.9 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 28046efaba656e158bdf45a2585c23a339943869 Maintainer: gui Status: ready -->
|
|
<!-- Reviewed: no -->
|
|
<refentry xml:id="pharfileinfo.chmod" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>PharFileInfo::chmod</refname>
|
|
<refpurpose>Fixe les bits de permission spécifiques aux fichiers</refpurpose>
|
|
</refnamediv>
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<modifier>public</modifier> <type>void</type><methodname>PharFileInfo::chmod</methodname>
|
|
<methodparam><type>int</type><parameter>perms</parameter></methodparam>
|
|
</methodsynopsis>
|
|
|
|
<para>
|
|
<function>PharFileInfo::chmod</function> permet de fixer les bits d'exécution
|
|
des fichiers, ainsi que ceux de lecture seule. Ceux d'écriture sont ignorés car fixés
|
|
au démarrage par la variable INI <link linkend="ini.phar.readonly">phar.readonly</link>.
|
|
Comme avec toutes les fonctionnalités qui modifient le contenu d'un phar, la variable INI
|
|
<link linkend="ini.phar.readonly">phar.readonly</link> doit être à off pour réussir si le fichier
|
|
est au sein d'une archive <classname>Phar</classname>. Les fichiers au sein d'une archive
|
|
<classname>PharData</classname> n'ont pas cette restriction.
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>perms</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Les permissions (voir <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 exemple avec <function>PharFileInfo::chmod</function></title>
|
|
<para>
|
|
</para>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
// on s'assure que le phar n'existe pas
|
|
@unlink('nouveauphar.phar');
|
|
try {
|
|
$p = new Phar('nouveauphar.phar', 0, 'nouveauphar.phar');
|
|
$p['fichier.sh'] = '#!/usr/local/lib/php
|
|
<?php echo "salut"; ?>';
|
|
// met le bit d'exécution
|
|
$p['fichier.sh']->chmod(0555);
|
|
var_dump($p['fichier.sh']->isExecutable());
|
|
} catch (Exception $e) {
|
|
echo 'Ne peut pas créer/modifier le 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
|
|
-->
|