Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

hwinfo.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: hwinfo.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, "hwinfo.php" );
39
40
41 $t->set_file( "hw_info_tpl", "hwinfo.tpl" );
42
43 //$t->set_block( "hw_info_tpl", "hw_interface_tpl", "hw_interface" );
44
45 $t->setAllStrings();
46
47 $sys = eZSysinfo::cpu();
48
49 $t->set_var( "cpu_num", $sys['cpus'] );
50 $t->set_var( "cpu_model", $sys['model'] );
51 $t->set_var( "cpu_speed", $sys['mhz'] );
52 $t->set_var( "cpu_cache", $sys['cache'] );
53 $t->set_var( "cpu_bogomips", $sys['bogomips'] );
54
55 $ar_buf = eZSysinfo::pcibus();
56
57 $pci_bus = "";
58 if ( count( $ar_buf ) )
59 {
60 for ( $i = 0; $i < sizeof($ar_buf); $i++ )
61 {
62 $pci_bus .= $ar_buf[$i] . '<br />';
63 }
64 }
65
66 $t->set_var( "pci_bus", $pci_bus );
67
68 $ar_buf = eZSysinfo::idebus();
69
70 $ide_bus = "";
71 ksort( $ar_buf );
72 if ( count( $ar_buf ) )
73 {
74 while ( list($key, $value) = each( $ar_buf ) )
75 {
76 $ide_bus .= $key . ": " . $ar_buf[$key]["model"];
77 if ( isset( $ar_buf[$key]["capacity"] ) )
78 {
79 $ide_bus .= " (Capacity: " . sprintf("%.2f", $ar_buf[$key]["capacity"] / (1024 * 1024 * 2) ) . " GB )";
80 }
81 $ide_bus .= '<br>';
82 }
83 }
84
85 $t->set_var( "ide_bus", $ide_bus );
86
87 $ar_buf = eZSysinfo::scsibus();
88
89 $scsi_bus = "";
90 if ( count( $ar_buf ) )
91 {
92 for ( $i = 0; $i < sizeof($ar_buf); $i++ )
93 {
94 $scsi_bus .= $ar_buf[$i] . '<br>';
95 }
96 }
97
98 $t->set_var( "scsi_bus", $scsi_bus );
99
100 $t->pparse( "output", "hw_info_tpl" );
101
102 ?>
$i
$i
Definition: admin/adlist.php:91
eZSysinfo\idebus
static idebus()
Definition: ezsysinfo.php:196
eZSysinfo\cpu
static cpu()
Definition: ezsysinfo.php:472
eZSysinfo\pcibus
static pcibus()
Definition: ezsysinfo.php:159
eZSysinfo\scsibus
static scsibus()
Definition: ezsysinfo.php:235
eZTemplate
Definition: eztemplate.php:107
$pci_bus
$pci_bus
Definition: hwinfo.php:57
$ide_bus
$ide_bus
Definition: hwinfo.php:70
$t
$t
Definition: hwinfo.php:37
$scsi_bus
$scsi_bus
Definition: hwinfo.php:89
$ar_buf
$ar_buf
Definition: hwinfo.php:55
$Language
$Language
Definition: hwinfo.php:35
$ini
$ini
Definition: hwinfo.php:34
$sys
$sys
Definition: hwinfo.php:47
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.