Skip to content

Commit

Permalink
Update PhpSysInfos to 3.1.17
Browse files Browse the repository at this point in the history
  • Loading branch information
5050 committed Jan 11, 2015
1 parent 6883fb1 commit 64ff86a
Show file tree
Hide file tree
Showing 103 changed files with 3,505 additions and 1,107 deletions.
45 changes: 45 additions & 0 deletions etc/apps/phpsysinfo/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,51 @@ Changelog of phpSysInfo

http://phpsysinfo.sourceforge.net/

phpSysInfo 3.1.17
----------------

- [UPD] BAT plugin - capacity unit, cycle count, FreeBSD support
- [UPD] Brazilian Portuguese Translation pt-br.xml

- [ADD] Show the number of processes on Haiku
- [ADD] ThermalZone sensor support for WinNT
- [ADD] Tanglu to detected distros
- [ADD] Android and OS X version name

- [FIX] Fixed display of treetables

phpSysInfo 3.1.16
----------------

- [ADD] Show the number of processes
- [ADD] Lunar and 4MLinux to detected distros

phpSysInfo 3.1.15
----------------

- [ADD] CoreOS and Pisi Linux to detected distros
- [ADD] pmset - UPS support on Darwin (thanks to pelletierr)
- [ADD] lspci support on Darwin
- [ADD] SHOW_CPULIST_EXPANDED option
- [ADD] lxc/docker detection on Linux
- [ADD] ability to hide all disks and all network interfaces

- [FIX] Small CSS fix

- [UPD] Memory informations on Darwin systems
- [UPD] BAT plugin - Darwin support

phpSysInfo 3.1.14
----------------

- [ADD] FreeIPMI sensor program support
- [ADD] IPMIutil sensor program support
- [ADD] PowerSoftPlus (EVER) UPS program support
- [ADD] Line frequency for the UPS info
- [ADD] SENSOR_EVENTS option - show events of sensors
- [ADD] HIDE_RAID_DEVICES option for plugins MDStatus and DMRaid - list of RAID devices to hide
- [ADD] idash template

phpSysInfo 3.1.13
----------------

Expand Down
2 changes: 1 addition & 1 deletion etc/apps/phpsysinfo/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* phpSysInfo version
*/
define('PSI_VERSION','3.1.13');
define('PSI_VERSION', '3.1.17');
/**
* phpSysInfo configuration
*/
Expand Down
35 changes: 35 additions & 0 deletions etc/apps/phpsysinfo/data/distros.ini
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,16 @@ Files = "/etc/antix-version"
Image = "IPFire.png"
;detected in "/etc/system-release"

[4MLinux]
Image = "4MLinux.png"
Name = "4MLinux"
Files = "/etc/4MLinux-version"

[Lunar Linux]
Image = "Lunar.png"
;detected in "/etc/lsb-release"
;detected in "/etc/os-release"

[CRUX]
Image = "Crux.png"
Mode = "Execute"
Expand Down Expand Up @@ -105,13 +115,28 @@ Image = "Tails.png"
;detected in "/etc/os-release"
;wrong in "/etc/debian_version" Debian

[Tanglu]
Image = "Tanglu.png"
;detected in "lsb_release -a"
;detected in "/etc/lsb-release"
;wrong in "/etc/debian_version" Debian

[Tanglu GNU/Linux]
Image = "Tanglu.png"
;detected in "/etc/os-release"

[KaOS]
Image = "KaOS.png"
Files = "/etc/KaOS-release"
;detected in "lsb_release -a"
;detected in "/etc/lsb-release"
;detected in "/etc/os-release"

[CoreOS]
Image = "CoreOS.png"
;detected in "/etc/lsb-release"
;detected in "/etc/os-release"

[BOSS]
Image = "BOSS.png"
Name = "BOSS GNU/Linux"
Expand Down Expand Up @@ -370,6 +395,16 @@ Image = "StartOS.png"
Files = "/etc/startos-release"
;detected in "lsb_release -a"

[PisiLinux]
Image = "Pisi.png"
Files = "/etc/pisilinux-release"
;detected in "lsb_release -a"
;detected in "/etc/lsb-release"

[Pisi_Linux]
Image = "Pisi.png"
;detected in "/etc/system-release"

[SME]
Image = "SMEServer.png"
Files = "/etc/e-smith-release"
Expand Down
31 changes: 31 additions & 0 deletions etc/apps/phpsysinfo/data/osnames.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
[Android]
1.0="Apple Pie"
1.1="Banana Bread"
1.5="Cupcake"
1.6="Donut"
2.0="Eclair"
2.1="Eclair"
2.2="Froyo"
2.3="Gingerbread"
3.0="Honeycomb"
3.1="Honeycomb"
3.2="Honeycomb"
4.0="Ice Cream Sandwich"
4.1="Jelly Bean"
4.2="Jelly Bean"
4.3="Jelly Bean"
4.4="KitKat"
5.0="Lollipop"

