From 9ec46b8b8aa9ed5a6798996e742c0fe8a7820da8 Mon Sep 17 00:00:00 2001 From: Ruslan Osmanov Date: Thu, 27 Dec 2012 17:38:15 +0000 Subject: [PATCH] Applied PHP source formatting within programlisting tags git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@328911 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/ev/evembed/construct.xml | 24 ++++++++++++------------ reference/ev/evsignal/construct.xml | 4 ++-- reference/ev/evstat/attr.xml | 20 ++++++++++---------- reference/ev/evtimer/construct.xml | 20 ++++++++++---------- reference/ev/evtimer/createstopped.xml | 12 ++++++------ 5 files changed, 40 insertions(+), 40 deletions(-) diff --git a/reference/ev/evembed/construct.xml b/reference/ev/evembed/construct.xml index 5da420a8ed..d645560280 100644 --- a/reference/ev/evembed/construct.xml +++ b/reference/ev/evembed/construct.xml @@ -113,26 +113,26 @@ stop(); + echo "SIGTERM received\n"; + $watcher->stop(); }); Ev::run(); diff --git a/reference/ev/evstat/attr.xml b/reference/ev/evstat/attr.xml index 52b7e718ec..328fdb9206 100644 --- a/reference/ev/evstat/attr.xml +++ b/reference/ev/evstat/attr.xml @@ -136,18 +136,18 @@ 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(); diff --git a/reference/ev/evtimer/construct.xml b/reference/ev/evtimer/construct.xml index 56d6ed765d..d60b1c35fa 100644 --- a/reference/ev/evtimer/construct.xml +++ b/reference/ev/evtimer/construct.xml @@ -117,27 +117,27 @@ stop(); - // Stop the watcher if further calls cause more than 10 iterations - Ev::iteration() >= 10 and $w->stop(); + // Stop the watcher after 5 iterations + Ev::iteration() == 5 and $w->stop(); + // Stop the watcher if further calls cause more than 10 iterations + Ev::iteration() >= 10 and $w->stop(); }); // Create stopped timer. It will be inactive until we start it ourselves $w_stopped = EvTimer::createStopped(10, 5, function($w) { - echo "Callback of a timer created as stopped\n"; + echo "Callback of a timer created as stopped\n"; - // Stop the watcher after 2 iterations - Ev::iteration() >= 2 and $w->stop(); + // Stop the watcher after 2 iterations + Ev::iteration() >= 2 and $w->stop(); }); // Loop until Ev::stop() is called or all of watchers stop diff --git a/reference/ev/evtimer/createstopped.xml b/reference/ev/evtimer/createstopped.xml index c70e7a60f1..77be8d2a5e 100644 --- a/reference/ev/evtimer/createstopped.xml +++ b/reference/ev/evtimer/createstopped.xml @@ -121,17 +121,17 @@ stop(); + $w->stop(); - $stat = $w->data; + $stat = $w->data; - // 1 second after the most recent change of the file - printf("Current size: %ld\n", $stat->attr()['size']); + // 1 second after the most recent change of the file + printf("Current size: %ld\n", $stat->attr()['size']); }); $stat = new EvStat("/var/log/messages", 0., function () use ($timer) { - // Reset timer watcher - $timer->again(); + // Reset timer watcher + $timer->again(); }); $timer->data = $stat;