[Phpsysinfo-subversion] SF.net SVN: phpsysinfo:[557] trunk/includes/os/class.BSDCommon.inc.php
Brought to you by:
namiltd
From: <na...@us...> - 2012-04-03 09:31:11
|
Revision: 557 http://phpsysinfo.svn.sourceforge.net/phpsysinfo/?rev=557&view=rev Author: namiltd Date: 2012-04-03 09:31:00 +0000 (Tue, 03 Apr 2012) Log Message: ----------- Modified Paths: -------------- trunk/includes/os/class.BSDCommon.inc.php Modified: trunk/includes/os/class.BSDCommon.inc.php =================================================================== --- trunk/includes/os/class.BSDCommon.inc.php 2012-04-01 12:02:30 UTC (rev 556) +++ trunk/includes/os/class.BSDCommon.inc.php 2012-04-03 09:31:00 UTC (rev 557) @@ -165,7 +165,7 @@ { if (count($this->_dmesg) === 0) { if (PHP_OS != "Darwin") { - if (CommonFunctions::rfts('/var/run/dmesg.boot', $buf)) { + if (CommonFunctions::rfts('/var/run/dmesg.txt', $buf)) { $parts = preg_split("/rebooting|Uptime/", $buf, -1, PREG_SPLIT_NO_EMPTY); $this->_dmesg = preg_split("/\n/", $parts[count($parts) - 1], -1, PREG_SPLIT_NO_EMPTY); } @@ -315,7 +315,7 @@ /* duplication security */ $notwas = true; foreach ($this->sys->getScsiDevices() as $finddev) { - if ($notwas && (($finddev->getName() == $ar_buf[1])||(strstr($finddev->getName(), ' ', true) == $ar_buf[1].":"))){ + if ($notwas && (strstr($finddev->getName(), ': ', true) == $ar_buf[1])){ $finddev->setCapacity($ar_buf[2] * 2048 * 1.049); $notwas = false; break; @@ -329,6 +329,11 @@ } } } + /* cleaning */ + foreach ($this->sys->getScsiDevices() as $finddev) { + if (strstr($finddev->getName(), ': ', true)) + $finddev->setName(substr(strstr($finddev->getName(), ': ', false),2,-1)); + } } /** @@ -383,7 +388,7 @@ /* duplication security */ $notwas = true; foreach ($this->sys->getIdeDevices() as $finddev) { - if ($notwas && (($finddev->getName() == $ar_buf[1])||(strstr($finddev->getName(), ' ', true) == $ar_buf[1].":"))){ + if ($notwas && (strstr($finddev->getName(), ': ', true) == $ar_buf[1])){ $finddev->setCapacity($ar_buf[2] * 1024); $notwas = false; break; @@ -397,6 +402,11 @@ } } } + /* cleaning */ + foreach ($this->sys->getIdeDevices() as $finddev) { + if (strstr($finddev->getName(), ': ', true)) + $finddev->setName(substr(strstr($finddev->getName(), ': ', false),2,-1)); + } } /** @@ -455,7 +465,8 @@ foreach ($this->readdmesg() as $line) { if (preg_match('/^(ugen[0-9\.]+): <(.*)> (.*) (.*)/', $line, $ar_buf)) { $dev = new HWDevice(); - $dev->setName($ar_buf[1].": ".$ar_buf[2]); +// $dev->setName($ar_buf[1].": ".$ar_buf[2]); + $dev->setName($ar_buf[2]); $this->sys->setUSBDevices($dev); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |