Quote:
06-05-03 at 02:24 AM TECK said this in Post #842
You cannot unfortunatelly.
|
Other than turning on magic_quotes_runtime in PHP.INI on a IIS/W2K box, how does one configure the server to support $serverload variable or exec('uptime') to calculate it? Isn't there another way to calculate uptime without using exec('uptime')? I believe that phpmyadmin aquires this information in a different way...
I noticed that the problem of vbPortal has returned with additional text in the admin-box sections so I stripped out;
Code:
if ( $stats = @exec( 'uptime' ) )
{
preg_match( '/averages?: ([0-9\.]+),[\s]+([0-9\.]+),[\s]+([0-9\.]+)/' , $stats , $regs );
$serverload = ' [Server Load: <font color="{ hovercolor}"><b>' . $regs[1] . '</b></font> ? ' . $regs[2] . ' : ' . $regs[3] . ']';
}
And the $serverload entry the next line defining $adminstats, and the problem with the extra text in the vbPortal boxes went away...
Just playing around with phpmyadmin, I found this worked with 1 inclusion (page buffer) and extra information you may want to play around with ...
Code:
<?php
//**
// * Get core libraries
// */
//if (!defined('PMA_GRAB_GLOBALS_INCLUDED')) {
// include('./libraries/grab_globals.lib.php');
//}
if (!defined('PMA_COMMON_LIB_INCLUDED')) {
include('./libraries/common.lib.php');
}
/**
* Handles some variables that may have been sent by the code below
*/
if (isset($db)) {
unset($db);
}
if (isset($table)) {
unset($table);
}
/**
* InnoDB status
*/
if (!empty($innodbstatus)) {
echo '<h2>' . "\n"
. ' ' . $strInnodbStat . "\n"
. '</h2>' . "\n";
$sql_query = 'SHOW INNODB STATUS;';
$res = PMA_mysql_query($sql_query, $userlink) or PMA_mysqlDie(PMA_mysql_error($userlink), $sql_query);
$row = PMA_mysql_fetch_row($res);
echo '<pre>' . "\n"
. htmlspecialchars($row[0]) . "\n"
. '</pre>' . "\n";
mysql_free_result($res);
include('./footer.inc.php');
exit;
}
/**
* Sends the query and buffers the result
*/
$res = @PMA_mysql_query('SHOW STATUS;', $userlink) or PMA_mysqlDie(PMA_mysql_error($userlink), 'SHOW STATUS;');
while ($row = PMA_mysql_fetch_row($res)) {
$serverStatus[$row[0]] = $row[1];
}
@mysql_free_result($res);
unset($res);
unset($row);
/**
* Displays the page
*/
//Uptime calculation
$res = @PMA_mysql_query('SELECT UNIX_TIMESTAMP() - ' . $serverStatus['Uptime'] . ';');
$row = PMA_mysql_fetch_row($res);
echo sprintf($strServerStatusUptime, PMA_timespanFormat($serverStatus['Uptime']), PMA_localisedDate($row[0])) . "\n";
mysql_free_result($res);
unset($res);
unset($row);
?>
Glitch