[prev in list] [next in list] [prev in thread] [next in thread] 

List:       php-doc-cvs
Subject:    [DOC-CVS] [doc-en] master: construct.xml: fix the syntax and the interval value in example (#3261)
From:       Mikhail Alferov via GitHub <noreply () php ! net>
Date:       2024-03-17 17:56:39
Message-ID: pcn2kut6Hvnwnpg5LvlkqovIsQdd1iooV6ZLFeL5Zw () main ! php ! net
[Download RAW message or body]

Author: Mikhail Alferov (mmalferov)
Committer: GitHub (web-flow)
Pusher: Girgias
Date: 2024-03-17T17:58:27Z

Commit: https://github.com/php/doc-en/commit/dbbabb929e755cceddb63908e7d2cbc3d161c0d3
Raw diff: https://github.com/php/doc-en/commit/dbbabb929e755cceddb63908e7d2cbc3d161c0d3.diff

construct.xml: fix the syntax and the interval value in example (#3261)

Changed paths:
  M  reference/ev/evstat/construct.xml


Diff:

diff --git a/reference/ev/evstat/construct.xml b/reference/ev/evstat/construct.xml
index 2f6a5b47244..177d6edd2de 100644
--- a/reference/ev/evstat/construct.xml
+++ b/reference/ev/evstat/construct.xml
@@ -110,23 +110,23 @@
    <programlisting role="php">
 <![CDATA[
 <?php
+
 // Use 10 second update interval.
-$w = new EvStat("/var/log/messages", 8, function ($w) {
- echo "/var/log/messages changed\n";
+$w = new EvStat("/var/log/messages", 10, function ($w) {
+    echo "/var/log/messages changed\n";
 
- $attr = $w->attr();
+    $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();
- }
+    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();
+    }
 });
 
-Ev::run();
 ?>
 ]]>
    </programlisting>
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic