Changeset 256


Ignore:
Timestamp:
Nov 5, 2009, 6:28:14 PM (11 years ago)
Author:
zerodeux
Message:

0.2.1 release - bugfix: don't run in CLI mode, pollutes cronjob stderr

Location:
phptop
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • phptop/NEWS

    r248 r256  
     1phptop 0.2.1 - 2009-11-05
     2
     3        * Don't run hook in CLI mode, it pollutes stderr and makes cronjobs noisy
     4
    15phptop 0.2 - 2009-10-20
    26
  • phptop/TODO

    r234 r256  
    55- Handle gzipped logs (easy, but useful ?)
    66- Handle log from stdin (easy, but useful ?)
     7- Use 'tac' to parse logs if available (faster)
  • phptop/debian/changelog

    r239 r256  
     1phptop (0.2.1) stable; urgency=low
     2
     3  * Upstream update
     4
     5 -- Vincent CARON <vcaron@bearstech.com>  Thu, 05 Nov 2009 18:21:45 +0100
     6
    17phptop (0.2-1) stable; urgency=low
    28
  • phptop/phptop

    r239 r256  
    2626
    2727my $package_name    = 'phptop';
    28 my $package_version = '0.2';
     28my $package_version = '0.2.1';
    2929my $package_owner   = 'Copyright (C) 2009 Bearstech - http://bearstech.com/';
    3030my $package_url     = 'http://forge.bearstech.com/trac/wiki/PhpTop';
  • phptop/phptop_hook.php

    r239 r256  
    1717 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
    1818 */
     19
     20function _phptop_init() {
     21  global $_phptop_t0;
     22  $t0 = microtime(TRUE);
     23  $ru = getrusage();
     24  $_phptop_t0 = array(
     25    'time' => $t0,
     26    'tusr' => $ru['ru_utime.tv_sec'] + $ru['ru_utime.tv_usec'] / 1e6,
     27    'tsys' => $ru['ru_stime.tv_sec'] + $ru['ru_stime.tv_usec'] / 1e6
     28  );
     29  register_shutdown_function('_phptop_fini');
     30}
    1931
    2032function _phptop_fini() {
     
    4254}
    4355
    44 global $_phptop_t0;
    45 $t0 = microtime(TRUE);
    46 $ru = getrusage();
    47 $_phptop_t0 = array(
    48   'time' => $t0,
    49   'tusr' => $ru['ru_utime.tv_sec'] + $ru['ru_utime.tv_usec'] / 1e6,
    50   'tsys' => $ru['ru_stime.tv_sec'] + $ru['ru_stime.tv_usec'] / 1e6
    51 );
    52 register_shutdown_function('_phptop_fini');
     56/* Don't run in CLI, it pollutes stderr and makes cronjob un-needingly noisy */
     57if (php_sapi_name() != 'cli') _phptop_init();
    5358?>
Note: See TracChangeset for help on using the changeset viewer.