[TEP-COMMIT] [CVS admin] show the database uptime value

hpdl-OfajU3CKLf1/[email protected] 17 Aug 2004 23:50:14 -0000
Newsgroups gmane.comp.web.oscommerce.cvs
Message-ID <[email protected]>
Commit in admin/admin on MAIN

includes/functions/general.php +13 -6 1.165 -> 1.166

templates/pages/server_info.php +5 -1 1.1 -> 1.2

+18 -7

2 modified files

show the database uptime value

----------

admin /admin /includes /functions

general.php 1.165 -> 1.166

diff -u -r1.165 -r1.166
--- general.php 2004/08/15 18:10:55 1.165
+++ general.php 2004/08/17 23:50:13 1.166
@@ -815,27 +815,34 @@

////
// Retreive server information

- function tep_get_system_information() {
- global $HTTP_SERVER_VARS;

+ function osc_get_system_information() {
+ if (PHP_VERSION < 4.1) {
+ global $_SERVER;
+ }

- $db_query = tep_db_query("select now() as datetime");
- $db = tep_db_fetch_array($db_query);

+ global $osC_Database;

+ $Qdb_date = $osC_Database->query('select now() as datetime');
+ $Qdb_uptime = $osC_Database->query('show status like "Uptime"');
+

list($system, $host, $kernel) = preg_split('/[\s,]+/', @exec('uname -a'), 5);

+ $db_uptime = intval($Qdb_uptime->valueInt('Value') / 3600) . ':' . str_pad(intval(($Qdb_uptime->valueInt('Value') / 60) % 60), 2, '0', STR_PAD_LEFT);
+

return array('date' => tep_datetime_short(date('Y-m-d H:i:s')),
'system' => $system,
'kernel' => $kernel,
'host' => $host,
'ip' => gethostbyname($host),
'uptime' => @exec('uptime'),

- 'http_server' => $HTTP_SERVER_VARS['SERVER_SOFTWARE'],

+ 'http_server' => $_SERVER['SERVER_SOFTWARE'],

'php' => PHP_VERSION,
'zend' => (function_exists('zend_version') ? zend_version() : ''),
'db_server' => DB_SERVER,
'db_ip' => gethostbyname(DB_SERVER),
'db_version' => 'MySQL ' . (function_exists('mysql_get_server_info') ? mysql_get_server_info() : ''),

- 'db_date' => tep_datetime_short($db['datetime']));

+ 'db_date' => tep_datetime_short($Qdb_date->value('datetime')),
+ 'db_uptime' => $db_uptime);

}

function tep_generate_category_path($id, $from = 'category', $categories_array = '', $index = 0) {

----------

admin /admin /templates /pages

server_info.php 1.1 -> 1.2

diff -u -r1.1 -r1.2
--- server_info.php 2004/08/15 22:59:26 1.1
+++ server_info.php 2004/08/17 23:50:14 1.2
@@ -10,7 +10,7 @@

Released under the GNU General Public License
*/

- $system = tep_get_system_information();

+ $system = osc_get_system_information();

?>

<h1><?php echo HEADING_TITLE; ?></h1>

@@ -40,6 +40,10 @@

<tr>
<td class="smallText"><b><?php echo TITLE_SERVER_UP_TIME; ?></b></td>
<td colspan="3" class="smallText"><?php echo $system['uptime']; ?></td>

+ </tr>
+ <tr>
+ <td class="smallText"><b><?php echo TITLE_DATABASE_UP_TIME; ?></b></td>
+ <td colspan="3" class="smallText"><?php echo $system['db_uptime']; ?></td>

</tr>
<tr>
<td colspan="4"><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>

CVSspam 0.2.9

-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285