mirror of
https://github.com/macintoshplus/doc-fr.git
synced 2026-03-25 17:32:07 +01:00
89 lines
2.2 KiB
XML
89 lines
2.2 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 28046efaba656e158bdf45a2585c23a339943869 Maintainer: gui Status: ready -->
|
|
<!-- Reviewed: no -->
|
|
<refentry xml:id="phar.count" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>Phar::count</refname>
|
|
<refpurpose>Retourne le nombre d'entrées (fichiers) dans l'archive Phar</refpurpose>
|
|
</refnamediv>
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<modifier>public</modifier> <type>int</type><methodname>Phar::count</methodname>
|
|
<methodparam choice="opt"><type>int</type><parameter>mode</parameter><initializer><constant>COUNT_NORMAL</constant></initializer></methodparam>
|
|
</methodsynopsis>
|
|
|
|
<para>
|
|
</para>
|
|
|
|
</refsect1>
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Le nombre de fichiers contenus dans le phar, ou <literal>0</literal> (le nombre zéro)
|
|
si aucun.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Un exemple avec <function>Phar::count</function></title>
|
|
<para>
|
|
</para>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
// on s'assure que le phar n'existe pas
|
|
@unlink('lenouveauphar.phar');
|
|
try {
|
|
$p = new Phar(dirname(__FILE__) . '/lenouveauphar.phar', 0, 'le nouveauphar.phar');
|
|
} catch (Exception $e) {
|
|
echo 'Ne peut pas créer le phar:', $e;
|
|
}
|
|
echo 'Le nouveau phar a ' . $p->count() . " entrées\n";
|
|
$p['file.txt'] = 'salut';
|
|
echo 'Le nouveau phar a ' . $p->count() . " entrées\n";
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs;
|
|
<screen>
|
|
<![CDATA[
|
|
Le nouveau phar a 0 entrées
|
|
Le nouveau phar a 1 entrées
|
|
]]>
|
|
</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
|
|
-->
|