*/ class TestPlatform { /** * The platform vendor * * @var string The platform vendor */ protected $_vendor = 'Unknown'; /** * The platform model * * @var string The platform model */ protected $_model = 'Unknown'; /** * The platform operating system * * @var string The platform operating system */ protected $_os = 'Unknown'; /** * The platform operating system version * * @var string The platform operating system version */ protected $_osver = 'Unknown'; /** * The platform operating system (compile) date * * @var string The platform operating system (compile) date */ protected $_osdate = null; /** * The platform serial number * * @var string The platform serial number */ protected $_serial = '(not implemented)'; /** * The system description * * @var string The system description */ protected $_sysDesc; /** * The system object ID * * @var string The system object ID */ protected $_sysObjId; /** * The constructor. * * @param SNMP $snmpHost The SNMP Host object * @return Platform An instance of $this (for fluent interfaces) */ public function __construct( $sysDesc, $sysObjId ) { $this->setSysDesc( $sysDesc ); $this->setSysObjId( $sysObjId ); $this->parse(); return $this; } public function parse() { // query the platform for it's description and parse it for details $sysDescr = $this->getSysDesc(); $sysObjectId = $this->getSysObjId(); // there's possibly a better way to do this...? foreach( glob( __DIR__ . '/Platforms/vendor_*.php' ) as $f ) include( $f ); } /** * Set the system description * * @param string $s The system desc * @return TestPlatform For fluent interfaces */ public function setSysDesc( $s ) { $this->_sysDesc = $s; return $this; } /** * Get the system description * * @return string The system description */ public function getSysDesc() { return $this->_sysDesc; } /** * Set the system obj ID * * @param string $s The system obj ID * @return TestPlatform For fluent interfaces */ public function setSysObjId( $s ) { $this->_sysObjId = $s; return $this; } /** * Get the system obj ID * * @return string The system obj ID */ public function getSysObjId() { return $this->_sysObjId; } /** * Get the SNMPHost object * * @return \OSS_SNMP\SNMP The SNMP object */ public function getSNMPHost() { return $this->_snmpHost; } /** * Set vendor * * @param string $s * @return \OSS_SNMP\Platform For fluent interfaces */ public function setVendor( $s ) { $this->_vendor = $s; return $this; } /** * Set model * * @param string $s * @return \OSS_SNMP\Platform For fluent interfaces */ public function setModel( $s ) { $this->_model = $s; return $this; } /** * Set operating system * * @param string $s * @return \OSS_SNMP\Platform For fluent interfaces */ public function setOs( $s ) { $this->_os = $s; return $this; } /** * Set OS version * * @param string $s * @return \OSS_SNMP\Platform For fluent interfaces */ public function setOsVersion( $s ) { $this->_osver = $s; return $this; } /** * Set OS date * * @param string $s * @return \OSS_SNMP\Platform For fluent interfaces */ public function setOsDate( $s ) { $this->_osdate = $s; return $this; } /** * Set the serial number * * @param string $s * @return \OSS_SNMP\Platform For fluent interfaces */ public function setSerialNumber( $s ) { $this->_serial = $s; return $this; } /** * Get vendor * * @return string */ public function getVendor() { return $this->_vendor; } /** * Get model * * @return string */ public function getModel() { return $this->_model; } /** * Get operating system * * @return string */ public function getOs() { return $this->_os; } /** * Get OS version * * @return string */ public function getOsVersion() { return $this->_osver; } /** * Get OS date * * return \DateTime */ public function getOsDate() { return $this->_osdate; } /** * Get the serial number * * return string */ public function getSerialNumber() { return $this->_serial; } }