Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

meminfo.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: meminfo.php 6231 2001-07-20 11:30:53Z jakobn $
5 //
6 // Created on: <22-Apr-2001 13:32:08 bf>
7 //
8 // This source file is part of Exponential Basic, publishing software.
9 //
10 // Copyright (C) 1999-2001 eZ Systems. All rights reserved.
11 //
12 // This program is free software; you can redistribute it and/or
13 // modify it under the terms of the GNU General Public License
14 // as published by the Free Software Foundation; either version 2
15 // of the License, or (at your option) any later version.
16 //
17 // This program is distributed in the hope that it will be useful,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 // GNU General Public License for more details.
21 //
22 // You should have received a copy of the GNU General Public License
23 // along with this program; if not, write to the Free Software
24 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, US
25 //
26
27
28 // include_once( "classes/eztemplate.php" );
29 // include_once( "classes/ezlocale.php" );
30 // include_once( "classes/ezhttptool.php" );
31
32 // include_once( "ezsysinfo/classes/ezsysinfo.php" );
33
34 $ini =& eZINI::instance( 'site.ini' );
35 $Language =& $ini->variable( "eZSysinfoMain", "Language" );
36
37 $t = new eZTemplate( "kernel/ezsysinfo/admin/" . $ini->variable( "eZSysinfoMain", "AdminTemplateDir" ),
38 "kernel/ezsysinfo/admin/intl/", $Language, "meminfo.php" );
39
40
41 $t->set_file( "mem_info_tpl", "meminfo.tpl" );
42
43 //$t->set_block( "hw_info_tpl", "hw_interface_tpl", "hw_interface" );
44
45 $t->setAllStrings();
46
47 $sys = eZSysinfo::cpu();
48 $scsi_bus = eZSysinfo::scsibus();
49
50 $t->set_var( "scsi_bus", $scsi_bus );
51
52 $mem = eZSysinfo::meminfo();
53
54 $t->set_var( "physical_free", eZSysinfo::format_bytesize(@$mem['ram']['t_free']) );
55 $t->set_var( "physical_used", eZSysinfo::format_bytesize(@$mem['ram']['t_used']) );
56 $t->set_var( "physical_total", eZSysinfo::format_bytesize(@$mem['ram']['total']) );
57
58 $t->set_var( "physical_percent", @$mem['ram']['percent'] );
59 $t->set_var( "physical_invert_percent", 100 - @$mem['ram']['percent'] );
60
61
62 $t->set_var( "swap_free", eZSysinfo::format_bytesize(@$mem['swap']['free']) );
63 $t->set_var( "swap_used", eZSysinfo::format_bytesize(@$mem['swap']['used']) );
64 $t->set_var( "swap_total", eZSysinfo::format_bytesize(@$mem['swap']['total']) );
65
66 $t->set_var( "swap_percent", @$mem['swap']['percent'] );
67 $t->set_var( "swap_invert_percent", 100 - @$mem['swap']['percent'] );
68
69
70
71 $t->pparse( "output", "mem_info_tpl" );
72
73 ?>
eZSysinfo\format_bytesize
static format_bytesize( $kbytes, $dec_places=2)
Definition: ezsysinfo.php:83
eZSysinfo\meminfo
static meminfo()
Definition: ezsysinfo.php:274
eZSysinfo\cpu
static cpu()
Definition: ezsysinfo.php:472
eZSysinfo\scsibus
static scsibus()
Definition: ezsysinfo.php:235
eZTemplate
Definition: eztemplate.php:107
$t
$t
Definition: meminfo.php:37
$scsi_bus
$scsi_bus
Definition: meminfo.php:48
$Language
$Language
Definition: meminfo.php:35
$mem
$mem
Definition: meminfo.php:52
$ini
$ini
Definition: meminfo.php:34
$sys
$sys
Definition: meminfo.php:47
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.