mirror of
https://github.com/macintoshplus/doc-fr.git
synced 2026-03-24 08:52:09 +01:00
153 lines
3.7 KiB
XML
153 lines
3.7 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: dbbabb929e755cceddb63908e7d2cbc3d161c0d3 Maintainer: yannick Status: ready -->
|
|
<!-- Reviewed: no -->
|
|
<refentry xml:id="evstat.construct" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<refnamediv>
|
|
<refname>EvStat::__construct</refname>
|
|
<refpurpose>Construit un objet EvStat watcher</refpurpose>
|
|
</refnamediv>
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<constructorsynopsis>
|
|
<modifier>public</modifier>
|
|
<methodname>EvStat::__construct</methodname>
|
|
<methodparam>
|
|
<type>string</type>
|
|
<parameter>path</parameter>
|
|
</methodparam>
|
|
<methodparam>
|
|
<type>float</type>
|
|
<parameter>interval</parameter>
|
|
</methodparam>
|
|
<methodparam>
|
|
<type>callable</type>
|
|
<parameter>callback</parameter>
|
|
</methodparam>
|
|
<methodparam
|
|
choice="opt">
|
|
<type>mixed</type>
|
|
<parameter>data</parameter>
|
|
<initializer>&null;</initializer>
|
|
</methodparam>
|
|
<methodparam
|
|
choice="opt">
|
|
<type>int</type>
|
|
<parameter>priority</parameter>
|
|
<initializer>0</initializer>
|
|
</methodparam>
|
|
</constructorsynopsis>
|
|
<para>
|
|
Construit un objet EvStat watcher et démarre le watcher automatiquement.
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term>
|
|
<parameter>path</parameter>
|
|
</term>
|
|
<listitem>
|
|
<para>
|
|
Le chemin pour lequel on attend un modification de statut.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term>
|
|
<parameter>interval</parameter>
|
|
</term>
|
|
<listitem>
|
|
<para>
|
|
Intervalle de détection d'une modification ; doit valoir normalement
|
|
<literal>0.0</literal> pour laisser <emphasis>libev</emphasis>
|
|
choisir la bonne valeur.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term>
|
|
<parameter>callback</parameter>
|
|
</term>
|
|
<listitem>
|
|
<para>
|
|
Voir les
|
|
<link linkend="ev.watcher-callbacks">fonctions de rappel Watcher</link>.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term>
|
|
<parameter>data</parameter>
|
|
</term>
|
|
<listitem>
|
|
<para>
|
|
Données personnalisées à associer avec le watcher.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term>
|
|
<parameter>priority</parameter>
|
|
</term>
|
|
<listitem>
|
|
<para>
|
|
<link linkend="ev.constants.watcher-pri">Les priorités du Watcher</link>
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
|
|
<example>
|
|
<title>Sruveillance des modifications dans le dossier /var/log/messages</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
// Utilisation d'un intervalle de 10 secondes.
|
|
$w = new EvStat("/var/log/messages", 10, function ($w) {
|
|
echo "/var/log/messages changed\n";
|
|
|
|
$attr = $w->attr();
|
|
|
|
if ($attr['nlink']) {
|
|
printf("Current size: %ld\n", $attr['size']);
|
|
printf("Current atime: %ld\n", $attr['atime']);
|
|
printf("Current mtime: %ld\n", $attr['mtime']);
|
|
} else {
|
|
fprintf(STDERR, "`messages` file is not there!");
|
|
$w->stop();
|
|
}
|
|
});
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</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
|
|
-->
|