[OS X]
10.0="Cheetah"
10.1="Puma"
10.2="Jaguar"
10.3="Panther"
10.4="Tiger"
10.5="Leopard"
10.6="Snow Leopard"
10.7="Lion"
10.8="Mountain Lion"
10.9="Mavericks"
10.10="Yosemite"
Binary file added etc/apps/phpsysinfo/gfx/images/4MLinux.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added etc/apps/phpsysinfo/gfx/images/CoreOS.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added etc/apps/phpsysinfo/gfx/images/Lunar.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added etc/apps/phpsysinfo/gfx/images/Pisi.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added etc/apps/phpsysinfo/gfx/images/Tanglu.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified etc/apps/phpsysinfo/gfx/treeTable/tv-collapsable-last.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified etc/apps/phpsysinfo/gfx/treeTable/tv-expandable-last.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified etc/apps/phpsysinfo/gfx/treeTable/tv-expandable.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 8 additions & 4 deletions etc/apps/phpsysinfo/includes/class.CommonFunctions.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,15 +205,19 @@ public static function executeProgram($strProgramname, $strArgs, &$strBuffer, $b
if ($arrArgs[$i] == '|') {
$strCmd = $arrArgs[$i + 1];
$strNewcmd = self::_findProgram($strCmd);
$strArgs = preg_replace("/\| ".$strCmd.'/', "| ".$strNewcmd, $strArgs);
$strArgs = preg_replace("/\| ".$strCmd.'/', '| "'.$strNewcmd.'"', $strArgs);
}
}
}
$descriptorspec = array(0=>array("pipe", "r"), 1=>array("pipe", "w"), 2=>array("pipe", "w"));
if (defined("PSI_MODE_POPEN") && PSI_MODE_POPEN === true) {
$process = $pipes[1] = popen($strProgram." ".$strArgs." 2>/dev/null", "r");
if (PSI_OS == 'WINNT') {
$process = $pipes[1] = popen('"'.$strProgram.'" '.$strArgs." 2>nul", "r");
} else {
$process = $pipes[1] = popen('"'.$strProgram.'" '.$strArgs." 2>/dev/null", "r");
}
} else {
$process = proc_open($strProgram." ".$strArgs, $descriptorspec, $pipes);
$process = proc_open('"'.$strProgram.'" '.$strArgs, $descriptorspec, $pipes);
}
if (is_resource($process)) {
self::_timeoutfgets($pipes, $strBuffer, $strError);
Expand Down Expand Up @@ -444,7 +448,7 @@ private static function _timeoutfgets($pipes, &$out, &$err, $timeout = 30)
} else {
$pipe2 = true;
}
while (!(feof($pipes[1]) || ($pipe2 && feof($pipes[2])))) {
while (!(feof($pipes[1]) && (!$pipe2 || feof($pipes[2])))) {
if ($pipe2) {
$read = array($pipes[1], $pipes[2]);
} else {
Expand Down
4 changes: 2 additions & 2 deletions etc/apps/phpsysinfo/includes/class.Parser.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ class Parser
*
* @return Array
*/
public static function lspci()
public static function lspci($debug = PSI_DEBUG)
{
$arrResults = array();
if (CommonFunctions::executeProgram("lspci", "", $strBuf, PSI_DEBUG)) {
if (CommonFunctions::executeProgram("lspci", "", $strBuf, $debug)) {
$arrLines = preg_split("/\n/", $strBuf, -1, PREG_SPLIT_NO_EMPTY);
foreach ($arrLines as $strLine) {
$arrParams = preg_split('/ /', trim($strLine), 2);
Expand Down
177 changes: 177 additions & 0 deletions etc/apps/phpsysinfo/includes/mb/class.freeipmi.inc.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
<?php
/**
* freeipmi sensor class
*
* PHP version 5
*
* @category PHP
* @package PSI_Sensor
* @author Michael Cramer <BigMichi1@users.sourceforge.net>
* @copyright 2009 phpSysInfo
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
* @version SVN: $Id: class.freeipmi.inc.php 661 2012-08-27 11:26:39Z namiltd $
* @link http://phpsysinfo.sourceforge.net
*/
/**
* getting information from ipmi-sensors
*
* @category PHP
* @package PSI_Sensor
* @author Michael Cramer <BigMichi1@users.sourceforge.net>
* @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 FreeIPMI extends Sensors
{
/**
* content to parse
*
* @var array
*/
private $_lines = array();

/**
* fill the private content var through tcp or file access
*/
public function __construct()
{
parent::__construct();
switch (strtolower(PSI_SENSOR_ACCESS)) {
case 'command':
CommonFunctions::executeProgram('ipmi-sensors', '--output-sensor-thresholds', $lines);
$this->_lines = preg_split("/\n/", $lines, -1, PREG_SPLIT_NO_EMPTY);
break;
case 'file':
if (CommonFunctions::rfts(APP_ROOT.'/data/freeipmi.txt', $lines)) {
$this->_lines = preg_split("/\n/", $lines, -1, PREG_SPLIT_NO_EMPTY);
}
break;
default:
$this->error->addConfigError('__construct()', 'PSI_SENSOR_ACCESS');
break;
}
}

/**
* get temperature information
*
* @return void
*/
private function _temperature()
{
foreach ($this->_lines as $line) {
$buffer = preg_split("/\s*\|\s*/", $line);
if ($buffer[2] == "Temperature" && $buffer[11] != "N/A" && $buffer[4] == "C") {
$dev = new SensorDevice();
$dev->setName($buffer[1]);
$dev->setValue($buffer[3]);
if ($buffer[9] != "N/A") $dev->setMax($buffer[9]);
if ($buffer[11] != "'OK'") $dev->setEvent(trim($buffer[11],"'"));
$this->mbinfo->setMbTemp($dev);
}
}
}

/**
* get voltage information
*
* @return void
*/
private function _voltage()
{
foreach ($this->_lines as $line) {
$buffer = preg_split("/\s*\|\s*/", $line);
if ($buffer[2] == "Voltage" && $buffer[11] != "N/A" && $buffer[4] == "V") {
$dev = new SensorDevice();
$dev->setName($buffer[1]);
$dev->setValue($buffer[3]);
if ($buffer[6] != "N/A") $dev->setMin($buffer[6]);
if ($buffer[9] != "N/A") $dev->setMax($buffer[9]);
if ($buffer[11] != "'OK'") $dev->setEvent(trim($buffer[11],"'"));
$this->mbinfo->setMbVolt($dev);
}
}
}

/**
* get fan information
*
* @return void
*/
private function _fans()
{
foreach ($this->_lines as $line) {
$buffer = preg_split("/\s*\|\s*/", $line);
if ($buffer[2] == "Fan" && $buffer[11] != "N/A" && $buffer[4] == "RPM") {
$dev = new SensorDevice();
$dev->setName($buffer[1]);
$dev->setValue($buffer[3]);
if ($buffer[6] != "N/A") {
$dev->setMin($buffer[6]);
} elseif (($buffer[9] != "N/A") && ($buffer[9]<$buffer[3])) { //max instead min issue
$dev->setMin($buffer[9]);
}
if ($buffer[11] != "'OK'") $dev->setEvent(trim($buffer[11],"'"));
$this->mbinfo->setMbFan($dev);
}
}
}

/**
* get power information
*
* @return void
*/
private function _power()
{
foreach ($this->_lines as $line) {
$buffer = preg_split("/\s*\|\s*/", $line);
if ($buffer[2] == "Current" && $buffer[11] != "N/A" && $buffer[4] == "W") {
$dev = new SensorDevice();
$dev->setName($buffer[1]);
$dev->setValue($buffer[3]);
if ($buffer[9] != "N/A") $dev->setMax($buffer[9]);
if ($buffer[11] != "'OK'") $dev->setEvent(trim($buffer[11],"'"));
$this->mbinfo->setMbPower($dev);
}
}
}

/**
* get current information
*
* @return void
*/
private function _current()
{
foreach ($this->_lines as $line) {
$buffer = preg_split("/\s*\|\s*/", $line);
if ($buffer[2] == "Current" && $buffer[11] != "N/A" && $buffer[4] == "A") {
$dev = new SensorDevice();
$dev->setName($buffer[1]);
$dev->setValue($buffer[3]);
if ($buffer[9] != "N/A") $dev->setMax($buffer[9]);
if ($buffer[11] != "'OK'") $dev->setEvent(trim($buffer[11],"'"));
$this->mbinfo->setMbCurrent($dev);
}
}
}

/**
* get the information
*
* @see PSI_Interface_Sensor::build()
*
* @return Void
*/
public function build()
{
$this->_temperature();
$this->_voltage();
$this->_fans();
$this->_power();
$this->_current();
}
}
5 changes: 5 additions & 0 deletions etc/apps/phpsysinfo/includes/mb/class.healthd.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ public function __construct()
CommonFunctions::executeProgram('healthdc', '-t', $lines);
$this->_lines = preg_split("/\n/", $lines, -1, PREG_SPLIT_NO_EMPTY);
break;
case 'file':
if (CommonFunctions::rfts(APP_ROOT.'/data/healthd.txt', $lines)) {
$this->_lines = preg_split("/\n/", $lines, -1, PREG_SPLIT_NO_EMPTY);
}
break;
default:
$this->error->addConfigError('__construct()', 'PSI_SENSOR_ACCESS');
break;
Expand Down

0 comments on commit 64ff86a

Please sign in to comment.