[Phpsysinfo-subversion] SF.net SVN: phpsysinfo:[252] includes
Brought to you by:
namiltd
From: <big...@us...> - 2009-06-17 13:06:50
|
Revision: 252 http://phpsysinfo.svn.sourceforge.net/phpsysinfo/?rev=252&view=rev Author: bigmichi1 Date: 2009-06-17 13:06:44 +0000 (Wed, 17 Jun 2009) Log Message: ----------- Device TrasportObjects Added Paths: ----------- includes/to/ includes/to/device/ includes/to/device/class.CpuDevice.inc.php includes/to/device/class.DiskDevice.inc.php includes/to/device/class.HWDevice.inc.php includes/to/device/class.NetDevice.inc.php includes/to/device/class.SensorDevice.inc.php Added: includes/to/device/class.CpuDevice.inc.php =================================================================== --- includes/to/device/class.CpuDevice.inc.php (rev 0) +++ includes/to/device/class.CpuDevice.inc.php 2009-06-17 13:06:44 UTC (rev 252) @@ -0,0 +1,259 @@ +<?php +/** + * CpuDevice TO class + * + * PHP version 5 + * + * @category PHP + * @package PSI_TO + * @author Michael Cramer <Big...@us...> + * @copyright 2009 phpSysInfo + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @version SVN: $Id$ + * @link http://phpsysinfo.sourceforge.net + */ + /** + * CpuDevice TO class + * + * @category PHP + * @package PSI_TO + * @author Michael Cramer <Big...@us...> + * @copyright 2009 phpSysInfo + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @version Release: 3.0 + * @link http://phpsysinfo.sourceforge.net + */ +class CpuDevice +{ + /** + * model of the cpu + * + * @var String + */ + private $_model = ""; + + /** + * speed of the cpu in hertz + * + * @var Integer + */ + private $_cpuSpeed = 0; + + /** + * cache size in bytes, if available + * + * @var Integer + */ + private $_cache = null; + + /** + * busspeed in hertz, if available + * + * @var Integer + */ + private $_busSpeed = null; + + /** + * temperature of the cpu, if available + * + * @var Integer + */ + private $_temp = null; + + /** + * bogomips of the cpu, if available + * + * @var Integer + */ + private $_bogomips = null; + + /** + * current load in percent of the cpu, if available + * + * @var Integer + */ + private $_load = null; + + /** + * Returns $_bogomips. + * + * @see Cpu::$_bogomips + * + * @return Integer + */ + public function getBogomips() + { + return $this->_bogomips; + } + + /** + * Sets $_bogomips. + * + * @param Integer $bogomips bogompis + * + * @see Cpu::$_bogomips + * + * @return Void + */ + public function setBogomips($bogomips) + { + $this->_bogomips = $bogomips; + } + + /** + * Returns $_busSpeed. + * + * @see Cpu::$_busSpeed + * + * @return Integer + */ + public function getBusSpeed() + { + return $this->_busSpeed; + } + + /** + * Sets $_busSpeed. + * + * @param Integer $busSpeed busspeed + * + * @see Cpu::$_busSpeed + * + * @return Void + */ + public function setBusSpeed($busSpeed) + { + $this->_busSpeed = $busSpeed; + } + + /** + * Returns $_cache. + * + * @see Cpu::$_cache + * + * @return Integer + */ + public function getCache() + { + return $this->_cache; + } + + /** + * Sets $_cache. + * + * @param Integer $cache cache size + * + * @see Cpu::$_cache + * + * @return Void + */ + public function setCache($cache) + { + $this->_cache = $cache; + } + + /** + * Returns $_cpuSpeed. + * + * @see Cpu::$_cpuSpeed + * + * @return Integer + */ + public function getCpuSpeed() + { + return $this->_cpuSpeed; + } + + /** + * Sets $_cpuSpeed. + * + * @param Integer $cpuSpeed cpuspeed + * + * @see Cpu::$_cpuSpeed + * + * @return Void + */ + public function setCpuSpeed($cpuSpeed) + { + $this->_cpuSpeed = $cpuSpeed; + } + + /** + * Returns $_model. + * + * @see Cpu::$_model + * + * @return String + */ + public function getModel() + { + return $this->_model; + } + + /** + * Sets $_model. + * + * @param String $model cpumodel + * + * @see Cpu::$_model + * + * @return Void + */ + public function setModel($model) + { + $this->_model = $model; + } + + /** + * Returns $_temp. + * + * @see Cpu::$_temp + * + * @return Integer + */ + public function getTemp() + { + return $this->_temp; + } + + /** + * Sets $_temp. + * + * @param Integer $temp temperature + * + * @see Cpu::$_temp + * + * @return Void + */ + public function setTemp($temp) + { + $this->_temp = $temp; + } + + /** + * Returns $_load. + * + * @see CpuDevice::$_load + * + * @return Integer + */ + public function getLoad() + { + return $this->_load; + } + + /** + * Sets $_load. + * + * @param Integer $load load percent + * + * @see CpuDevice::$_load + * + * @return Void + */ + public function setLoad($load) + { + $this->_load = $load; + } +} +?> Property changes on: includes/to/device/class.CpuDevice.inc.php ___________________________________________________________________ Added: svn:mime-type + text/x-php Added: svn:keywords + Id Added: svn:eol-style + LF Added: includes/to/device/class.DiskDevice.inc.php =================================================================== --- includes/to/device/class.DiskDevice.inc.php (rev 0) +++ includes/to/device/class.DiskDevice.inc.php 2009-06-17 13:06:44 UTC (rev 252) @@ -0,0 +1,310 @@ +<?php +/** + * DiskDevice TO class + * + * PHP version 5 + * + * @category PHP + * @package PSI_TO + * @author Michael Cramer <Big...@us...> + * @copyright 2009 phpSysInfo + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @version SVN: $Id$ + * @link http://phpsysinfo.sourceforge.net + */ + /** + * DiskDevice TO class + * + * @category PHP + * @package PSI_TO + * @author Michael Cramer <Big...@us...> + * @copyright 2009 phpSysInfo + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @version Release: 3.0 + * @link http://phpsysinfo.sourceforge.net + */ +class DiskDevice +{ + /** + * name of the disk device + * + * @var String + */ + private $_name = ""; + + /** + * type of the filesystem on the disk device + * + * @var String + */ + private $_fsType = ""; + + /** + * diskspace that is free in bytes + * + * @var Integer + */ + private $_free = 0; + + /** + * diskspace that is used in bytes + * + * @var Integer + */ + private $_used = 0; + + /** + * total diskspace + * + * @var Integer + */ + private $_total = 0; + + /** + * mount point of the disk device if available + * + * @var String + */ + private $_mountPoint = null; + + /** + * additional options of the device, like mount options + * + * @var String + */ + private $_options = null; + + /** + * inodes usage in percent if available + * + * @var + */ + private $_percentInodesUsed = null; + + /** + * Returns PercentUsed calculated when function is called from internal values + * + * @see DiskDevice::$_total + * @see DiskDevice::$_used + * + * @return Integer + */ + public function getPercentUsed() + { + if ($this->_total > 0) { + return ceil($this->_used / $this->_total * 100); + } else { + return 0; + } + } + + + /** + * Returns $_PercentInodesUsed. + * + * @see DiskDevice::$_PercentInodesUsed + * + * @return Integer + */ + public function getPercentInodesUsed() + { + return $this->_percentInodesUsed; + } + + /** + * Sets $_PercentInodesUsed. + * + * @param Integer $percentInodesUsed inodes percent + * + * @see DiskDevice::$_PercentInodesUsed + * + * @return Void + */ + public function setPercentInodesUsed($percentInodesUsed) + { + $this->_percentInodesUsed = $percentInodesUsed; + } + + /** + * Returns $_free. + * + * @see DiskDevice::$_free + * + * @return Integer + */ + public function getFree() + { + return $this->_free; + } + + /** + * Sets $_free. + * + * @param Integer $free free bytes + * + * @see DiskDevice::$_free + * + * @return Void + */ + public function setFree($free) + { + $this->_free = $free; + } + + /** + * Returns $_fsType. + * + * @see DiskDevice::$_fsType + * + * @return String + */ + public function getFsType() + { + return $this->_fsType; + } + + /** + * Sets $_fsType. + * + * @param String $fsType filesystemtype + * + * @see DiskDevice::$_fsType + * + * @return Void + */ + public function setFsType($fsType) + { + $this->_fsType = $fsType; + } + + /** + * Returns $_mountPoint. + * + * @see DiskDevice::$_mountPoint + * + * @return String + */ + public function getMountPoint() + { + return $this->_mountPoint; + } + + /** + * Sets $_mountPoint. + * + * @param String $mountPoint mountpoint + * + * @see DiskDevice::$_mountPoint + * + * @return Void + */ + public function setMountPoint($mountPoint) + { + $this->_mountPoint = $mountPoint; + } + + /** + * Returns $_name. + * + * @see DiskDevice::$_name + * + * @return String + */ + public function getName() + { + return $this->_name; + } + + /** + * Sets $_name. + * + * @param String $name device name + * + * @see DiskDevice::$_name + * + * @return Void + */ + public function setName($name) + { + $this->_name = $name; + } + + /** + * Returns $_options. + * + * @see DiskDevice::$_options + * + * @return String + */ + public function getOptions() + { + return $this->_options; + } + + /** + * Sets $_options. + * + * @param String $options additional options + * + * @see DiskDevice::$_options + * + * @return Void + */ + public function setOptions($options) + { + $this->_options = $options; + } + + /** + * Returns $_total. + * + * @see DiskDevice::$_total + * + * @return Integer + */ + public function getTotal() + { + return $this->_total; + } + + /** + * Sets $_total. + * + * @param Integer $total total bytes + * + * @see DiskDevice::$_total + * + * @return Void + */ + public function setTotal($total) + { + $this->_total = $total; + } + + /** + * Returns $_used. + * + * @see DiskDevice::$_used + * + * @return Integer + */ + public function getUsed() + { + return $this->_used; + } + + /** + * Sets $_used. + * + * @param Integer $used used bytes + * + * @see DiskDevice::$_used + * + * @return Void + */ + public function setUsed($used) + { + $this->_used = $used; + } +} +?> Property changes on: includes/to/device/class.DiskDevice.inc.php ___________________________________________________________________ Added: svn:mime-type + text/x-php Added: svn:keywords + Id Added: svn:eol-style + LF Added: includes/to/device/class.HWDevice.inc.php =================================================================== --- includes/to/device/class.HWDevice.inc.php (rev 0) +++ includes/to/device/class.HWDevice.inc.php 2009-06-17 13:06:44 UTC (rev 252) @@ -0,0 +1,144 @@ +<?php +/** + * HWDevice TO class + * + * PHP version 5 + * + * @category PHP + * @package PSI_TO + * @author Michael Cramer <Big...@us...> + * @copyright 2009 phpSysInfo + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @version SVN: $Id$ + * @link http://phpsysinfo.sourceforge.net + */ + /** + * HWDevice TO class + * + * @category PHP + * @package PSI_TO + * @author Michael Cramer <Big...@us...> + * @copyright 2009 phpSysInfo + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @version Release: 3.0 + * @link http://phpsysinfo.sourceforge.net + */ +class HWDevice +{ + /** + * name of the device + * + * @var String + */ + private $_name = ""; + + /** + * capacity of the device, if not available it will be null + * + * @var Integer + */ + private $_capacity = null; + + /** + * count of the device + * + * @var Integer + */ + private $_count = 1; + + /** + * compare a given device with the internal one + * + * @param HWDevice $dev device that should be compared + * + * @return boolean + */ + public function equals($dev) + { + if ($dev->get_name() === $this->_name && $dev->get_capacity() === $this->_capacity) { + return true; + } else { + return false; + } + } + + /** + * Returns $_capacity. + * + * @see HWDevice::$_capacity + * + * @return Integer + */ + public function getCapacity() + { + return $this->_capacity; + } + + /** + * Sets $_capacity. + * + * @param Integer $capacity device capacity + * + * @see HWDevice::$_capacity + * + * @return Void + */ + public function setCapacity($capacity) + { + $this->_capacity = $capacity; + } + + /** + * Returns $_name. + * + * @see HWDevice::$_name + * + * @return String + */ + public function getName() + { + return $this->_name; + } + + /** + * Sets $_name. + * + * @param String $name device name + * + * @see HWDevice::$_name + * + * @return Void + */ + public function setName($name) + { + $this->_name = $name; + } + + + /** + * Returns $_count. + * + * @see HWDevice::$_count + * + * @return Integer + */ + public function getCount() + { + return $this->_count; + } + + /** + * Sets $_count. + * + * @param Integer $count device count + * + * @see HWDevice::$_count + * + * @return Void + */ + public function setCount($count) + { + $this->_count = $count; + } +} +?> Property changes on: includes/to/device/class.HWDevice.inc.php ___________________________________________________________________ Added: svn:mime-type + text/x-php Added: svn:keywords + Id Added: svn:eol-style + LF Added: includes/to/device/class.NetDevice.inc.php =================================================================== --- includes/to/device/class.NetDevice.inc.php (rev 0) +++ includes/to/device/class.NetDevice.inc.php 2009-06-17 13:06:44 UTC (rev 252) @@ -0,0 +1,193 @@ +<?php +/** + * NetDevice TO class + * + * PHP version 5 + * + * @category PHP + * @package PSI_TO + * @author Michael Cramer <Big...@us...> + * @copyright 2009 phpSysInfo + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @version SVN: $Id$ + * @link http://phpsysinfo.sourceforge.net + */ + /** + * NetDevice TO class + * + * @category PHP + * @package PSI_TO + * @author Michael Cramer <Big...@us...> + * @copyright 2009 phpSysInfo + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @version Release: 3.0 + * @link http://phpsysinfo.sourceforge.net + */ +class NetDevice +{ + /** + * name of the device + * + * @var String + */ + private $_name = ""; + + /** + * transmitted bytes + * + * @var Integer + */ + private $_txBytes = 0; + + /** + * received bytes + * + * @var Integer + */ + private $_rxBytes = 0; + + /** + * counted error packages + * + * @var Integer + */ + private $_errors = 0; + + /** + * counted droped packages + * + * @var Integer + */ + private $_drops = 0; + + /** + * Returns $_drops. + * + * @see NetDevice::$_drops + * + * @return Integer + */ + public function getDrops() + { + return $this->_drops; + } + + /** + * Sets $_drops. + * + * @param Integer $drops dropped packages + * + * @see NetDevice::$_drops + * + * @return Void + */ + public function setDrops($drops) + { + $this->_drops = $drops; + } + + /** + * Returns $_errors. + * + * @see NetDevice::$_errors + * + * @return Integer + */ + public function getErrors() + { + return $this->_errors; + } + + /** + * Sets $_errors. + * + * @param Integer $errors error packages + * + * @see NetDevice::$_errors + * + * @return Void + */ + public function setErrors($errors) + { + $this->_errors = $errors; + } + + /** + * Returns $_name. + * + * @see NetDevice::$_name + * + * @return String + */ + public function getName() + { + return $this->_name; + } + + /** + * Sets $_name. + * + * @param String $name device name + * + * @see NetDevice::$_name + * + * @return Void + */ + public function setName($name) + { + $this->_name = $name; + } + + /** + * Returns $_rxBytes. + * + * @see NetDevice::$_rxBytes + * + * @return Integer + */ + public function getRxBytes() + { + return $this->_rxBytes; + } + + /** + * Sets $_rxBytes. + * + * @param Integer $rxBytes received bytes + * + * @see NetDevice::$_rxBytes + * + * @return Void + */ + public function setRxBytes($rxBytes) + { + $this->_rxBytes = $rxBytes; + } + + /** + * Returns $_txBytes. + * + * @see NetDevice::$_txBytes + * + * @return Integer + */ + public function getTxBytes() + { + return $this->_txBytes; + } + + /** + * Sets $_txBytes. + * + * @param Integer $txBytes transmitted bytes + * + * @see NetDevice::$_txBytes + * + * @return Void + */ + public function setTxBytes($txBytes) + { + $this->_txBytes = $txBytes; + } +} +?> Property changes on: includes/to/device/class.NetDevice.inc.php ___________________________________________________________________ Added: svn:mime-type + text/x-php Added: svn:keywords + Id Added: svn:eol-style + LF Added: includes/to/device/class.SensorDevice.inc.php =================================================================== --- includes/to/device/class.SensorDevice.inc.php (rev 0) +++ includes/to/device/class.SensorDevice.inc.php 2009-06-17 13:06:44 UTC (rev 252) @@ -0,0 +1,161 @@ +<?php +/** + * SensorDevice TO class + * + * PHP version 5 + * + * @category PHP + * @package PSI_TO + * @author Michael Cramer <Big...@us...> + * @copyright 2009 phpSysInfo + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @version SVN: $Id$ + * @link http://phpsysinfo.sourceforge.net + */ + /** + * SensorDevice TO class + * + * @category PHP + * @package PSI_TO + * @author Michael Cramer <Big...@us...> + * @copyright 2009 phpSysInfo + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @version Release: 3.0 + * @link http://phpsysinfo.sourceforge.net + */ +class SensorDevice +{ + /** + * name of the sensor + * + * @var String + */ + private $_name = ""; + + /** + * current value of the sensor + * + * @var Integer + */ + private $_value = 0; + + /** + * maximum value of the sensor + * + * @var Integer + */ + private $_max = 0; + + /** + * minimum value of the sensor + * + * @var Integer + */ + private $_min = 0; + + + /** + * Returns $_max. + * + * @see Sensor::$_max + * + * @return Integer + */ + public function getMax() + { + return $this->_max; + } + + /** + * Sets $_max. + * + * @param Integer $max maximum value + * + * @see Sensor::$_max + * + * @return Void + */ + public function setMax($max) + { + $this->_max = $max; + } + + /** + * Returns $_min. + * + * @see Sensor::$_min + * + * @return Integer + */ + public function getMin() + { + return $this->_min; + } + + /** + * Sets $_min. + * + * @param Integer $min minimum value + * + * @see Sensor::$_min + * + * @return Void + */ + public function setMin($min) + { + $this->_min = $min; + } + + /** + * Returns $_name. + * + * @see Sensor::$_name + * + * @return String + */ + public function getName() + { + return $this->_name; + } + + /** + * Sets $_name. + * + * @param String $name sensor name + * + * @see Sensor::$_name + * + * @return Void + */ + public function setName($name) + { + $this->_name = $name; + } + + /** + * Returns $_value. + * + * @see Sensor::$_value + * + * @return Integer + */ + public function getValue() + { + return $this->_value; + } + + /** + * Sets $_value. + * + * @param Integer $value current value + * + * @see Sensor::$_value + * + * @return Void + */ + public function setValue($value) + { + $this->_value = $value; + } +} +?> Property changes on: includes/to/device/class.SensorDevice.inc.php ___________________________________________________________________ Added: svn:mime-type + text/x-php Added: svn:keywords + Id Added: svn:eol-style + LF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |