Warning: Undefined variable $UploadMaxSize in /home/kongdmdu/pmichaud/pmwiki/local/PITS.php on line 8

Warning: Undefined variable $UploadMaxSize in /home/kongdmdu/pmichaud/pmwiki/local/PITS.php on line 9

Warning: Undefined variable $UploadMaxSize in /home/kongdmdu/pmichaud/pmwiki/local/PITS.php on line 10

Warning: Undefined variable $UploadMaxSize in /home/kongdmdu/pmichaud/pmwiki/local/PITS.php on line 11

Warning: Undefined array key "pmwiki" in /home/kongdmdu/pmichaud/pmwiki/pub/skins/vector/vector.php on line 14

Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /home/kongdmdu/pmichaud/pmwiki/pub/skins/vector/vector.php on line 14

Warning: Undefined array key "pagename" in /home/kongdmdu/pmichaud/pmwiki/pub/skins/vector/vector.php on line 225

Warning: Undefined array key "pagename" in /home/kongdmdu/pmichaud/pmwiki/pub/skins/vector/vector.php on line 253
00094: getrusage() called by mistake, issues warning - PITS - PmWiki

00094: getrusage() called by mistake, issues warning

Summary: getrusage() called by mistake, issues warning
Created: 2004-10-14 06:06
Status: Closed - fixed for 2.0.devel16
Category: Bug
From: Adam Bull
Assigned:
Priority: 2
Version: 2.0.devel13
OS: Windows/Apache/4.2.3

Description: In pmwiki.php, StopWatch() uses the getrusage() function, which doesn't work on Windows. It does first check to see if getrusage() exists; however, on this version of PHP, the function exists, it just returns null and outputs a warning.

Replacing the code:

  if (function_exists('getrusage')) {
    $dat = getrusage();
    $GLOBALS['StopWatch'][] = ...

With:

  if (function_exists('getrusage')) {
    $dat = @getrusage();
    if ($dat)
      $GLOBALS['StopWatch'][] = ...

Fixes the problem.


Fixed, thanks. --Pm