phpsysinfo-subversion Mailing List for phpSysInfo
Brought to you by:
namiltd
You can subscribe to this list here.
| 2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(10) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2007 |
Jan
(11) |
Feb
(4) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(40) |
| 2009 |
Jan
(60) |
Feb
(15) |
Mar
(36) |
Apr
(19) |
May
(28) |
Jun
(71) |
Jul
(15) |
Aug
(3) |
Sep
(22) |
Oct
(5) |
Nov
(1) |
Dec
|
| 2010 |
Jan
(18) |
Feb
(5) |
Mar
(2) |
Apr
(1) |
May
(1) |
Jun
(3) |
Jul
|
Aug
|
Sep
(2) |
Oct
(4) |
Nov
(16) |
Dec
(9) |
| 2011 |
Jan
(9) |
Feb
(8) |
Mar
(1) |
Apr
(3) |
May
(2) |
Jun
|
Jul
(4) |
Aug
(15) |
Sep
(2) |
Oct
|
Nov
(7) |
Dec
(3) |
| 2012 |
Jan
(5) |
Feb
(10) |
Mar
(11) |
Apr
(16) |
May
(10) |
Jun
(7) |
Jul
(33) |
Aug
(43) |
Sep
(32) |
Oct
|
Nov
(6) |
Dec
(6) |
|
From: <na...@us...> - 2012-12-08 19:09:01
|
Revision: 714
http://phpsysinfo.svn.sourceforge.net/phpsysinfo/?rev=714&view=rev
Author: namiltd
Date: 2012-12-08 19:08:54 +0000 (Sat, 08 Dec 2012)
Log Message:
-----------
Modified Paths:
--------------
branches/namiltd-ini/ChangeLog
branches/namiltd-ini/config.php
Modified: branches/namiltd-ini/ChangeLog
===================================================================
--- branches/namiltd-ini/ChangeLog 2012-12-05 16:26:07 UTC (rev 713)
+++ branches/namiltd-ini/ChangeLog 2012-12-08 19:08:54 UTC (rev 714)
@@ -3,7 +3,7 @@
phpSysInfo 3.1.0
- [ADD] Turbolinux, Oracle Linux, PCLinuxOS, StartOS and elementary OS to detected distros
- - [ADD] Show System Language and Code Page on Linux and WINNT
+ - [ADD] Show System Language and Code Page on Linux, Haiku and WINNT
- [ADD] Minor support of ReactOS
- [UPD] Configuration moved from config.php and subdirs of "plugins" to one file phpsysinfo.ini
Modified: branches/namiltd-ini/config.php
===================================================================
--- branches/namiltd-ini/config.php 2012-12-05 16:26:07 UTC (rev 713)
+++ branches/namiltd-ini/config.php 2012-12-08 19:08:54 UTC (rev 714)
@@ -58,7 +58,7 @@
|| preg_match('/^RC_(LANG="?[^"\n]*"?)/m', $contents, $matches))) {
if (@exec($matches[1].' locale -k LC_CTYPE 2>/dev/null', $lines)) {
foreach ($lines as $line) {
- if ($contents && preg_match('/^charmap="?([^"\n]*)/m', $line, $matches2)) {
+ if (preg_match('/^charmap="?([^"]*)/', $line, $matches2)) {
define('PSI_SYSTEM_CODEPAGE', $matches2[1]);
break;
}
@@ -66,7 +66,7 @@
}
if (@exec($matches[1].' locale 2>/dev/null', $lines)) {
foreach ($lines as $line) {
- if ($contents && preg_match('/^LC_MESSAGES="?([^\."@]*)/m', $line, $matches2)) {
+ if (preg_match('/^LC_MESSAGES="?([^\."@]*)/', $line, $matches2)) {
$lang = "";
if (is_readable(APP_ROOT.'/data/languages.ini') && ($langdata = @parse_ini_file(APP_ROOT.'/data/languages.ini', true))){
if (isset($langdata['Linux']['_'.$matches2[1]])) {
@@ -83,7 +83,31 @@
}
}
+ } else if (PHP_OS == 'Haiku'){
+ if (@exec('locale -m 2>/dev/null', $lines)) {
+ foreach ($lines as $line) {
+ if (preg_match('/^"?([^\."]*)\.?([^"]*)/', $line, $matches2)) {
+
+ if ( isset($matches2[2]) && !is_null($matches2[2]) && (trim($matches2[2]) != "") ){
+ define('PSI_SYSTEM_CODEPAGE', $matches2[2]);
+ }
+
+ $lang = "";
+ if (is_readable(APP_ROOT.'/data/languages.ini') && ($langdata = @parse_ini_file(APP_ROOT.'/data/languages.ini', true))){
+ if (isset($langdata['Linux']['_'.$matches2[1]])) {
+ $lang = $langdata['Linux']['_'.$matches2[1]];
+ }
+ }
+ if ($lang == ""){
+ $lang = 'Unknown';
+ }
+ define('PSI_SYSTEM_SYSLANG', $lang.' ('.$matches2[1].')');
+ break;
+ }
+ }
+ }
}
+
if (!defined('PSI_SYSTEM_SYSLANG')){
define('PSI_SYSTEM_SYSLANG', null);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <na...@us...> - 2012-12-05 16:26:19
|
Revision: 713
http://phpsysinfo.svn.sourceforge.net/phpsysinfo/?rev=713&view=rev
Author: namiltd
Date: 2012-12-05 16:26:07 +0000 (Wed, 05 Dec 2012)
Log Message:
-----------
Modified Paths:
--------------
branches/namiltd-ini/includes/os/class.Linux.inc.php
trunk/includes/os/class.Linux.inc.php
Modified: branches/namiltd-ini/includes/os/class.Linux.inc.php
===================================================================
--- branches/namiltd-ini/includes/os/class.Linux.inc.php 2012-12-05 14:09:18 UTC (rev 712)
+++ branches/namiltd-ini/includes/os/class.Linux.inc.php 2012-12-05 16:26:07 UTC (rev 713)
@@ -539,7 +539,10 @@
$distro_tmp = preg_split("/\n/", $distro_info, -1, PREG_SPLIT_NO_EMPTY);
foreach ($distro_tmp as $info) {
$info_tmp = preg_split('/:/', $info, 2);
- $distro[$info_tmp[0]] = trim($info_tmp[1]);
+ if ( isset($distro_tmp[0]) && !is_null($distro_tmp[0]) && (trim($distro_tmp[0]) != "") &&
+ isset($distro_tmp[1]) && !is_null($distro_tmp[1]) && (trim($distro_tmp[1]) != "") ) {
+ $distro[$info_tmp[0]] = trim($info_tmp[1]);
+ }
}
if (!isset($distro['Distributor ID']) && !isset($distro['Description'])) {
if ( !is_null($distro_tmp[0]) && (trim($distro_tmp[0]) != "") ) {
Modified: trunk/includes/os/class.Linux.inc.php
===================================================================
--- trunk/includes/os/class.Linux.inc.php 2012-12-05 14:09:18 UTC (rev 712)
+++ trunk/includes/os/class.Linux.inc.php 2012-12-05 16:26:07 UTC (rev 713)
@@ -262,7 +262,7 @@
}
}
// sparc64 specific code ends
-
+
// XScale detection code
if ($dev->getModel() === "") {
foreach ($details as $detail) {
@@ -451,17 +451,10 @@
foreach ($bufe2 as $buf2) {
if (preg_match('/\s+encap:Ethernet\s+HWaddr\s(\S*)/i', $buf2, $ar_buf2))
$dev->setInfo(preg_replace('/:/', '-', $ar_buf2[1]));
- else if (preg_match('/^\s+inet\saddr:(\S*)\s+P-t-P:(\S*)/i', $buf2, $ar_buf2)) {
- if ($ar_buf2[1] != $ar_buf2[2]) {
- $dev->setInfo(($dev->getInfo()?$dev->getInfo().';':'').$ar_buf2[1].";:".$ar_buf2[2]);
- } else {
- $dev->setInfo(($dev->getInfo()?$dev->getInfo().';':'').$ar_buf2[1]);
- }
- }
else if (preg_match('/^\s+inet\saddr:(\S*)/i', $buf2, $ar_buf2))
- $dev->setInfo(($dev->getInfo()?$dev->getInfo().';':'').$ar_buf2[1]);
- else if (preg_match('/^\s+inet6\saddr:\s([^\/]*)(.*)\s+Scope:[GH]/i', $buf2, $ar_buf2))
- $dev->setInfo(($dev->getInfo()?$dev->getInfo().';':'').$ar_buf2[1]);
+ $dev->setInfo(($dev->getInfo()?$dev->getInfo().';':'').$ar_buf2[1]);
+ else if (preg_match('/^\s+inet6\saddr:\s([^\/]*)(.*)\s+Scope:[GH]/i', $buf2, $ar_buf2))
+ $dev->setInfo(($dev->getInfo()?$dev->getInfo().';':'').$ar_buf2[1]);
}
}
$this->sys->setNetDevices($dev);
@@ -529,7 +522,6 @@
*/
private function _distro()
{
- $this->sys->setDistribution("Linux");
$list = @parse_ini_file(APP_ROOT."/data/distros.ini", true);
if (!$list) {
return;
@@ -539,166 +531,77 @@
$distro_tmp = preg_split("/\n/", $distro_info, -1, PREG_SPLIT_NO_EMPTY);
foreach ($distro_tmp as $info) {
$info_tmp = preg_split('/:/', $info, 2);
- if ( isset($distro_tmp[0]) && !is_null($distro_tmp[0]) && (trim($distro_tmp[0]) != "") &&
- isset($distro_tmp[1]) && !is_null($distro_tmp[1]) && (trim($distro_tmp[1]) != "") ) {
- $distro[$info_tmp[0]] = trim($info_tmp[1]);
- }
+ $distro[$info_tmp[0]] = trim($info_tmp[1]);
}
- if (!isset($distro['Distributor ID']) && !isset($distro['Description'])) {
- if ( !is_null($distro_tmp[0]) && (trim($distro_tmp[0]) != "") ) {
- $this->sys->setDistribution(trim($distro_tmp[0]));
- if ( preg_match('/^(\S+)\s*/', $distro_tmp[0], $id_buf)
- && isset($list[trim($id_buf[1])]['Image'])) {
- $this->sys->setDistributionIcon($list[trim($id_buf[1])]['Image']);
- }
- }
- } else {
- if (isset($distro['Description'])) {
- $this->sys->setDistribution($distro['Description']);
- } else if (isset($distro['Distributor ID'])) {
- $this->sys->setDistribution($distro['Distributor ID']);
- }
- if (isset($distro['Distributor ID']) && isset($list[$distro['Distributor ID']]['Image'])) {
- $this->sys->setDistributionIcon($list[$distro['Distributor ID']]['Image']);
- }
+ if (isset($distro['Distributor ID']) && isset($list[$distro['Distributor ID']]['Image'])) {
+ $this->sys->setDistributionIcon($list[$distro['Distributor ID']]['Image']);
}
- } else {
- /* default error handler */
- if (function_exists('errorHandlerPsi')) {
- restore_error_handler();
+ if (isset($distro['Description'])) {
+ $this->sys->setDistribution($distro['Description']);
}
- /* fatal errors only */
- $old_err_rep = error_reporting();
- error_reporting(E_ERROR);
-
- // Fall back in case 'lsb_release' does not exist
+ } else {
+ // Fall back in case 'lsb_release' does not exist ;)
foreach ($list as $section=>$distribution) {
- if (!isset($distribution['Files'])) {
+ if (!isset($distribution["Files"])) {
continue;
} else {
- foreach (preg_split("/;/", $distribution['Files'], -1, PREG_SPLIT_NO_EMPTY) as $filename) {
+ foreach (preg_split("/;/", $distribution["Files"], -1, PREG_SPLIT_NO_EMPTY) as $filename) {
if (file_exists($filename)) {
- if (!CommonFunctions::rfts($filename, $buf, 1, 4096, false)) {
- $buf = "";
- }
- if (isset($distribution['Image'])) {
- $this->sys->setDistributionIcon($distribution['Image']);
- }
- if (isset($distribution['Name'])) {
- if (($distribution['Name'] == 'Synology') || is_null($buf) || (trim($buf) == "")) {
- $this->sys->setDistribution($distribution['Name']);
+ CommonFunctions::rfts($filename, $buf);
+
+ // lsb-release file
+ if (preg_match('/^DISTRIB_ID=(.*)/m', $buf, $id_buf)) {
+ if (preg_match('/^DISTRIB_DESCRIPTION="(.*)"/m', $buf, $desc_buf)) {
+ $this->sys->setDistribution(trim($desc_buf[1]));
} else {
- $this->sys->setDistribution($distribution['Name']." ".trim($buf));
+ if (isset($list[trim($id_buf[1])]['Name'])) {
+ $dist = trim($list[trim($id_buf[1])]['Name']);
+ } else {
+ $dist = trim($id_buf[1]);
+ }
+ if (preg_match('/^DISTRIB_RELEASE=(.*)/m', $buf, $vers_buf)) {
+ $this->sys->setDistribution(trim($dist." ".trim($vers_buf[1])));
+ } else {
+ $this->sys->setDistribution($dist);
+ }
}
+ if (isset($list[trim($id_buf[1])]['Image'])) {
+ $this->sys->setDistributionIcon($list[trim($id_buf[1])]['Image']);
+ }
+ // DISTRO_SPECS file
+ } else if (preg_match('/^DISTRO_NAME=\'(.*)\'/m', $buf, $id_buf)) {
+ if (isset($list[trim($id_buf[1])]['Name'])) {
+ $dist = trim($list[trim($id_buf[1])]['Name']);
+ } else {
+ $dist = trim($id_buf[1]);
+ }
+ if (preg_match('/^DISTRO_VERSION=(.*)/m', $buf, $vers_buf)) {
+ $this->sys->setDistribution(trim($dist." ".trim($vers_buf[1])));
+ } else {
+ $this->sys->setDistribution($dist);
+ }
+ if (isset($list[trim($id_buf[1])]['Image'])) {
+ $this->sys->setDistributionIcon($list[trim($id_buf[1])]['Image']);
+ }
} else {
- if ( is_null($buf) || (trim($buf) == "") ) {
- $this->sys->setDistribution($section);
+ if (isset($distribution["Image"])) {
+ $this->sys->setDistributionIcon($distribution["Image"]);
+ }
+ if (isset($distribution["Name"])) {
+ if ($distribution["Name"] == 'Synology') {
+ $this->sys->setDistribution($distribution["Name"]);
+ } else {
+ $this->sys->setDistribution($distribution["Name"]." ".trim($buf));
+ }
} else {
$this->sys->setDistribution(trim($buf));
}
}
- break 2;
+ return;
}
}
}
}
- // Otherwise, if no files found
- if ($this->sys->getDistribution() == "Linux") {
- if ( file_exists($filename="/etc/lsb-release")
- && CommonFunctions::rfts($filename, $buf, 0, 4096, false)
- && preg_match('/^DISTRIB_ID="?([^"\n]*)"?/m', $buf, $id_buf) ) {
- if (preg_match('/^DISTRIB_DESCRIPTION="?([^"\n]*)"?/m', $buf, $desc_buf)) {
- $this->sys->setDistribution(trim($desc_buf[1]));
- } else {
- if (isset($list[trim($id_buf[1])]['Name'])) {
- $dist = trim($list[trim($id_buf[1])]['Name']);
- } else {
- $dist = trim($id_buf[1]);
- }
- if (preg_match('/^DISTRIB_RELEASE="?([^"\n]*)"?/m', $buf, $vers_buf)) {
- $this->sys->setDistribution(trim($dist." ".trim($vers_buf[1])));
- } else {
- $this->sys->setDistribution($dist);
- }
- }
- if (isset($list[trim($id_buf[1])]['Image'])) {
- $this->sys->setDistributionIcon($list[trim($id_buf[1])]['Image']);
- }
- } else
- if ( file_exists($filename="/etc/DISTRO_SPECS")
- && CommonFunctions::rfts($filename, $buf, 0, 4096, false)
- && preg_match('/^DISTRO_NAME=\'(.*)\'/m', $buf, $id_buf) ) {
- if (isset($list[trim($id_buf[1])]['Name'])) {
- $dist = trim($list[trim($id_buf[1])]['Name']);
- } else {
- $dist = trim($id_buf[1]);
- }
- if (preg_match('/^DISTRO_VERSION=(.*)/m', $buf, $vers_buf)) {
- $this->sys->setDistribution(trim($dist." ".trim($vers_buf[1])));
- } else {
- $this->sys->setDistribution($dist);
- }
- if (isset($list[trim($id_buf[1])]['Image'])) {
- $this->sys->setDistributionIcon($list[trim($id_buf[1])]['Image']);
- } else {
- if (isset($list['Puppy']['Image'])) {
- $this->sys->setDistributionIcon($list['Puppy']['Image']);
- }
- }
- } else
- if (file_exists($filename="/etc/redhat-release")) {
- if (!CommonFunctions::rfts($filename, $buf, 1, 4096, false)) {
- $buf = "";
- }
- if ( is_null($buf) || (trim($buf) == "") ) {
- if (isset($list['RedHat']['Name'])) {
- $this->sys->setDistribution(trim($list['RedHat']['Name']));
- } else {
- $this->sys->setDistribution('RedHat');
- }
- if (isset($list['RedHat']['Image'])) {
- $this->sys->setDistributionIcon($list['RedHat']['Image']);
- }
- } else {
- $this->sys->setDistribution(trim($buf));
- if ( preg_match('/^(\S+)\s*/', $buf, $id_buf)
- && isset($list[trim($id_buf[1])]['Image'])) {
- $this->sys->setDistributionIcon($list[trim($id_buf[1])]['Image']);
- } else {
- if (isset($list['RedHat']['Image'])) {
- $this->sys->setDistributionIcon($list['RedHat']['Image']);
- }
- }
- }
- } else
- if (file_exists($filename="/etc/debian_version")){
- if (!CommonFunctions::rfts($filename, $buf, 1, 4096, false)) {
- $buf = "";
- }
- if (isset($list['Debian']['Image'])) {
- $this->sys->setDistributionIcon($list['Debian']['Image']);
- }
- if (isset($list['Debian']['Name'])) {
- if ( is_null($buf) || (trim($buf) == "")) {
- $this->sys->setDistribution($list['Debian']['Name']);
- } else {
- $this->sys->setDistribution($list['Debian']['Name']." ".trim($buf));
- }
- } else {
- if ( is_null($buf) || (trim($buf) == "") ) {
- $this->sys->setDistribution('Debian');
- } else {
- $this->sys->setDistribution(trim($buf));
- }
- }
- }
- }
- /* restore error level */
- error_reporting($old_err_rep);
- /* restore error handler */
- if (function_exists('errorHandlerPsi')) {
- set_error_handler('errorHandlerPsi');
- }
}
}
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <na...@us...> - 2012-12-05 14:09:25
|
Revision: 712
http://phpsysinfo.svn.sourceforge.net/phpsysinfo/?rev=712&view=rev
Author: namiltd
Date: 2012-12-05 14:09:18 +0000 (Wed, 05 Dec 2012)
Log Message:
-----------
Modified Paths:
--------------
trunk/includes/os/class.Linux.inc.php
Modified: trunk/includes/os/class.Linux.inc.php
===================================================================
--- trunk/includes/os/class.Linux.inc.php 2012-12-05 12:54:33 UTC (rev 711)
+++ trunk/includes/os/class.Linux.inc.php 2012-12-05 14:09:18 UTC (rev 712)
@@ -262,7 +262,7 @@
}
}
// sparc64 specific code ends
-
+
// XScale detection code
if ($dev->getModel() === "") {
foreach ($details as $detail) {
@@ -451,10 +451,17 @@
foreach ($bufe2 as $buf2) {
if (preg_match('/\s+encap:Ethernet\s+HWaddr\s(\S*)/i', $buf2, $ar_buf2))
$dev->setInfo(preg_replace('/:/', '-', $ar_buf2[1]));
+ else if (preg_match('/^\s+inet\saddr:(\S*)\s+P-t-P:(\S*)/i', $buf2, $ar_buf2)) {
+ if ($ar_buf2[1] != $ar_buf2[2]) {
+ $dev->setInfo(($dev->getInfo()?$dev->getInfo().';':'').$ar_buf2[1].";:".$ar_buf2[2]);
+ } else {
+ $dev->setInfo(($dev->getInfo()?$dev->getInfo().';':'').$ar_buf2[1]);
+ }
+ }
else if (preg_match('/^\s+inet\saddr:(\S*)/i', $buf2, $ar_buf2))
- $dev->setInfo(($dev->getInfo()?$dev->getInfo().';':'').$ar_buf2[1]);
- else if (preg_match('/^\s+inet6\saddr:\s([^\/]*)(.*)\s+Scope:[GH]/i', $buf2, $ar_buf2))
- $dev->setInfo(($dev->getInfo()?$dev->getInfo().';':'').$ar_buf2[1]);
+ $dev->setInfo(($dev->getInfo()?$dev->getInfo().';':'').$ar_buf2[1]);
+ else if (preg_match('/^\s+inet6\saddr:\s([^\/]*)(.*)\s+Scope:[GH]/i', $buf2, $ar_buf2))
+ $dev->setInfo(($dev->getInfo()?$dev->getInfo().';':'').$ar_buf2[1]);
}
}
$this->sys->setNetDevices($dev);
@@ -522,6 +529,7 @@
*/
private function _distro()
{
+ $this->sys->setDistribution("Linux");
$list = @parse_ini_file(APP_ROOT."/data/distros.ini", true);
if (!$list) {
return;
@@ -531,77 +539,166 @@
$distro_tmp = preg_split("/\n/", $distro_info, -1, PREG_SPLIT_NO_EMPTY);
foreach ($distro_tmp as $info) {
$info_tmp = preg_split('/:/', $info, 2);
- $distro[$info_tmp[0]] = trim($info_tmp[1]);
+ if ( isset($distro_tmp[0]) && !is_null($distro_tmp[0]) && (trim($distro_tmp[0]) != "") &&
+ isset($distro_tmp[1]) && !is_null($distro_tmp[1]) && (trim($distro_tmp[1]) != "") ) {
+ $distro[$info_tmp[0]] = trim($info_tmp[1]);
+ }
}
- if (isset($distro['Distributor ID']) && isset($list[$distro['Distributor ID']]['Image'])) {
- $this->sys->setDistributionIcon($list[$distro['Distributor ID']]['Image']);
+ if (!isset($distro['Distributor ID']) && !isset($distro['Description'])) {
+ if ( !is_null($distro_tmp[0]) && (trim($distro_tmp[0]) != "") ) {
+ $this->sys->setDistribution(trim($distro_tmp[0]));
+ if ( preg_match('/^(\S+)\s*/', $distro_tmp[0], $id_buf)
+ && isset($list[trim($id_buf[1])]['Image'])) {
+ $this->sys->setDistributionIcon($list[trim($id_buf[1])]['Image']);
+ }
+ }
+ } else {
+ if (isset($distro['Description'])) {
+ $this->sys->setDistribution($distro['Description']);
+ } else if (isset($distro['Distributor ID'])) {
+ $this->sys->setDistribution($distro['Distributor ID']);
+ }
+ if (isset($distro['Distributor ID']) && isset($list[$distro['Distributor ID']]['Image'])) {
+ $this->sys->setDistributionIcon($list[$distro['Distributor ID']]['Image']);
+ }
}
- if (isset($distro['Description'])) {
- $this->sys->setDistribution($distro['Description']);
+ } else {
+ /* default error handler */
+ if (function_exists('errorHandlerPsi')) {
+ restore_error_handler();
}
- } else {
- // Fall back in case 'lsb_release' does not exist ;)
+ /* fatal errors only */
+ $old_err_rep = error_reporting();
+ error_reporting(E_ERROR);
+
+ // Fall back in case 'lsb_release' does not exist
foreach ($list as $section=>$distribution) {
- if (!isset($distribution["Files"])) {
+ if (!isset($distribution['Files'])) {
continue;
} else {
- foreach (preg_split("/;/", $distribution["Files"], -1, PREG_SPLIT_NO_EMPTY) as $filename) {
+ foreach (preg_split("/;/", $distribution['Files'], -1, PREG_SPLIT_NO_EMPTY) as $filename) {
if (file_exists($filename)) {
- CommonFunctions::rfts($filename, $buf);
-
- // lsb-release file
- if (preg_match('/^DISTRIB_ID=(.*)/m', $buf, $id_buf)) {
- if (preg_match('/^DISTRIB_DESCRIPTION="(.*)"/m', $buf, $desc_buf)) {
- $this->sys->setDistribution(trim($desc_buf[1]));
+ if (!CommonFunctions::rfts($filename, $buf, 1, 4096, false)) {
+ $buf = "";
+ }
+ if (isset($distribution['Image'])) {
+ $this->sys->setDistributionIcon($distribution['Image']);
+ }
+ if (isset($distribution['Name'])) {
+ if (($distribution['Name'] == 'Synology') || is_null($buf) || (trim($buf) == "")) {
+ $this->sys->setDistribution($distribution['Name']);
} else {
- if (isset($list[trim($id_buf[1])]['Name'])) {
- $dist = trim($list[trim($id_buf[1])]['Name']);
- } else {
- $dist = trim($id_buf[1]);
- }
- if (preg_match('/^DISTRIB_RELEASE=(.*)/m', $buf, $vers_buf)) {
- $this->sys->setDistribution(trim($dist." ".trim($vers_buf[1])));
- } else {
- $this->sys->setDistribution($dist);
- }
+ $this->sys->setDistribution($distribution['Name']." ".trim($buf));
}
- if (isset($list[trim($id_buf[1])]['Image'])) {
- $this->sys->setDistributionIcon($list[trim($id_buf[1])]['Image']);
- }
- // DISTRO_SPECS file
- } else if (preg_match('/^DISTRO_NAME=\'(.*)\'/m', $buf, $id_buf)) {
- if (isset($list[trim($id_buf[1])]['Name'])) {
- $dist = trim($list[trim($id_buf[1])]['Name']);
- } else {
- $dist = trim($id_buf[1]);
- }
- if (preg_match('/^DISTRO_VERSION=(.*)/m', $buf, $vers_buf)) {
- $this->sys->setDistribution(trim($dist." ".trim($vers_buf[1])));
- } else {
- $this->sys->setDistribution($dist);
- }
- if (isset($list[trim($id_buf[1])]['Image'])) {
- $this->sys->setDistributionIcon($list[trim($id_buf[1])]['Image']);
- }
} else {
- if (isset($distribution["Image"])) {
- $this->sys->setDistributionIcon($distribution["Image"]);
- }
- if (isset($distribution["Name"])) {
- if ($distribution["Name"] == 'Synology') {
- $this->sys->setDistribution($distribution["Name"]);
- } else {
- $this->sys->setDistribution($distribution["Name"]." ".trim($buf));
- }
+ if ( is_null($buf) || (trim($buf) == "") ) {
+ $this->sys->setDistribution($section);
} else {
$this->sys->setDistribution(trim($buf));
}
}
- return;
+ break 2;
}
}
}
}
+ // Otherwise, if no files found
+ if ($this->sys->getDistribution() == "Linux") {
+ if ( file_exists($filename="/etc/lsb-release")
+ && CommonFunctions::rfts($filename, $buf, 0, 4096, false)
+ && preg_match('/^DISTRIB_ID="?([^"\n]*)"?/m', $buf, $id_buf) ) {
+ if (preg_match('/^DISTRIB_DESCRIPTION="?([^"\n]*)"?/m', $buf, $desc_buf)) {
+ $this->sys->setDistribution(trim($desc_buf[1]));
+ } else {
+ if (isset($list[trim($id_buf[1])]['Name'])) {
+ $dist = trim($list[trim($id_buf[1])]['Name']);
+ } else {
+ $dist = trim($id_buf[1]);
+ }
+ if (preg_match('/^DISTRIB_RELEASE="?([^"\n]*)"?/m', $buf, $vers_buf)) {
+ $this->sys->setDistribution(trim($dist." ".trim($vers_buf[1])));
+ } else {
+ $this->sys->setDistribution($dist);
+ }
+ }
+ if (isset($list[trim($id_buf[1])]['Image'])) {
+ $this->sys->setDistributionIcon($list[trim($id_buf[1])]['Image']);
+ }
+ } else
+ if ( file_exists($filename="/etc/DISTRO_SPECS")
+ && CommonFunctions::rfts($filename, $buf, 0, 4096, false)
+ && preg_match('/^DISTRO_NAME=\'(.*)\'/m', $buf, $id_buf) ) {
+ if (isset($list[trim($id_buf[1])]['Name'])) {
+ $dist = trim($list[trim($id_buf[1])]['Name']);
+ } else {
+ $dist = trim($id_buf[1]);
+ }
+ if (preg_match('/^DISTRO_VERSION=(.*)/m', $buf, $vers_buf)) {
+ $this->sys->setDistribution(trim($dist." ".trim($vers_buf[1])));
+ } else {
+ $this->sys->setDistribution($dist);
+ }
+ if (isset($list[trim($id_buf[1])]['Image'])) {
+ $this->sys->setDistributionIcon($list[trim($id_buf[1])]['Image']);
+ } else {
+ if (isset($list['Puppy']['Image'])) {
+ $this->sys->setDistributionIcon($list['Puppy']['Image']);
+ }
+ }
+ } else
+ if (file_exists($filename="/etc/redhat-release")) {
+ if (!CommonFunctions::rfts($filename, $buf, 1, 4096, false)) {
+ $buf = "";
+ }
+ if ( is_null($buf) || (trim($buf) == "") ) {
+ if (isset($list['RedHat']['Name'])) {
+ $this->sys->setDistribution(trim($list['RedHat']['Name']));
+ } else {
+ $this->sys->setDistribution('RedHat');
+ }
+ if (isset($list['RedHat']['Image'])) {
+ $this->sys->setDistributionIcon($list['RedHat']['Image']);
+ }
+ } else {
+ $this->sys->setDistribution(trim($buf));
+ if ( preg_match('/^(\S+)\s*/', $buf, $id_buf)
+ && isset($list[trim($id_buf[1])]['Image'])) {
+ $this->sys->setDistributionIcon($list[trim($id_buf[1])]['Image']);
+ } else {
+ if (isset($list['RedHat']['Image'])) {
+ $this->sys->setDistributionIcon($list['RedHat']['Image']);
+ }
+ }
+ }
+ } else
+ if (file_exists($filename="/etc/debian_version")){
+ if (!CommonFunctions::rfts($filename, $buf, 1, 4096, false)) {
+ $buf = "";
+ }
+ if (isset($list['Debian']['Image'])) {
+ $this->sys->setDistributionIcon($list['Debian']['Image']);
+ }
+ if (isset($list['Debian']['Name'])) {
+ if ( is_null($buf) || (trim($buf) == "")) {
+ $this->sys->setDistribution($list['Debian']['Name']);
+ } else {
+ $this->sys->setDistribution($list['Debian']['Name']." ".trim($buf));
+ }
+ } else {
+ if ( is_null($buf) || (trim($buf) == "") ) {
+ $this->sys->setDistribution('Debian');
+ } else {
+ $this->sys->setDistribution(trim($buf));
+ }
+ }
+ }
+ }
+ /* restore error level */
+ error_reporting($old_err_rep);
+ /* restore error handler */
+ if (function_exists('errorHandlerPsi')) {
+ set_error_handler('errorHandlerPsi');
+ }
}
}
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <na...@us...> - 2012-12-05 12:54:44
|
Revision: 711
http://phpsysinfo.svn.sourceforge.net/phpsysinfo/?rev=711&view=rev
Author: namiltd
Date: 2012-12-05 12:54:33 +0000 (Wed, 05 Dec 2012)
Log Message:
-----------
Modified Paths:
--------------
branches/namiltd-ini/config.php
Modified: branches/namiltd-ini/config.php
===================================================================
--- branches/namiltd-ini/config.php 2012-12-05 12:37:11 UTC (rev 710)
+++ branches/namiltd-ini/config.php 2012-12-05 12:54:33 UTC (rev 711)
@@ -58,7 +58,7 @@
|| preg_match('/^RC_(LANG="?[^"\n]*"?)/m', $contents, $matches))) {
if (@exec($matches[1].' locale -k LC_CTYPE 2>/dev/null', $lines)) {
foreach ($lines as $line) {
- if ($contents && preg_match('/^charmap="?([^"\n]*)"?/m', $line, $matches2)) {
+ if ($contents && preg_match('/^charmap="?([^"\n]*)/m', $line, $matches2)) {
define('PSI_SYSTEM_CODEPAGE', $matches2[1]);
break;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <na...@us...> - 2012-12-05 12:37:18
|
Revision: 710
http://phpsysinfo.svn.sourceforge.net/phpsysinfo/?rev=710&view=rev
Author: namiltd
Date: 2012-12-05 12:37:11 +0000 (Wed, 05 Dec 2012)
Log Message:
-----------
Modified Paths:
--------------
branches/namiltd-ini/config.php
Modified: branches/namiltd-ini/config.php
===================================================================
--- branches/namiltd-ini/config.php 2012-12-05 11:20:40 UTC (rev 709)
+++ branches/namiltd-ini/config.php 2012-12-05 12:37:11 UTC (rev 710)
@@ -54,11 +54,11 @@
} else if (file_exists ('/etc/sysconfig/language')){
$contents = @file_get_contents('/etc/sysconfig/language');
} else $contents = false;
- if ($contents && ( preg_match("/^(LANG=\".*\")/m", $contents, $matches)
- || preg_match("/^RC_(LANG=\".*\")/m", $contents, $matches))) {
+ if ($contents && ( preg_match('/^(LANG="?[^"\n]*"?)/m', $contents, $matches)
+ || preg_match('/^RC_(LANG="?[^"\n]*"?)/m', $contents, $matches))) {
if (@exec($matches[1].' locale -k LC_CTYPE 2>/dev/null', $lines)) {
foreach ($lines as $line) {
- if ($contents && preg_match("/^charmap=\"(.*)\"/m", $line, $matches2)) {
+ if ($contents && preg_match('/^charmap="?([^"\n]*)"?/m', $line, $matches2)) {
define('PSI_SYSTEM_CODEPAGE', $matches2[1]);
break;
}
@@ -66,7 +66,7 @@
}
if (@exec($matches[1].' locale 2>/dev/null', $lines)) {
foreach ($lines as $line) {
- if ($contents && preg_match("/^LC_MESSAGES=\"([^\.\"@]*)/m", $line, $matches2)) {
+ if ($contents && preg_match('/^LC_MESSAGES="?([^\."@]*)/m', $line, $matches2)) {
$lang = "";
if (is_readable(APP_ROOT.'/data/languages.ini') && ($langdata = @parse_ini_file(APP_ROOT.'/data/languages.ini', true))){
if (isset($langdata['Linux']['_'.$matches2[1]])) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <na...@us...> - 2012-12-05 11:20:52
|
Revision: 709
http://phpsysinfo.svn.sourceforge.net/phpsysinfo/?rev=709&view=rev
Author: namiltd
Date: 2012-12-05 11:20:40 +0000 (Wed, 05 Dec 2012)
Log Message:
-----------
Modified Paths:
--------------
branches/namiltd-ini/ChangeLog
branches/namiltd-ini/data/distros.ini
branches/namiltd-ini/includes/os/class.Linux.inc.php
Added Paths:
-----------
branches/namiltd-ini/gfx/images/StartOS.png
Modified: branches/namiltd-ini/ChangeLog
===================================================================
--- branches/namiltd-ini/ChangeLog 2012-11-28 18:37:58 UTC (rev 708)
+++ branches/namiltd-ini/ChangeLog 2012-12-05 11:20:40 UTC (rev 709)
@@ -2,7 +2,7 @@
phpSysInfo 3.1.0
- - [ADD] Turbolinux, Oracle Linux, PCLinuxOS and elementary OS to detected distros
+ - [ADD] Turbolinux, Oracle Linux, PCLinuxOS, StartOS and elementary OS to detected distros
- [ADD] Show System Language and Code Page on Linux and WINNT
- [ADD] Minor support of ReactOS
Modified: branches/namiltd-ini/data/distros.ini
===================================================================
--- branches/namiltd-ini/data/distros.ini 2012-11-28 18:37:58 UTC (rev 708)
+++ branches/namiltd-ini/data/distros.ini 2012-12-05 11:20:40 UTC (rev 709)
@@ -143,6 +143,10 @@
Image = "Turbo.png"
Files = "/etc/turbolinux-release"
+[StartOS]
+Image = "StartOS.png"
+Files = "/etc/startos-release"
+
[Oracle]
Image = "Oracle.png"
Files = "/etc/oracle-release"
Added: branches/namiltd-ini/gfx/images/StartOS.png
===================================================================
(Binary files differ)
Property changes on: branches/namiltd-ini/gfx/images/StartOS.png
___________________________________________________________________
Added: svn:mime-type
+ image/png
Modified: branches/namiltd-ini/includes/os/class.Linux.inc.php
===================================================================
--- branches/namiltd-ini/includes/os/class.Linux.inc.php 2012-11-28 18:37:58 UTC (rev 708)
+++ branches/namiltd-ini/includes/os/class.Linux.inc.php 2012-12-05 11:20:40 UTC (rev 709)
@@ -541,12 +541,24 @@
$info_tmp = preg_split('/:/', $info, 2);
$distro[$info_tmp[0]] = trim($info_tmp[1]);
}
- if (isset($distro['Distributor ID']) && isset($list[$distro['Distributor ID']]['Image'])) {
- $this->sys->setDistributionIcon($list[$distro['Distributor ID']]['Image']);
+ if (!isset($distro['Distributor ID']) && !isset($distro['Description'])) {
+ if ( !is_null($distro_tmp[0]) && (trim($distro_tmp[0]) != "") ) {
+ $this->sys->setDistribution(trim($distro_tmp[0]));
+ if ( preg_match('/^(\S+)\s*/', $distro_tmp[0], $id_buf)
+ && isset($list[trim($id_buf[1])]['Image'])) {
+ $this->sys->setDistributionIcon($list[trim($id_buf[1])]['Image']);
+ }
+ }
+ } else {
+ if (isset($distro['Description'])) {
+ $this->sys->setDistribution($distro['Description']);
+ } else if (isset($distro['Distributor ID'])) {
+ $this->sys->setDistribution($distro['Distributor ID']);
+ }
+ if (isset($distro['Distributor ID']) && isset($list[$distro['Distributor ID']]['Image'])) {
+ $this->sys->setDistributionIcon($list[$distro['Distributor ID']]['Image']);
+ }
}
- if (isset($distro['Description'])) {
- $this->sys->setDistribution($distro['Description']);
- }
} else {
/* default error handler */
if (function_exists('errorHandlerPsi')) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <na...@us...> - 2012-11-28 18:38:07
|
Revision: 708
http://phpsysinfo.svn.sourceforge.net/phpsysinfo/?rev=708&view=rev
Author: namiltd
Date: 2012-11-28 18:37:58 +0000 (Wed, 28 Nov 2012)
Log Message:
-----------
Modified Paths:
--------------
branches/namiltd-ini/language/es.xml
branches/namiltd-ini/language/gl.xml
Modified: branches/namiltd-ini/language/es.xml
===================================================================
--- branches/namiltd-ini/language/es.xml 2012-11-28 10:20:49 UTC (rev 707)
+++ branches/namiltd-ini/language/es.xml 2012-11-28 18:37:58 UTC (rev 708)
@@ -202,7 +202,7 @@
<exp>Buffers</exp>
</expression>
<expression id="066" name="cached">
- <exp>Cache;</exp>
+ <exp>Cache</exp>
</expression>
<expression id="067" name="jumpto">
<exp>Bifurcación</exp>
Modified: branches/namiltd-ini/language/gl.xml
===================================================================
--- branches/namiltd-ini/language/gl.xml 2012-11-28 10:20:49 UTC (rev 707)
+++ branches/namiltd-ini/language/gl.xml 2012-11-28 18:37:58 UTC (rev 708)
@@ -202,7 +202,7 @@
<exp>Buffers</exp>
</expression>
<expression id="066" name="cached">
- <exp>Cache;</exp>
+ <exp>Cache</exp>
</expression>
<expression id="067" name="jumpto">
<exp>Bifurcación</exp>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <na...@us...> - 2012-11-28 10:20:56
|
Revision: 707
http://phpsysinfo.svn.sourceforge.net/phpsysinfo/?rev=707&view=rev
Author: namiltd
Date: 2012-11-28 10:20:49 +0000 (Wed, 28 Nov 2012)
Log Message:
-----------
Modified Paths:
--------------
branches/namiltd-ini/ChangeLog
branches/namiltd-ini/plugins/smart/class.smart.inc.php
branches/namiltd-ini/plugins/smart/js/smart.js
Modified: branches/namiltd-ini/ChangeLog
===================================================================
--- branches/namiltd-ini/ChangeLog 2012-11-18 19:29:16 UTC (rev 706)
+++ branches/namiltd-ini/ChangeLog 2012-11-28 10:20:49 UTC (rev 707)
@@ -14,6 +14,7 @@
- [FIX] Fixed Bug [ 3561124 ] Incorrect reading of free mem on Mac OS X (thanks to pbobbenb)
- [FIX] Fixed UTF8 encoding for Linux
+ - [FIX] SMART plugin doesn't display for some results
phpSysInfo 3.0.19
Modified: branches/namiltd-ini/plugins/smart/class.smart.inc.php
===================================================================
--- branches/namiltd-ini/plugins/smart/class.smart.inc.php 2012-11-18 19:29:16 UTC (rev 706)
+++ branches/namiltd-ini/plugins/smart/class.smart.inc.php 2012-11-28 10:20:49 UTC (rev 707)
@@ -138,8 +138,8 @@
if ( preg_match('/(Vendor Specific SMART Attributes with Thresholds)/', $result, $matches, PREG_OFFSET_CAPTURE) )
$startIndex = $matches[0][1];
- // locate the end string offset for the attributes, this is usually right before string "SMART Error Log Version" (hopefully every output has it!)
- if ( preg_match('/(SMART Error Log Version)/', $result, $matches, PREG_OFFSET_CAPTURE) )
+ // locate the end string offset for the attributes, this is usually right before string "SMART Error Log Version" or "SMART Error Log not supported" (hopefully every output has it!)
+ if ( preg_match('/(SMART Error Log Version)|(SMART Error Log not supported)/', $result, $matches, PREG_OFFSET_CAPTURE) )
$endIndex = $matches[0][1];
if (($startIndex)&&($endIndex)&&($endIndex>$startIndex))
Modified: branches/namiltd-ini/plugins/smart/js/smart.js
===================================================================
--- branches/namiltd-ini/plugins/smart/js/smart.js 2012-11-18 19:29:16 UTC (rev 706)
+++ branches/namiltd-ini/plugins/smart/js/smart.js 2012-11-28 10:20:49 UTC (rev 707)
@@ -93,9 +93,10 @@
$("Plugins Plugin_SMART columns column", xml).each(function smart_find_columns() {
i = parseInt($(this).attr("id"), 10);
if (typeof(values[i])==='undefined') {
- values[i] = "";
+// values[i] = "";
+ display.push("<span style=\"display:none;\"></span>");
}
- if (i === 194) {
+ else if (i === 194) {
display.push("<span style=\"display:none;\">" + values[i] + "</span>" + formatTemp(values[i], xml));
}
else {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <na...@us...> - 2012-11-18 19:29:23
|
Revision: 706
http://phpsysinfo.svn.sourceforge.net/phpsysinfo/?rev=706&view=rev
Author: namiltd
Date: 2012-11-18 19:29:16 +0000 (Sun, 18 Nov 2012)
Log Message:
-----------
Updated jQuery plugin to 1.8.3
Modified Paths:
--------------
branches/namiltd-ini/ChangeLog
branches/namiltd-ini/js/jQuery/README
branches/namiltd-ini/js/jQuery/jquery.js
Modified: branches/namiltd-ini/ChangeLog
===================================================================
--- branches/namiltd-ini/ChangeLog 2012-11-11 00:33:29 UTC (rev 705)
+++ branches/namiltd-ini/ChangeLog 2012-11-18 19:29:16 UTC (rev 706)
@@ -9,7 +9,7 @@
- [UPD] Configuration moved from config.php and subdirs of "plugins" to one file phpsysinfo.ini
- [UPD] Plugin ipmi ranamed to IPMIInfo and Update-Notifier to UpdateNotifier (to avoid name conflicts)
- [UPD] Case-insensitive for most of parameters
- - [UPD] Updated jQuery plugin to 1.8.2
+ - [UPD] Updated jQuery plugin to 1.8.3
- [UPD] Updated jQuery plugin nyroModal to 1.6.2+jquery1.8fix
- [FIX] Fixed Bug [ 3561124 ] Incorrect reading of free mem on Mac OS X (thanks to pbobbenb)
Modified: branches/namiltd-ini/js/jQuery/README
===================================================================
--- branches/namiltd-ini/js/jQuery/README 2012-11-11 00:33:29 UTC (rev 705)
+++ branches/namiltd-ini/js/jQuery/README 2012-11-18 19:29:16 UTC (rev 706)
@@ -3,7 +3,7 @@
jquery.js
---------
-VERSION : 1.8.2
+VERSION : 1.8.3
URL : http://jquery.com/
DESC : jQuery is a fast, concise, JavaScript Library that simplifies how you traverse HTML documents, handle
events, perform animations, and add Ajax interactions to your web pages.
Modified: branches/namiltd-ini/js/jQuery/jquery.js
===================================================================
--- branches/namiltd-ini/js/jQuery/jquery.js 2012-11-11 00:33:29 UTC (rev 705)
+++ branches/namiltd-ini/js/jQuery/jquery.js 2012-11-18 19:29:16 UTC (rev 706)
@@ -1,5 +1,5 @@
/*!
- * jQuery JavaScript Library v1.8.2
+ * jQuery JavaScript Library v1.8.3
* http://jquery.com/
*
* Includes Sizzle.js
@@ -9,7 +9,7 @@
* Released under the MIT license
* http://jquery.org/license
*
- * Date: Thu Sep 20 2012 21:13:05 GMT-0400 (Eastern Daylight Time)
+ * Date: Tue Nov 13 2012 08:20:33 GMT-0500 (Eastern Standard Time)
*/
(function( window, undefined ) {
var
@@ -186,7 +186,7 @@
selector: "",
// The current version of jQuery being used
- jquery: "1.8.2",
+ jquery: "1.8.3",
// The default length of a jQuery object is 0
length: 0,
@@ -999,8 +999,10 @@
(function add( args ) {
jQuery.each( args, function( _, arg ) {
var type = jQuery.type( arg );
- if ( type === "function" && ( !options.unique || !self.has( arg ) ) ) {
- list.push( arg );
+ if ( type === "function" ) {
+ if ( !options.unique || !self.has( arg ) ) {
+ list.push( arg );
+ }
} else if ( arg && arg.length && type !== "string" ) {
// Inspect recursively
add( arg );
@@ -1253,24 +1255,23 @@
clickFn,
div = document.createElement("div");
- // Preliminary tests
+ // Setup
div.setAttribute( "className", "t" );
div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
+ // Support tests won't run in some limited or non-browser environments
all = div.getElementsByTagName("*");
a = div.getElementsByTagName("a")[ 0 ];
- a.style.cssText = "top:1px;float:left;opacity:.5";
-
- // Can't get basic test support
- if ( !all || !all.length ) {
+ if ( !all || !a || !all.length ) {
return {};
}
- // First batch of supports tests
+ // First batch of tests
select = document.createElement("select");
opt = select.appendChild( document.createElement("option") );
input = div.getElementsByTagName("input")[ 0 ];
+ a.style.cssText = "top:1px;float:left;opacity:.5";
support = {
// IE strips leading whitespace when .innerHTML is used
leadingWhitespace: ( div.firstChild.nodeType === 3 ),
@@ -1312,7 +1313,7 @@
// Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
getSetAttribute: div.className !== "t",
- // Tests for enctype support on a form(#6743)
+ // Tests for enctype support on a form (#6743)
enctype: !!document.createElement("form").enctype,
// Makes sure cloning an html5 element does not cause problems
@@ -2217,26 +2218,25 @@
},
select: {
get: function( elem ) {
- var value, i, max, option,
+ var value, option,
+ options = elem.options,
index = elem.selectedIndex,
- values = [],
- options = elem.options,
- one = elem.type === "select-one";
+ one = elem.type === "select-one" || index < 0,
+ values = one ? null : [],
+ max = one ? index + 1 : options.length,
+ i = index < 0 ?
+ max :
+ one ? index : 0;
- // Nothing was selected
- if ( index < 0 ) {
- return null;
- }
-
// Loop through all the selected options
- i = one ? index : 0;
- max = one ? index + 1 : options.length;
for ( ; i < max; i++ ) {
option = options[ i ];
- // Don't return options that are disabled or in a disabled optgroup
- if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) &&
- (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) {
+ // oldIE doesn't update selected after form reset (#2551)
+ if ( ( option.selected || i === index ) &&
+ // Don't return options that are disabled or in a disabled optgroup
+ ( jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) &&
+ ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
// Get the specific value for the option
value = jQuery( option ).val();
@@ -2251,11 +2251,6 @@
}
}
- // Fixes Bug #2551 -- select.val() broken in IE after form.reset()
- if ( one && !values.length && options.length ) {
- return jQuery( options[ index ] ).val();
- }
-
return values;
},
@@ -3233,7 +3228,7 @@
if ( elem.detachEvent ) {
- // #8545, #7054, preventing memory leaks for custom events in IE6-8 –
+ // #8545, #7054, preventing memory leaks for custom events in IE6-8
// detachEvent needed property on element, by name of that event, to properly expose it to GC
if ( typeof elem[ name ] === "undefined" ) {
elem[ name ] = null;
@@ -3725,7 +3720,8 @@
delete cache[ keys.shift() ];
}
- return (cache[ key ] = value);
+ // Retrieve with (key + " ") to avoid collision with native Object.prototype properties (see Issue #157)
+ return (cache[ key + " " ] = value);
}, cache );
},
@@ -4259,13 +4255,13 @@
},
"CLASS": function( className ) {
- var pattern = classCache[ expando ][ className ];
- if ( !pattern ) {
- pattern = classCache( className, new RegExp("(^|" + whitespace + ")" + className + "(" + whitespace + "|$)") );
- }
- return function( elem ) {
- return pattern.test( elem.className || (typeof elem.getAttribute !== strundefined && elem.getAttribute("class")) || "" );
- };
+ var pattern = classCache[ expando ][ className + " " ];
+
+ return pattern ||
+ (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
+ classCache( className, function( elem ) {
+ return pattern.test( elem.className || (typeof elem.getAttribute !== strundefined && elem.getAttribute("class")) || "" );
+ });
},
"ATTR": function( name, operator, check ) {
@@ -4511,7 +4507,7 @@
"focus": function( elem ) {
var doc = elem.ownerDocument;
- return elem === doc.activeElement && (!doc.hasFocus || doc.hasFocus()) && !!(elem.type || elem.href);
+ return elem === doc.activeElement && (!doc.hasFocus || doc.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
},
"active": function( elem ) {
@@ -4519,11 +4515,11 @@
},
// Positional types
- "first": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ "first": createPositionalPseudo(function() {
return [ 0 ];
}),
- "last": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ "last": createPositionalPseudo(function( matchIndexes, length ) {
return [ length - 1 ];
}),
@@ -4531,14 +4527,14 @@
return [ argument < 0 ? argument + length : argument ];
}),
- "even": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ "even": createPositionalPseudo(function( matchIndexes, length ) {
for ( var i = 0; i < length; i += 2 ) {
matchIndexes.push( i );
}
return matchIndexes;
}),
- "odd": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ "odd": createPositionalPseudo(function( matchIndexes, length ) {
for ( var i = 1; i < length; i += 2 ) {
matchIndexes.push( i );
}
@@ -4659,7 +4655,9 @@
// Document sorting and removing duplicates
Sizzle.uniqueSort = function( results ) {
var elem,
- i = 1;
+ duplicates = [],
+ i = 1,
+ j = 0;
hasDuplicate = baseHasDuplicate;
results.sort( sortOrder );
@@ -4667,9 +4665,12 @@
if ( hasDuplicate ) {
for ( ; (elem = results[i]); i++ ) {
if ( elem === results[ i - 1 ] ) {
- results.splice( i--, 1 );
+ j = duplicates.push( i );
}
}
+ while ( j-- ) {
+ results.splice( duplicates[ j ], 1 );
+ }
}
return results;
@@ -4680,8 +4681,9 @@
};
function tokenize( selector, parseOnly ) {
- var matched, match, tokens, type, soFar, groups, preFilters,
- cached = tokenCache[ expando ][ selector ];
+ var matched, match, tokens, type,
+ soFar, groups, preFilters,
+ cached = tokenCache[ expando ][ selector + " " ];
if ( cached ) {
return parseOnly ? 0 : cached.slice( 0 );
@@ -4696,7 +4698,8 @@
// Comma and first run
if ( !matched || (match = rcomma.exec( soFar )) ) {
if ( match ) {
- soFar = soFar.slice( match[0].length );
+ // Don't consume trailing commas as valid
+ soFar = soFar.slice( match[0].length ) || soFar;
}
groups.push( tokens = [] );
}
@@ -4715,8 +4718,7 @@
// Filters
for ( type in Expr.filter ) {
if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
- // The last two arguments here are (context, xml) for backCompat
- (match = preFilters[ type ]( match, document, true ))) ) {
+ (match = preFilters[ type ]( match ))) ) {
tokens.push( matched = new Token( match.shift() ) );
soFar = soFar.slice( matched.length );
@@ -4836,18 +4838,13 @@
postFinder = setMatcher( postFinder, postSelector );
}
return markFunction(function( seed, results, context, xml ) {
- // Positional selectors apply to seed elements, so it is invalid to follow them with relative ones
- if ( seed && postFinder ) {
- return;
- }
-
- var i, elem, postFilterIn,
+ var temp, i, elem,
preMap = [],
postMap = [],
preexisting = results.length,
// Get initial elements from seed or context
- elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [], seed ),
+ elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
// Prefilter to get matcher input, preserving a map for seed-results synchronization
matcherIn = preFilter && ( seed || !selector ) ?
@@ -4872,27 +4869,45 @@
// Apply postFilter
if ( postFilter ) {
- postFilterIn = condense( matcherOut, postMap );
- postFilter( postFilterIn, [], context, xml );
+ temp = condense( matcherOut, postMap );
+ postFilter( temp, [], context, xml );
// Un-match failing elements by moving them back to matcherIn
- i = postFilterIn.length;
+ i = temp.length;
while ( i-- ) {
- if ( (elem = postFilterIn[i]) ) {
+ if ( (elem = temp[i]) ) {
matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
}
}
}
- // Keep seed and results synchronized
if ( seed ) {
- // Ignore postFinder because it can't coexist with seed
- i = preFilter && matcherOut.length;
- while ( i-- ) {
- if ( (elem = matcherOut[i]) ) {
- seed[ preMap[i] ] = !(results[ preMap[i] ] = elem);
+ if ( postFinder || preFilter ) {
+ if ( postFinder ) {
+ // Get the final matcherOut by condensing this intermediate into postFinder contexts
+ temp = [];
+ i = matcherOut.length;
+ while ( i-- ) {
+ if ( (elem = matcherOut[i]) ) {
+ // Restore matcherIn since elem is not yet a final match
+ temp.push( (matcherIn[i] = elem) );
+ }
+ }
+ postFinder( null, (matcherOut = []), temp, xml );
}
+
+ // Move matched elements from seed to results to keep them synchronized
+ i = matcherOut.length;
+ while ( i-- ) {
+ if ( (elem = matcherOut[i]) &&
+ (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) {
+
+ seed[temp] = !(results[temp] = elem);
+ }
+ }
}
+
+ // Add elements to results, through postFinder if defined
} else {
matcherOut = condense(
matcherOut === results ?
@@ -4933,7 +4948,6 @@
if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ];
} else {
- // The concatenated values are (context, xml) for backCompat
matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
// Return special upon seeing a positional matcher
@@ -5062,7 +5076,7 @@
var i,
setMatchers = [],
elementMatchers = [],
- cached = compilerCache[ expando ][ selector ];
+ cached = compilerCache[ expando ][ selector + " " ];
if ( !cached ) {
// Generate a function of recursive functions that can be used to check each element
@@ -5085,11 +5099,11 @@
return cached;
};
-function multipleContexts( selector, contexts, results, seed ) {
+function multipleContexts( selector, contexts, results ) {
var i = 0,
len = contexts.length;
for ( ; i < len; i++ ) {
- Sizzle( selector, contexts[i], results, seed );
+ Sizzle( selector, contexts[i], results );
}
return results;
}
@@ -5167,15 +5181,14 @@
rescape = /'|\\/g,
rattributeQuotes = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,
- // qSa(:focus) reports false when true (Chrome 21),
+ // qSa(:focus) reports false when true (Chrome 21), no need to also add to buggyMatches since matches checks buggyQSA
// A support test would require too much code (would include document ready)
- rbuggyQSA = [":focus"],
+ rbuggyQSA = [ ":focus" ],
- // matchesSelector(:focus) reports false when true (Chrome 21),
// matchesSelector(:active) reports false when true (IE9/Opera 11.5)
// A support test would require too much code (would include document ready)
// just skip matchesSelector for :active
- rbuggyMatches = [ ":active", ":focus" ],
+ rbuggyMatches = [ ":active" ],
matches = docElem.matchesSelector ||
docElem.mozMatchesSelector ||
docElem.webkitMatchesSelector ||
@@ -5229,7 +5242,7 @@
// Only use querySelectorAll when not filtering,
// when this is not xml,
// and when no QSA bugs apply
- if ( !seed && !xml && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
+ if ( !seed && !xml && !rbuggyQSA.test( selector ) ) {
var groups, i,
old = true,
nid = expando,
@@ -5298,7 +5311,7 @@
expr = expr.replace( rattributeQuotes, "='$1']" );
// rbuggyMatches always contains :active, so no need for an existence check
- if ( !isXML( elem ) && !rbuggyMatches.test( expr ) && (!rbuggyQSA || !rbuggyQSA.test( expr )) ) {
+ if ( !isXML( elem ) && !rbuggyMatches.test( expr ) && !rbuggyQSA.test( expr ) ) {
try {
var ret = matches.call( elem, expr );
@@ -6533,7 +6546,7 @@
rnumsplit = new RegExp( "^(" + core_pnum + ")(.*)$", "i" ),
rnumnonpx = new RegExp( "^(" + core_pnum + ")(?!px)[a-z%]+$", "i" ),
rrelNum = new RegExp( "^([-+])=(" + core_pnum + ")", "i" ),
- elemdisplay = {},
+ elemdisplay = { BODY: "block" },
cssShow = { position: "absolute", visibility: "hidden", display: "block" },
cssNormalTransform = {
@@ -6814,7 +6827,9 @@
if ( computed ) {
- ret = computed[ name ];
+ // getPropertyValue is only needed for .css('filter') in IE9, see #12537
+ ret = computed.getPropertyValue( name ) || computed[ name ];
+
if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
ret = jQuery.style( elem, name );
}
@@ -7843,9 +7858,12 @@
// A cross-domain request is in order when we have a protocol:host:port mismatch
if ( s.crossDomain == null ) {
- parts = rurl.exec( s.url.toLowerCase() ) || false;
- s.crossDomain = parts && ( parts.join(":") + ( parts[ 3 ] ? "" : parts[ 1 ] === "http:" ? 80 : 443 ) ) !==
- ( ajaxLocParts.join(":") + ( ajaxLocParts[ 3 ] ? "" : ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) );
+ parts = rurl.exec( s.url.toLowerCase() );
+ s.crossDomain = !!( parts &&
+ ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||
+ ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) !=
+ ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) ) )
+ );
}
// Convert data if not already a string
@@ -8464,7 +8482,7 @@
// on any attempt to access responseText (#11426)
try {
responses.text = xhr.responseText;
- } catch( _ ) {
+ } catch( e ) {
}
// Firefox throws an exception when accessing
@@ -8617,7 +8635,9 @@
tick = function() {
var currentTime = fxNow || createFxNow(),
remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
- percent = 1 - ( remaining / animation.duration || 0 ),
+ // archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497)
+ temp = remaining / animation.duration || 0,
+ percent = 1 - temp,
index = 0,
length = animation.tweens.length;
@@ -8769,7 +8789,7 @@
});
function defaultPrefilter( elem, props, opts ) {
- var index, prop, value, length, dataShow, tween, hooks, oldfire,
+ var index, prop, value, length, dataShow, toggle, tween, hooks, oldfire,
anim = this,
style = elem.style,
orig = {},
@@ -8843,6 +8863,7 @@
value = props[ index ];
if ( rfxtypes.exec( value ) ) {
delete props[ index ];
+ toggle = toggle || value === "toggle";
if ( value === ( hidden ? "hide" : "show" ) ) {
continue;
}
@@ -8853,6 +8874,14 @@
length = handled.length;
if ( length ) {
dataShow = jQuery._data( elem, "fxshow" ) || jQuery._data( elem, "fxshow", {} );
+ if ( "hidden" in dataShow ) {
+ hidden = dataShow.hidden;
+ }
+
+ // store state if its toggle - enables .stop().toggle() to "reverse"
+ if ( toggle ) {
+ dataShow.hidden = !hidden;
+ }
if ( hidden ) {
jQuery( elem ).show();
} else {
@@ -9149,6 +9178,8 @@
timers = jQuery.timers,
i = 0;
+ fxNow = jQuery.now();
+
for ( ; i < timers.length; i++ ) {
timer = timers[ i ];
// Checks the timer has not already been removed
@@ -9160,6 +9191,7 @@
if ( !timers.length ) {
jQuery.fx.stop();
}
+ fxNow = undefined;
};
jQuery.fx.timer = function( timer ) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <na...@us...> - 2012-11-11 00:33:36
|
Revision: 705
http://phpsysinfo.svn.sourceforge.net/phpsysinfo/?rev=705&view=rev
Author: namiltd
Date: 2012-11-11 00:33:29 +0000 (Sun, 11 Nov 2012)
Log Message:
-----------
Modified Paths:
--------------
branches/namiltd-ini/phpsysinfo.ini.new
Modified: branches/namiltd-ini/phpsysinfo.ini.new
===================================================================
--- branches/namiltd-ini/phpsysinfo.ini.new 2012-11-04 19:43:21 UTC (rev 704)
+++ branches/namiltd-ini/phpsysinfo.ini.new 2012-11-11 00:33:29 UTC (rev 705)
@@ -42,7 +42,7 @@
; - Quotas - show a table with all quotas that are active and there current state
; - SMART - show S.M.A.R.T. information from drives that support it
; - BAT - show battery state on a laptop
-; - ipmi - show IPMI status
+; - IPMIInfo - show IPMI status
; - UpdateNotifier - show update notifications (only for Ubuntu server)
; - SNMPPInfo - show printers info via SNMP
;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <na...@us...> - 2012-11-04 19:43:28
|
Revision: 704
http://phpsysinfo.svn.sourceforge.net/phpsysinfo/?rev=704&view=rev
Author: namiltd
Date: 2012-11-04 19:43:21 +0000 (Sun, 04 Nov 2012)
Log Message:
-----------
Modified Paths:
--------------
branches/namiltd-ini/ChangeLog
Modified: branches/namiltd-ini/ChangeLog
===================================================================
--- branches/namiltd-ini/ChangeLog 2012-11-04 19:40:42 UTC (rev 703)
+++ branches/namiltd-ini/ChangeLog 2012-11-04 19:43:21 UTC (rev 704)
@@ -9,7 +9,7 @@
- [UPD] Configuration moved from config.php and subdirs of "plugins" to one file phpsysinfo.ini
- [UPD] Plugin ipmi ranamed to IPMIInfo and Update-Notifier to UpdateNotifier (to avoid name conflicts)
- [UPD] Case-insensitive for most of parameters
- - [UPD] Updated jQuery plugin to 1.8.1
+ - [UPD] Updated jQuery plugin to 1.8.2
- [UPD] Updated jQuery plugin nyroModal to 1.6.2+jquery1.8fix
- [FIX] Fixed Bug [ 3561124 ] Incorrect reading of free mem on Mac OS X (thanks to pbobbenb)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <na...@us...> - 2012-11-04 19:40:50
|
Revision: 703
http://phpsysinfo.svn.sourceforge.net/phpsysinfo/?rev=703&view=rev
Author: namiltd
Date: 2012-11-04 19:40:42 +0000 (Sun, 04 Nov 2012)
Log Message:
-----------
Modified Paths:
--------------
branches/namiltd-ini/ChangeLog
branches/namiltd-ini/data/distros.ini
branches/namiltd-ini/includes/os/class.Linux.inc.php
Added Paths:
-----------
branches/namiltd-ini/gfx/images/elementaryOS.png
Modified: branches/namiltd-ini/ChangeLog
===================================================================
--- branches/namiltd-ini/ChangeLog 2012-09-21 16:52:32 UTC (rev 702)
+++ branches/namiltd-ini/ChangeLog 2012-11-04 19:40:42 UTC (rev 703)
@@ -2,14 +2,14 @@
phpSysInfo 3.1.0
- - [ADD] Turbolinux, Oracle Linux and PCLinuxOS to detected distros
+ - [ADD] Turbolinux, Oracle Linux, PCLinuxOS and elementary OS to detected distros
- [ADD] Show System Language and Code Page on Linux and WINNT
- [ADD] Minor support of ReactOS
- [UPD] Configuration moved from config.php and subdirs of "plugins" to one file phpsysinfo.ini
- [UPD] Plugin ipmi ranamed to IPMIInfo and Update-Notifier to UpdateNotifier (to avoid name conflicts)
- [UPD] Case-insensitive for most of parameters
- - [UPD] Updated jQuery plugin to 1.8.2
+ - [UPD] Updated jQuery plugin to 1.8.1
- [UPD] Updated jQuery plugin nyroModal to 1.6.2+jquery1.8fix
- [FIX] Fixed Bug [ 3561124 ] Incorrect reading of free mem on Mac OS X (thanks to pbobbenb)
Modified: branches/namiltd-ini/data/distros.ini
===================================================================
--- branches/namiltd-ini/data/distros.ini 2012-09-21 16:52:32 UTC (rev 702)
+++ branches/namiltd-ini/data/distros.ini 2012-11-04 19:40:42 UTC (rev 703)
@@ -3,15 +3,6 @@
; $Id$
;
-[Debian]
-Name = "Debian"
-Image = "Debian.png"
-Files = "/etc/debian_release;/etc/debian_version"
-
-[SUSE LINUX]
-Image = "Suse.png"
-Files = "/etc/SuSE-release;/etc/UnitedLinux-release"
-
[Gentoo]
Image = "Gentoo.png"
Files = "/etc/gentoo-release"
@@ -56,6 +47,10 @@
Image = "Ubuntu.png"
;detected in "/etc/lsb-release"
+[elementary OS]
+Image = "elementaryOS.png"
+;detected in "/etc/lsb-release"
+
[PLD]
Image = "PLD.png"
Files = "/etc/pld-release"
@@ -162,6 +157,16 @@
Image = "PCLinuxOS.png"
Files = "/etc/pclinuxos-release"
+[SUSE LINUX]
+Image = "Suse.png"
+Files = "/etc/SuSE-release;/etc/UnitedLinux-release"
+
+[Debian]
+Name = "Debian"
+Image = "Debian.png"
+Files = "/etc/debian_release"
+;detected in "/etc/debian_version"
+
; at the end because some distros may also have the same files (like PCLinuxOS etc)
[MandrivaLinux]
Image = "Mandrake.png"
Added: branches/namiltd-ini/gfx/images/elementaryOS.png
===================================================================
(Binary files differ)
Property changes on: branches/namiltd-ini/gfx/images/elementaryOS.png
___________________________________________________________________
Added: svn:mime-type
+ image/png
Modified: branches/namiltd-ini/includes/os/class.Linux.inc.php
===================================================================
--- branches/namiltd-ini/includes/os/class.Linux.inc.php 2012-09-21 16:52:32 UTC (rev 702)
+++ branches/namiltd-ini/includes/os/class.Linux.inc.php 2012-11-04 19:40:42 UTC (rev 703)
@@ -551,29 +551,29 @@
/* default error handler */
if (function_exists('errorHandlerPsi')) {
restore_error_handler();
- }
+ }
/* fatal errors only */
$old_err_rep = error_reporting();
error_reporting(E_ERROR);
-
- // Fall back in case 'lsb_release' does not exist and file 'lsb-release' and 'DISTRO_SPECS' does not exist
+
+ // Fall back in case 'lsb_release' does not exist
foreach ($list as $section=>$distribution) {
- if (!isset($distribution["Files"])) {
+ if (!isset($distribution['Files'])) {
continue;
} else {
- foreach (preg_split("/;/", $distribution["Files"], -1, PREG_SPLIT_NO_EMPTY) as $filename) {
+ foreach (preg_split("/;/", $distribution['Files'], -1, PREG_SPLIT_NO_EMPTY) as $filename) {
if (file_exists($filename)) {
if (!CommonFunctions::rfts($filename, $buf, 1, 4096, false)) {
$buf = "";
}
- if (isset($distribution["Image"])) {
- $this->sys->setDistributionIcon($distribution["Image"]);
+ if (isset($distribution['Image'])) {
+ $this->sys->setDistributionIcon($distribution['Image']);
}
- if (isset($distribution["Name"])) {
- if (($distribution["Name"] == 'Synology') || is_null($buf) || (trim($buf) == "")) {
- $this->sys->setDistribution($distribution["Name"]);
+ if (isset($distribution['Name'])) {
+ if (($distribution['Name'] == 'Synology') || is_null($buf) || (trim($buf) == "")) {
+ $this->sys->setDistribution($distribution['Name']);
} else {
- $this->sys->setDistribution($distribution["Name"]." ".trim($buf));
+ $this->sys->setDistribution($distribution['Name']." ".trim($buf));
}
} else {
if ( is_null($buf) || (trim($buf) == "") ) {
@@ -591,8 +591,8 @@
if ($this->sys->getDistribution() == "Linux") {
if ( file_exists($filename="/etc/lsb-release")
&& CommonFunctions::rfts($filename, $buf, 0, 4096, false)
- && preg_match('/^DISTRIB_ID=(.*)/m', $buf, $id_buf) ) {
- if (preg_match('/^DISTRIB_DESCRIPTION="(.*)"/m', $buf, $desc_buf)) {
+ && preg_match('/^DISTRIB_ID="?([^"\n]*)"?/m', $buf, $id_buf) ) {
+ if (preg_match('/^DISTRIB_DESCRIPTION="?([^"\n]*)"?/m', $buf, $desc_buf)) {
$this->sys->setDistribution(trim($desc_buf[1]));
} else {
if (isset($list[trim($id_buf[1])]['Name'])) {
@@ -600,7 +600,7 @@
} else {
$dist = trim($id_buf[1]);
}
- if (preg_match('/^DISTRIB_RELEASE=(.*)/m', $buf, $vers_buf)) {
+ if (preg_match('/^DISTRIB_RELEASE="?([^"\n]*)"?/m', $buf, $vers_buf)) {
$this->sys->setDistribution(trim($dist." ".trim($vers_buf[1])));
} else {
$this->sys->setDistribution($dist);
@@ -609,7 +609,7 @@
if (isset($list[trim($id_buf[1])]['Image'])) {
$this->sys->setDistributionIcon($list[trim($id_buf[1])]['Image']);
}
- } else
+ } else
if ( file_exists($filename="/etc/DISTRO_SPECS")
&& CommonFunctions::rfts($filename, $buf, 0, 4096, false)
&& preg_match('/^DISTRO_NAME=\'(.*)\'/m', $buf, $id_buf) ) {
@@ -626,21 +626,23 @@
if (isset($list[trim($id_buf[1])]['Image'])) {
$this->sys->setDistributionIcon($list[trim($id_buf[1])]['Image']);
} else {
- if (isset($list['Puppy']["Image"])) {
- $this->sys->setDistributionIcon($list['Puppy']["Image"]);
+ if (isset($list['Puppy']['Image'])) {
+ $this->sys->setDistributionIcon($list['Puppy']['Image']);
}
}
} else
- if ( file_exists($filename="/etc/redhat-release")
- && CommonFunctions::rfts($filename, $buf, 1, 4096, false) ){
- if ( (is_null($buf)) || (trim($buf) == "") ) {
+ if (file_exists($filename="/etc/redhat-release")) {
+ if (!CommonFunctions::rfts($filename, $buf, 1, 4096, false)) {
+ $buf = "";
+ }
+ if ( is_null($buf) || (trim($buf) == "") ) {
if (isset($list['RedHat']['Name'])) {
$this->sys->setDistribution(trim($list['RedHat']['Name']));
} else {
$this->sys->setDistribution('RedHat');
}
- if (isset($list['RedHat']["Image"])) {
- $this->sys->setDistributionIcon($list['RedHat']["Image"]);
+ if (isset($list['RedHat']['Image'])) {
+ $this->sys->setDistributionIcon($list['RedHat']['Image']);
}
} else {
$this->sys->setDistribution(trim($buf));
@@ -648,23 +650,34 @@
&& isset($list[trim($id_buf[1])]['Image'])) {
$this->sys->setDistributionIcon($list[trim($id_buf[1])]['Image']);
} else {
- if (isset($list['RedHat']["Image"])) {
- $this->sys->setDistributionIcon($list['RedHat']["Image"]);
+ if (isset($list['RedHat']['Image'])) {
+ $this->sys->setDistributionIcon($list['RedHat']['Image']);
}
- }
+ }
}
+ } else
+ if (file_exists($filename="/etc/debian_version")){
+ if (!CommonFunctions::rfts($filename, $buf, 1, 4096, false)) {
+ $buf = "";
+ }
+ if (isset($list['Debian']['Image'])) {
+ $this->sys->setDistributionIcon($list['Debian']['Image']);
+ }
+ if (isset($list['Debian']['Name'])) {
+ if ( is_null($buf) || (trim($buf) == "")) {
+ $this->sys->setDistribution($list['Debian']['Name']);
+ } else {
+ $this->sys->setDistribution($list['Debian']['Name']." ".trim($buf));
+ }
+ } else {
+ if ( is_null($buf) || (trim($buf) == "") ) {
+ $this->sys->setDistribution('Debian');
+ } else {
+ $this->sys->setDistribution(trim($buf));
+ }
+ }
}
}
- /*if ($this->sys->getDistribution() == "Linux") {
- if (file_exists($filename="/etc/issue")) {
- if (CommonFunctions::rfts($filename, $buf, 1, 4096, false)
- && (!is_null($buf))
- && ($buf != "")) {
- $this->sys->setDistribution($buf);
- }
- }
-
- }*/
/* restore error level */
error_reporting($old_err_rep);
/* restore error handler */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <na...@us...> - 2012-09-21 16:52:44
|
Revision: 702
http://phpsysinfo.svn.sourceforge.net/phpsysinfo/?rev=702&view=rev
Author: namiltd
Date: 2012-09-21 16:52:32 +0000 (Fri, 21 Sep 2012)
Log Message:
-----------
Modified Paths:
--------------
branches/namiltd-ini/ChangeLog
branches/namiltd-ini/js/jQuery/README
branches/namiltd-ini/js/jQuery/jquery.js
Modified: branches/namiltd-ini/ChangeLog
===================================================================
--- branches/namiltd-ini/ChangeLog 2012-09-16 12:17:39 UTC (rev 701)
+++ branches/namiltd-ini/ChangeLog 2012-09-21 16:52:32 UTC (rev 702)
@@ -9,7 +9,7 @@
- [UPD] Configuration moved from config.php and subdirs of "plugins" to one file phpsysinfo.ini
- [UPD] Plugin ipmi ranamed to IPMIInfo and Update-Notifier to UpdateNotifier (to avoid name conflicts)
- [UPD] Case-insensitive for most of parameters
- - [UPD] Updated jQuery plugin to 1.8.1
+ - [UPD] Updated jQuery plugin to 1.8.2
- [UPD] Updated jQuery plugin nyroModal to 1.6.2+jquery1.8fix
- [FIX] Fixed Bug [ 3561124 ] Incorrect reading of free mem on Mac OS X (thanks to pbobbenb)
Modified: branches/namiltd-ini/js/jQuery/README
===================================================================
--- branches/namiltd-ini/js/jQuery/README 2012-09-16 12:17:39 UTC (rev 701)
+++ branches/namiltd-ini/js/jQuery/README 2012-09-21 16:52:32 UTC (rev 702)
@@ -3,7 +3,7 @@
jquery.js
---------
-VERSION : 1.8.1
+VERSION : 1.8.2
URL : http://jquery.com/
DESC : jQuery is a fast, concise, JavaScript Library that simplifies how you traverse HTML documents, handle
events, perform animations, and add Ajax interactions to your web pages.
Modified: branches/namiltd-ini/js/jQuery/jquery.js
===================================================================
--- branches/namiltd-ini/js/jQuery/jquery.js 2012-09-16 12:17:39 UTC (rev 701)
+++ branches/namiltd-ini/js/jQuery/jquery.js 2012-09-21 16:52:32 UTC (rev 702)
@@ -1,5 +1,5 @@
/*!
- * jQuery JavaScript Library v1.8.1
+ * jQuery JavaScript Library v1.8.2
* http://jquery.com/
*
* Includes Sizzle.js
@@ -9,7 +9,7 @@
* Released under the MIT license
* http://jquery.org/license
*
- * Date: Thu Aug 30 2012 17:17:22 GMT-0400 (Eastern Daylight Time)
+ * Date: Thu Sep 20 2012 21:13:05 GMT-0400 (Eastern Daylight Time)
*/
(function( window, undefined ) {
var
@@ -186,7 +186,7 @@
selector: "",
// The current version of jQuery being used
- jquery: "1.8.1",
+ jquery: "1.8.2",
// The default length of a jQuery object is 0
length: 0,
@@ -573,7 +573,7 @@
},
nodeName: function( elem, name ) {
- return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
+ return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
},
// args is for internal usage only
@@ -630,7 +630,7 @@
function( text ) {
return text == null ?
"" :
- text.toString().replace( rtrim, "" );
+ ( text + "" ).replace( rtrim, "" );
},
// results is for internal usage only
@@ -776,7 +776,7 @@
};
// Set the guid of unique handler to the same of original handler, so it can be removed
- proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;
+ proxy.guid = fn.guid = fn.guid || jQuery.guid++;
return proxy;
},
@@ -1143,7 +1143,7 @@
// Get a promise for this deferred
// If obj is provided, the promise aspect is added to the object
promise: function( obj ) {
- return typeof obj === "object" ? jQuery.extend( obj, promise ) : promise;
+ return obj != null ? jQuery.extend( obj, promise ) : promise;
}
},
deferred = {};
@@ -1262,7 +1262,7 @@
a.style.cssText = "top:1px;float:left;opacity:.5";
// Can't get basic test support
- if ( !all || !all.length || !a ) {
+ if ( !all || !all.length ) {
return {};
}
@@ -1513,7 +1513,7 @@
deletedIds: [],
- // Please use with caution
+ // Remove at next major release (1.9/2.0)
uuid: 0,
// Unique for each copy of jQuery on the page
@@ -1565,7 +1565,7 @@
// Only DOM nodes need a new unique ID for each element since their data
// ends up in the global cache
if ( isNode ) {
- elem[ internalKey ] = id = jQuery.deletedIds.pop() || ++jQuery.uuid;
+ elem[ internalKey ] = id = jQuery.deletedIds.pop() || jQuery.guid++;
} else {
id = internalKey;
}
@@ -1739,7 +1739,7 @@
for ( l = attr.length; i < l; i++ ) {
name = attr[i].name;
- if ( name.indexOf( "data-" ) === 0 ) {
+ if ( !name.indexOf( "data-" ) ) {
name = jQuery.camelCase( name.substring(5) );
dataAttr( elem, name, data[ name ] );
@@ -2049,7 +2049,7 @@
setClass = " " + elem.className + " ";
for ( c = 0, cl = classNames.length; c < cl; c++ ) {
- if ( !~setClass.indexOf( " " + classNames[ c ] + " " ) ) {
+ if ( setClass.indexOf( " " + classNames[ c ] + " " ) < 0 ) {
setClass += classNames[ c ] + " ";
}
}
@@ -2082,7 +2082,7 @@
// loop over each item in the removal list
for ( c = 0, cl = removes.length; c < cl; c++ ) {
// Remove until there is nothing to remove,
- while ( className.indexOf(" " + removes[ c ] + " ") > -1 ) {
+ while ( className.indexOf(" " + removes[ c ] + " ") >= 0 ) {
className = className.replace( " " + removes[ c ] + " " , " " );
}
}
@@ -2136,7 +2136,7 @@
i = 0,
l = this.length;
for ( ; i < l; i++ ) {
- if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
+ if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) {
return true;
}
}
@@ -2314,7 +2314,7 @@
return ret;
} else {
- elem.setAttribute( name, "" + value );
+ elem.setAttribute( name, value + "" );
return value;
}
@@ -2578,7 +2578,7 @@
return elem.style.cssText.toLowerCase() || undefined;
},
set: function( elem, value ) {
- return ( elem.style.cssText = "" + value );
+ return ( elem.style.cssText = value + "" );
}
};
}
@@ -2711,6 +2711,7 @@
handler: handler,
guid: handler.guid,
selector: selector,
+ needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
namespace: namespaces.join(".")
}, handleObjIn );
@@ -2946,7 +2947,7 @@
}
// Note that this is a bare JS function and not a jQuery handler
handle = ontype && cur[ ontype ];
- if ( handle && jQuery.acceptData( cur ) && handle.apply( cur, data ) === false ) {
+ if ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) {
event.preventDefault();
}
}
@@ -2994,7 +2995,7 @@
var i, j, cur, ret, selMatch, matched, matches, handleObj, sel, related,
handlers = ( (jQuery._data( this, "events" ) || {} )[ event.type ] || []),
delegateCount = handlers.delegateCount,
- args = [].slice.call( arguments ),
+ args = core_slice.call( arguments ),
run_all = !event.exclusive && !event.namespace,
special = jQuery.event.special[ event.type ] || {},
handlerQueue = [];
@@ -3023,7 +3024,9 @@
sel = handleObj.selector;
if ( selMatch[ sel ] === undefined ) {
- selMatch[ sel ] = jQuery( sel, this ).index( cur ) >= 0;
+ selMatch[ sel ] = handleObj.needsContext ?
+ jQuery( sel, this ).index( cur ) >= 0 :
+ jQuery.find( sel, this, null, [ cur ] ).length;
}
if ( selMatch[ sel ] ) {
matches.push( handleObj );
@@ -3593,7 +3596,7 @@
},
undelegate: function( selector, types, fn ) {
// ( namespace ) or ( selector, types [, fn] )
- return arguments.length == 1? this.off( selector, "**" ) : this.off( types, selector || "**", fn );
+ return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn );
},
trigger: function( type, data ) {
@@ -3664,14 +3667,13 @@
});
/*!
* Sizzle CSS Selector Engine
- * Copyright 2012 jQuery Foundation and other contributors
- * Released under the MIT license
- * http://sizzlejs.com/
+ * Copyright 2012 jQuery Foundation and other contributors
+ * Released under the MIT license
+ * http://sizzlejs.com/
*/
(function( window, undefined ) {
-var dirruns,
- cachedruns,
+var cachedruns,
assertGetIdNotName,
Expr,
getText,
@@ -3680,21 +3682,36 @@
compile,
sortOrder,
hasDuplicate,
+ outermostContext,
baseHasDuplicate = true,
strundefined = "undefined",
expando = ( "sizcache" + Math.random() ).replace( ".", "" ),
+ Token = String,
document = window.document,
docElem = document.documentElement,
+ dirruns = 0,
done = 0,
+ pop = [].pop,
+ push = [].push,
slice = [].slice,
- push = [].push,
+ // Use a stripped-down indexOf if a native one is unavailable
+ indexOf = [].indexOf || function( elem ) {
+ var i = 0,
+ len = this.length;
+ for ( ; i < len; i++ ) {
+ if ( this[i] === elem ) {
+ return i;
+ }
+ }
+ return -1;
+ },
// Augment a function for special use by Sizzle
markFunction = function( fn, value ) {
- fn[ expando ] = value || true;
+ fn[ expando ] = value == null || value;
return fn;
},
@@ -3741,7 +3758,8 @@
pseudos = ":(" + characterEncoding + ")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:" + attributes + ")|[^:]|\\\\.)*|.*))\\)|)",
// For matchExpr.POS and matchExpr.needsContext
- pos = ":(nth|eq|gt|lt|first|last|even|odd)(?:\\(((?:-\\d)?\\d*)\\)|)(?=[^-]|$)",
+ pos = ":(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace +
+ "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)",
// Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
@@ -3769,10 +3787,10 @@
"TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ),
"ATTR": new RegExp( "^" + attributes ),
"PSEUDO": new RegExp( "^" + pseudos ),
- "CHILD": new RegExp( "^:(only|nth|last|first)-child(?:\\(" + whitespace +
+ "POS": new RegExp( pos, "i" ),
+ "CHILD": new RegExp( "^:(only|nth|first|last)-child(?:\\(" + whitespace +
"*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
"*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
- "POS": new RegExp( pos, "ig" ),
// For use in libraries implementing .is()
"needsContext": new RegExp( "^" + whitespace + "*[>+~]|" + pos, "i" )
},
@@ -3854,7 +3872,8 @@
slice.call( docElem.childNodes, 0 )[0].nodeType;
} catch ( e ) {
slice = function( i ) {
- var elem, results = [];
+ var elem,
+ results = [];
for ( ; (elem = this[i]); i++ ) {
results.push( elem );
}
@@ -3868,14 +3887,14 @@
var match, elem, xml, m,
nodeType = context.nodeType;
+ if ( !selector || typeof selector !== "string" ) {
+ return results;
+ }
+
if ( nodeType !== 1 && nodeType !== 9 ) {
return [];
}
- if ( !selector || typeof selector !== "string" ) {
- return results;
- }
-
xml = isXML( context );
if ( !xml && !seed ) {
@@ -3919,7 +3938,7 @@
}
// All others
- return select( selector, context, results, seed, xml );
+ return select( selector.replace( rtrim, "$1" ), context, results, seed, xml );
}
Sizzle.matches = function( expr, elements ) {
@@ -3946,6 +3965,25 @@
};
}
+// Returns a function to use in pseudos for positionals
+function createPositionalPseudo( fn ) {
+ return markFunction(function( argument ) {
+ argument = +argument;
+ return markFunction(function( seed, matches ) {
+ var j,
+ matchIndexes = fn( [], seed.length, argument ),
+ i = matchIndexes.length;
+
+ // Match elements found at the specified indexes
+ while ( i-- ) {
+ if ( seed[ (j = matchIndexes[i]) ] ) {
+ seed[j] = !(matches[j] = seed[j]);
+ }
+ }
+ });
+ });
+}
+
/**
* Utility function for retrieving the text value of an array of DOM nodes
* @param {Array|Element} elem
@@ -3983,7 +4021,7 @@
return ret;
};
-isXML = Sizzle.isXML = function isXML( elem ) {
+isXML = Sizzle.isXML = function( elem ) {
// documentElement is verified for cases where it doesn't yet exist
// (such as loading iframes in IE - #4833)
var documentElement = elem && (elem.ownerDocument || elem).documentElement;
@@ -4011,23 +4049,23 @@
};
Sizzle.attr = function( elem, name ) {
- var attr,
+ var val,
xml = isXML( elem );
if ( !xml ) {
name = name.toLowerCase();
}
- if ( Expr.attrHandle[ name ] ) {
- return Expr.attrHandle[ name ]( elem );
+ if ( (val = Expr.attrHandle[ name ]) ) {
+ return val( elem );
}
- if ( assertAttributes || xml ) {
+ if ( xml || assertAttributes ) {
return elem.getAttribute( name );
}
- attr = elem.getAttributeNode( name );
- return attr ?
+ val = elem.getAttributeNode( name );
+ return val ?
typeof elem[ name ] === "boolean" ?
elem[ name ] ? name : null :
- attr.specified ? attr.value : null :
+ val.specified ? val.value : null :
null;
};
@@ -4040,11 +4078,6 @@
match: matchExpr,
- order: new RegExp( "ID|TAG" +
- (assertUsableName ? "|NAME" : "") +
- (assertUsableClassName ? "|CLASS" : "")
- ),
-
// IE6/7 return a modified href
attrHandle: assertHrefNotNormalized ?
{} :
@@ -4105,13 +4138,13 @@
return results;
},
- "NAME": function( tag, context ) {
+ "NAME": assertUsableName && function( tag, context ) {
if ( typeof context.getElementsByName !== strundefined ) {
return context.getElementsByName( name );
}
},
- "CLASS": function( className, context, xml ) {
+ "CLASS": assertUsableClassName && function( className, context, xml ) {
if ( typeof context.getElementsByClassName !== strundefined && !xml ) {
return context.getElementsByClassName( className );
}
@@ -4140,7 +4173,7 @@
},
"CHILD": function( match ) {
- /* matches from matchExpr.CHILD
+ /* matches from matchExpr["CHILD"]
1 type (only|nth|...)
2 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
3 xn-component of xn+y argument ([+-]?\d*n|)
@@ -4170,7 +4203,7 @@
return match;
},
- "PSEUDO": function( match, context, xml ) {
+ "PSEUDO": function( match ) {
var unquoted, excess;
if ( matchExpr["CHILD"].test( match[0] ) ) {
return null;
@@ -4182,7 +4215,7 @@
// Only check arguments that contain a pseudo
if ( rpseudo.test(unquoted) &&
// Get excess from tokenize (recursively)
- (excess = tokenize( unquoted, context, xml, true )) &&
+ (excess = tokenize( unquoted, true )) &&
// advance to the next closing parenthesis
(excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
@@ -4236,76 +4269,55 @@
},
"ATTR": function( name, operator, check ) {
- if ( !operator ) {
- return function( elem ) {
- return Sizzle.attr( elem, name ) != null;
- };
- }
+ return function( elem, context ) {
+ var result = Sizzle.attr( elem, name );
- return function( elem ) {
- var result = Sizzle.attr( elem, name ),
- value = result + "";
-
if ( result == null ) {
return operator === "!=";
}
+ if ( !operator ) {
+ return true;
+ }
- switch ( operator ) {
- case "=":
- return value === check;
- case "!=":
- return value !== check;
- case "^=":
- return check && value.indexOf( check ) === 0;
- case "*=":
- return check && value.indexOf( check ) > -1;
- case "$=":
- return check && value.substr( value.length - check.length ) === check;
- case "~=":
- return ( " " + value + " " ).indexOf( check ) > -1;
- case "|=":
- return value === check || value.substr( 0, check.length + 1 ) === check + "-";
- }
+ result += "";
+
+ return operator === "=" ? result === check :
+ operator === "!=" ? result !== check :
+ operator === "^=" ? check && result.indexOf( check ) === 0 :
+ operator === "*=" ? check && result.indexOf( check ) > -1 :
+ operator === "$=" ? check && result.substr( result.length - check.length ) === check :
+ operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 :
+ operator === "|=" ? result === check || result.substr( 0, check.length + 1 ) === check + "-" :
+ false;
};
},
"CHILD": function( type, argument, first, last ) {
if ( type === "nth" ) {
- var doneName = done++;
-
return function( elem ) {
- var parent, diff,
- count = 0,
- node = elem;
+ var node, diff,
+ parent = elem.parentNode;
if ( first === 1 && last === 0 ) {
return true;
}
- parent = elem.parentNode;
-
- if ( parent && (parent[ expando ] !== doneName || !elem.sizset) ) {
+ if ( parent ) {
+ diff = 0;
for ( node = parent.firstChild; node; node = node.nextSibling ) {
if ( node.nodeType === 1 ) {
- node.sizset = ++count;
- if ( node === elem ) {
+ diff++;
+ if ( elem === node ) {
break;
}
}
}
-
- parent[ expando ] = doneName;
}
- diff = elem.sizset - last;
-
- if ( first === 0 ) {
- return diff === 0;
-
- } else {
- return ( diff % first === 0 && diff / first >= 0 );
- }
+ // Incorporate the offset (or cast to NaN), then check against cycle size
+ diff -= last;
+ return diff === first || ( diff % first === 0 && diff / first >= 0 );
};
}
@@ -4340,45 +4352,85 @@
};
},
- "PSEUDO": function( pseudo, argument, context, xml ) {
+ "PSEUDO": function( pseudo, argument ) {
// pseudo-class names are case-insensitive
// http://www.w3.org/TR/selectors/#pseudo-classes
// Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
+ // Remember that setFilters inherits from pseudos
var args,
- fn = Expr.pseudos[ pseudo ] || Expr.pseudos[ pseudo.toLowerCase() ];
+ fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
+ Sizzle.error( "unsupported pseudo: " + pseudo );
- if ( !fn ) {
- Sizzle.error( "unsupported pseudo: " + pseudo );
- }
-
// The user may use createPseudo to indicate that
// arguments are needed to create the filter function
// just as Sizzle does
- if ( !fn[ expando ] ) {
- if ( fn.length > 1 ) {
- args = [ pseudo, pseudo, "", argument ];
- return function( elem ) {
+ if ( fn[ expando ] ) {
+ return fn( argument );
+ }
+
+ // But maintain support for old signatures
+ if ( fn.length > 1 ) {
+ args = [ pseudo, pseudo, "", argument ];
+ return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
+ markFunction(function( seed, matches ) {
+ var idx,
+ matched = fn( seed, argument ),
+ i = matched.length;
+ while ( i-- ) {
+ idx = indexOf.call( seed, matched[i] );
+ seed[ idx ] = !( matches[ idx ] = matched[i] );
+ }
+ }) :
+ function( elem ) {
return fn( elem, 0, args );
};
- }
- return fn;
}
- return fn( argument, context, xml );
+ return fn;
}
},
pseudos: {
- "not": markFunction(function( selector, context, xml ) {
+ "not": markFunction(function( selector ) {
// Trim the selector passed to compile
// to avoid treating leading and trailing
// spaces as combinators
- var matcher = compile( selector.replace( rtrim, "$1" ), context, xml );
+ var input = [],
+ results = [],
+ matcher = compile( selector.replace( rtrim, "$1" ) );
+
+ return matcher[ expando ] ?
+ markFunction(function( seed, matches, context, xml ) {
+ var elem,
+ unmatched = matcher( seed, null, xml, [] ),
+ i = seed.length;
+
+ // Match elements unmatched by `matcher`
+ while ( i-- ) {
+ if ( (elem = unmatched[i]) ) {
+ seed[i] = !(matches[i] = elem);
+ }
+ }
+ }) :
+ function( elem, context, xml ) {
+ input[0] = elem;
+ matcher( input, null, xml, results );
+ return !results.pop();
+ };
+ }),
+
+ "has": markFunction(function( selector ) {
return function( elem ) {
- return !matcher( elem );
+ return Sizzle( selector, elem ).length > 0;
};
}),
+ "contains": markFunction(function( text ) {
+ return function( elem ) {
+ return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
+ };
+ }),
+
"enabled": function( elem ) {
return elem.disabled === false;
},
@@ -4425,18 +4477,6 @@
return true;
},
- "contains": markFunction(function( text ) {
- return function( elem ) {
- return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
- };
- }),
-
- "has": markFunction(function( selector ) {
- return function( elem ) {
- return Sizzle( selector, elem ).length > 0;
- };
- }),
-
"header": function( elem ) {
return rheader.test( elem.nodeName );
},
@@ -4476,51 +4516,48 @@
"active": function( elem ) {
return elem === elem.ownerDocument.activeElement;
- }
- },
-
- setFilters: {
- "first": function( elements, argument, not ) {
- return not ? elements.slice( 1 ) : [ elements[0] ];
},
- "last": function( elements, argument, not ) {
- var elem = elements.pop();
- return not ? elements : [ elem ];
- },
+ // Positional types
+ "first": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ return [ 0 ];
+ }),
- "even": function( elements, argument, not ) {
- var results = [],
- i = not ? 1 : 0,
- len = elements.length;
- for ( ; i < len; i = i + 2 ) {
- results.push( elements[i] );
+ "last": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ return [ length - 1 ];
+ }),
+
+ "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ return [ argument < 0 ? argument + length : argument ];
+ }),
+
+ "even": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ for ( var i = 0; i < length; i += 2 ) {
+ matchIndexes.push( i );
}
- return results;
- },
+ return matchIndexes;
+ }),
- "odd": function( elements, argument, not ) {
- var results = [],
- i = not ? 0 : 1,
- len = elements.length;
- for ( ; i < len; i = i + 2 ) {
- results.push( elements[i] );
+ "odd": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ for ( var i = 1; i < length; i += 2 ) {
+ matchIndexes.push( i );
}
- return results;
- },
+ return matchIndexes;
+ }),
- "lt": function( elements, argument, not ) {
- return not ? elements.slice( +argument ) : elements.slice( 0, +argument );
- },
+ "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ for ( var i = argument < 0 ? argument + length : argument; --i >= 0; ) {
+ matchIndexes.push( i );
+ }
+ return matchIndexes;
+ }),
- "gt": function( elements, argument, not ) {
- return not ? elements.slice( 0, +argument + 1 ) : elements.slice( +argument + 1 );
- },
-
- "eq": function( elements, argument, not ) {
- var elem = elements.splice( +argument, 1 );
- return not ? elements : elem;
- }
+ "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ for ( var i = argument < 0 ? argument + length : argument; ++i < length; ) {
+ matchIndexes.push( i );
+ }
+ return matchIndexes;
+ })
}
};
@@ -4642,24 +4679,17 @@
throw new Error( "Syntax error, unrecognized expression: " + msg );
};
-function tokenize( selector, context, xml, parseOnly ) {
- var matched, match, tokens, type,
- soFar, groups, group, i,
- preFilters, filters,
- checkContext = !xml && context !== document,
- // Token cache should maintain spaces
- key = ( checkContext ? "<s>" : "" ) + selector.replace( rtrim, "$1<s>" ),
- cached = tokenCache[ expando ][ key ];
+function tokenize( selector, parseOnly ) {
+ var matched, match, tokens, type, soFar, groups, preFilters,
+ cached = tokenCache[ expando ][ selector ];
if ( cached ) {
- return parseOnly ? 0 : slice.call( cached, 0 );
+ return parseOnly ? 0 : cached.slice( 0 );
}
soFar = selector;
groups = [];
- i = 0;
preFilters = Expr.preFilter;
- filters = Expr.filter;
while ( soFar ) {
@@ -4667,45 +4697,31 @@
if ( !matched || (match = rcomma.exec( soFar )) ) {
if ( match ) {
soFar = soFar.slice( match[0].length );
- tokens.selector = group;
}
groups.push( tokens = [] );
- group = "";
-
- // Need to make sure we're within a narrower context if necessary
- // Adding a descendant combinator will generate what is needed
- if ( checkContext ) {
- soFar = " " + soFar;
- }
}
matched = false;
// Combinators
if ( (match = rcombinators.exec( soFar )) ) {
- group += match[0];
- soFar = soFar.slice( match[0].length );
+ tokens.push( matched = new Token( match.shift() ) );
+ soFar = soFar.slice( matched.length );
// Cast descendant combinators to space
- matched = tokens.push({
- part: match.pop().replace( rtrim, " " ),
- string: match[0],
- captures: match
- });
+ matched.type = match[0].replace( rtrim, " " );
}
// Filters
- for ( type in filters ) {
+ for ( type in Expr.filter ) {
if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
- ( match = preFilters[ type ](match, context, xml) )) ) {
+ // The last two arguments here are (context, xml) for backCompat
+ (match = preFilters[ type ]( match, document, true ))) ) {
- group += match[0];
- soFar = soFar.slice( match[0].length );
- matched = tokens.push({
- part: type,
- string: match.shift(),
- captures: match
- });
+ tokens.push( matched = new Token( match.shift() ) );
+ soFar = soFar.slice( matched.length );
+ matched.type = type;
+ matched.matches = match;
}
}
@@ -4714,11 +4730,6 @@
}
}
- // Attach the full group as a selector
- if ( group ) {
- tokens.selector = group;
- }
-
// Return the length of the invalid excess
// if we're just parsing
// Otherwise, throw an error or return tokens
@@ -4727,43 +4738,33 @@
soFar ?
Sizzle.error( selector ) :
// Cache the tokens
- slice.call( tokenCache(key, groups), 0 );
+ tokenCache( selector, groups ).slice( 0 );
}
-function addCombinator( matcher, combinator, context, xml ) {
+function addCombinator( matcher, combinator, base ) {
var dir = combinator.dir,
+ checkNonElements = base && combinator.dir === "parentNode",
doneName = done++;
- if ( !matcher ) {
- // If there is no matcher to check, check against the context
- matcher = function( elem ) {
- return elem === context;
- };
- }
return combinator.first ?
- function( elem ) {
+ // Check against closest ancestor/preceding element
+ function( elem, context, xml ) {
while ( (elem = elem[ dir ]) ) {
- if ( elem.nodeType === 1 ) {
- return matcher( elem ) && elem;
+ if ( checkNonElements || elem.nodeType === 1 ) {
+ return matcher( elem, context, xml );
}
}
} :
- xml ?
- function( elem ) {
- while ( (elem = elem[ dir ]) ) {
- if ( elem.nodeType === 1 ) {
- if ( matcher( elem ) ) {
- return elem;
- }
- }
- }
- } :
- function( elem ) {
+
+ // Check against all ancestor/preceding elements
+ function( elem, context, xml ) {
+ // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching
+ if ( !xml ) {
var cache,
- dirkey = doneName + "." + dirruns,
- cachedkey = dirkey + "." + cachedruns;
+ dirkey = dirruns + " " + doneName + " ",
+ cachedkey = dirkey + cachedruns;
while ( (elem = elem[ dir ]) ) {
- if ( elem.nodeType === 1 ) {
+ if ( checkNonElements || elem.nodeType === 1 ) {
if ( (cache = elem[ expando ]) === cachedkey ) {
return elem.sizset;
} else if ( typeof cache === "string" && cache.indexOf(dirkey) === 0 ) {
@@ -4772,7 +4773,7 @@
}
} else {
elem[ expando ] = cachedkey;
- if ( matcher( elem ) ) {
+ if ( matcher( elem, context, xml ) ) {
elem.sizset = true;
return elem;
}
@@ -4780,254 +4781,382 @@
}
}
}
- };
+ } else {
+ while ( (elem = elem[ dir ]) ) {
+ if ( checkNonElements || elem.nodeType === 1 ) {
+ if ( matcher( elem, context, xml ) ) {
+ return elem;
+ }
+ }
+ }
+ }
+ };
}
-function addMatcher( higher, deeper ) {
- return higher ?
- function( elem ) {
- var result = deeper( elem );
- return result && higher( result === true ? elem : result );
+function elementMatcher( matchers ) {
+ return matchers.length > 1 ?
+ function( elem, context, xml ) {
+ var i = matchers.length;
+ while ( i-- ) {
+ if ( !matchers[i]( elem, context, xml ) ) {
+ return false;
+ }
+ }
+ return true;
} :
- deeper;
+ matchers[0];
}
-// ["TAG", ">", "ID", " ", "CLASS"]
-function matcherFromTokens( tokens, context, xml ) {
- var token, matcher,
- i = 0;
+function condense( unmatched, map, filter, context, xml ) {
+ var elem,
+ newUnmatched = [],
+ i = 0,
+ len = unmatched.length,
+ mapped = map != null;
- for ( ; (token = tokens[i]); i++ ) {
- if ( Expr.relative[ token.part ] ) {
- matcher = addCombinator( matcher, Expr.relative[ token.part ], context, xml );
- } else {
- matcher = addMatcher( matcher, Expr.filter[ token.part ].apply(null, token.captures.concat( context, xml )) );
+ for ( ; i < len; i++ ) {
+ if ( (elem = unmatched[i]) ) {
+ if ( !filter || filter( elem, context, xml ) ) {
+ newUnmatched.push( elem );
+ if ( mapped ) {
+ map.push( i );
+ }
+ }
}
}
- return matcher;
+ return newUnmatched;
}
-function matcherFromGroupMatchers( matchers ) {
- return function( elem ) {
- var matcher,
- j = 0;
- for ( ; (matcher = matchers[j]); j++ ) {
- if ( matcher(elem) ) {
- return true;
- }
+function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
+ if ( postFilter && !postFilter[ expando ] ) {
+ postFilter = setMatcher( postFilter );
+ }
+ if ( postFinder && !postFinder[ expando ] ) {
+ postFinder = setMatcher( postFinder, postSelector );
+ }
+ return markFunction(function( seed, results, context, xml ) {
+ // Positional selectors apply to seed elements, so it is invalid to follow them with relative ones
+ if ( seed && postFinder ) {
+ return;
}
- return false;
- };
-}
-compile = Sizzle.compile = function( selector, context, xml ) {
- var group, i, len,
- cached = compilerCache[ expando ][ selector ];
+ var i, elem, postFilterIn,
+ preMap = [],
+ postMap = [],
+ preexisting = results.length,
- // Return a cached group function if already generated (context dependent)
- if ( cached && cached.context === context ) {
- return cached;
- }
+ // Get initial elements from seed or context
+ elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [], seed ),
- // Generate a function of recursive functions that can be used to check each element
- group = tokenize( selector, context, xml );
- for ( i = 0, len = group.length; i < len; i++ ) {
- group[i] = matcherFromTokens(group[i], context, xml);
- }
+ // Prefilter to get matcher input, preserving a map for seed-results synchronization
+ matcherIn = preFilter && ( seed || !selector ) ?
+ condense( elems, preMap, preFilter, context, xml ) :
+ elems,
- // Cache the compiled function
- cached = compilerCache( selector, matcherFromGroupMatchers(group) );
- cached.context = context;
- cached.runs = cached.dirruns = 0;
- return cached;
-};
+ matcherOut = matcher ?
+ // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
+ postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
-function multipleContexts( selector, contexts, results, seed ) {
- var i = 0,
- len = contexts.length;
- for ( ; i < len; i++ ) {
- Sizzle( selector, contexts[i], results, seed );
- }
+ // ...intermediate processing is necessary
+ [] :
+
+ // ...otherwise use results directly
+ results :
+ matcherIn;
+
+ // Find primary matches
+ if ( matcher ) {
+ matcher( matcherIn, matcherOut, context, xml );
+ }
+
+ // Apply postFilter
+ if ( postFilter ) {
+ postFilterIn = condense( matcherOut, postMap );
+ postFilter( postFilterIn, [], context, xml );
+
+ // Un-match failing elements by moving them back to matcherIn
+ i = postFilterIn.length;
+ while ( i-- ) {
+ if ( (elem = postFilterIn[i]) ) {
+ matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
+ }
+ }
+ }
+
+ // Keep seed and results synchronized
+ if ( seed ) {
+ // Ignore postFinder because it can't coexist with seed
+ i = preFilter && matcherOut.length;
+ while ( i-- ) {
+ if ( (elem = matcherOut[i]) ) {
+ seed[ preMap[i] ] = !(results[ preMap[i] ] = elem);
+ }
+ }
+ } else {
+ matcherOut = condense(
+ matcherOut === results ?
+ matcherOut.splice( preexisting, matcherOut.length ) :
+ matcherOut
+ );
+ if ( postFinder ) {
+ postFinder( null, results, matcherOut, xml );
+ } else {
+ push.apply( results, matcherOut );
+ }
+ }
+ });
}
-function handlePOSGroup( selector, posfilter, argument, contexts, seed, not ) {
- var results,
- fn = Expr.setFilters[ posfilter.toLowerCase() ];
+function matcherFromTokens( tokens ) {
+ var checkContext, matcher, j,
+ len = tokens.length,
+ leadingRelative = Expr.relative[ tokens[0].type ],
+ implicitRelative = leadingRelative || Expr.relative[" "],
+ i = leadingRelative ? 1 : 0,
- if ( !fn ) {
- Sizzle.error( posfilter );
- }
+ // The foundational matcher ensures that elements are reachable from top-level context(s)
+ matchContext = addCombinator( function( elem ) {
+ return elem === checkContext;
+ }, implicitRelative, true ),
+ matchAnyContext = addCombinator( function( elem ) {
+ return indexOf.call( checkContext, elem ) > -1;
+ }, implicitRelative, true ),
+ matchers = [ function( elem, context, xml ) {
+ return ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
+ (checkContext = context).nodeType ?
+ matchContext( elem, context, xml ) :
+ matchAnyContext( elem, context, xml ) );
+ } ];
- if ( selector || !(results = seed) ) {
- multipleContexts( selector || "*", contexts, (results = []), seed );
+ for ( ; i < len; i++ ) {
+ if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
+ matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ];
+ } else {
+ // The concatenated values are (context, xml) for backCompat
+ matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
+
+ // Return special upon seeing a positional matcher
+ if ( matcher[ expando ] ) {
+ // Find the next relative operator (if any) for proper handling
+ j = ++i;
+ for ( ; j < len; j++ ) {
+ if ( Expr.relative[ tokens[j].type ] ) {
+ break;
+ }
+ }
+ return setMatcher(
+ i > 1 && elementMatcher( matchers ),
+ i > 1 && tokens.slice( 0, i - 1 ).join("").replace( rtrim, "$1" ),
+ matcher,
+ i < j && matcherFromTokens( tokens.slice( i, j ) ),
+ j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
+ j < len && tokens.join("")
+ );
+ }
+ matchers.push( matcher );
+ }
}
- return results.length > 0 ? fn( results, argument, not ) : [];
+ return elementMatcher( matchers );
}
-function handlePOS( groups, context, results, seed ) {
- var group, part, j, groupLen, token, selector,
- anchor, elements, match, matched,
- lastIndex, currentContexts, not,
- i = 0,
- len = groups.length,
- rpos = matchExpr["POS"],
- // This is generated here in case matchExpr["POS"] is extended
- rposgroups = new RegExp( "^" + rpos.source + "(?!" + whitespace + ")", "i" ),
- // This is for making sure non-participating
- // matching groups are represented cross-browser (IE6-8)
- setUndefined = function() {
- var i = 1,
- len = arguments.length - 2;
- for ( ; i < len; i++ ) {
- if ( arguments[i] === undefined ) {
- match[i] = undefined;
+function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
+ var bySet = setMatchers.length > 0,
+ byElement = elementMatchers.length > 0,
+ superMatcher = function( seed, context, xml, results, expandContext ) {
+ var elem, j, matcher,
+ setMatched = [],
+ matchedCount = 0,
+ i = "0",
+ unmatched = seed && [],
+ outermost = expandContext != null,
+ contextBackup = outermostContext,
+ // We must always have either seed elements or context
+ elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ),
+ // Nested matchers should use non-integer dirruns
+ dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.E);
+
+ if ( outermost ) {
+ outermostContext = context !== document && context;
+ cachedruns = superMatcher.el;
+ }
+
+ // Add elements passing elementMatchers directly to results
+ for ( ; (elem = elems[i]) != null; i++ ) {
+ if ( byElement && elem ) {
+ for ( j = 0; (matcher = elementMatchers[j]); j++ ) {
+ if ( matcher( elem, context, xml ) ) {
+ results.push( elem );
+ break;
+ }
+ }
+ if ( outermost ) {
+ dirruns = dirrunsUnique;
+ cachedruns = ++superMatcher.el;
+ }
}
+
+ // Track unmatched elements for set filters
+ if ( bySet ) {
+ // They will have gone through all possible matchers
+ if ( (elem = !matcher && elem) ) {
+ matchedCount--;
+ }
+
+ // Lengthen the array for every element, matched or not
+ if ( seed ) {
+ unmatched.push( elem );
+ }
+ }
}
- };
- for ( ; i < len; i++ ) {
- group = groups[i];
- part = "";
- elements = seed;
- for ( j = 0, groupLen = group.length; j < groupLen; j++ ) {
- token = group[j];
- selector = token.string;
- if ( token.part === "PSEUDO" ) {
- // Reset regex index to 0
- rpos.exec("");
- anchor = 0;
- while ( (match = rpos.exec( selector )) ) {
- matched = true;
- lastIndex = rpos.lastIndex = match.index + match[0].length;
- if ( lastIndex > anchor ) {
- part += selector.slice( anchor, match.index );
- anchor = lastIndex;
- currentContexts = [ context ];
+ // Apply set filters to unmatched elements
+ matchedCount += i;
+ if ( bySet && i !== matchedCount ) {
+ for ( j = 0; (matcher = setMatchers[j]); j++ ) {
+ matcher( unmatched, setMatched, context, xml );
+ }
- if ( rcombinators.test(part) ) {
- if ( elements ) {
- currentContexts = elements;
+ if ( seed ) {
+ // Reintegrate element matches to eliminate the need for sorting
+ if ( matchedCount > 0 ) {
+ while ( i-- ) {
+ if ( !(unmatched[i] || setMatched[i]) ) {
+ setMatched[i] = pop.call( results );
}
- elements = seed;
}
+ }
- if ( (not = rendsWithNot.test( part )) ) {
- part = part.slice( 0, -5 ).replace( rcombinators, "$&*" );
- anchor++;
- }
+ // Discard index placeholder values to get only actual matches
+ setMatched = condense( setMatched );
+ }
- if ( match.length > 1 ) {
- match[0].replace( rposgroups, setUndefined );
- }
- elements = handlePOSGroup( part, match[1], match[2], currentContexts, elements, not );
- }
- part = "";
+ // Add matches to results
+ push.apply( results, setMatched );
+
+ // Seedless set matches succeeding multiple successful matchers stipulate sorting
+ if ( outermost && !seed && setMatched.length > 0 &&
+ ( matchedCount + setMatchers.length ) > 1 ) {
+
+ Sizzle.uniqueSort( results );
}
+ }
+ // Override manipulation of globals by nested matchers
+ if ( outermost ) {
+ dirruns = dirrunsUnique;
+ outermostContext = contextBackup;
}
- if ( !matched ) {
- part += selector;
- }
- matched = false;
+ return unmatched;
+ };
+
+ superMatcher.el = 0;
+ return bySet ?
+ markFunction( superMatcher ) :
+ superMatcher;
+}
+
+compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) {
+ var i,
+ setMatchers = [],
+ elementMatchers = [],
+ cached = compilerCache[ expando ][ selector ];
+
+ if ( !cached ) {
+ // Generate a function of recursive functions that can be used to check each element
+ if ( !group ) {
+ group = tokenize( selector );
}
-
- if ( part ) {
- if ( rcombinators.test(part) ) {
- multipleContexts( part, elements || [ context ], results, seed );
+ i = group.length;
+ while ( i-- ) {
+ cached = matcherFromTokens( group[i] );
+ if ( cached[ expando ] ) {
+ setMatchers.push( cached );
} else {
- Sizzle( part, context, results, seed ? seed.concat(elements) : elements );
+ elementMatchers.push( cached );
}
- } else {
- push.apply( results, elements );
}
+
+ // Cache the compiled function
+ cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
}
+ return cached;
+};
- // Do not sort if this is a single filter
- return len === 1 ? results : Sizzle.uniqueSort( results );
+function multipleContexts( selector, contexts, results, seed ) {
+ var i = 0,
+ len = contexts.length;
+ for ( ; i < len; i++ ) {
+ Sizzle( selector, contexts[i], results, seed );
+ }
+ return results;
}
function select( selector, context, results, seed, xml ) {
- // Remove excessive whitespace
- selector = selector.replace( rtrim, "$1" );
- var elements, matcher, cached, elem,
- i, tokens, token, lastToken, findContext, type,
- match = tokenize( selector, context, xml ),
- contextNodeType = context.nodeType;
+ var i, tokens, token, type, find,
+ match = tokenize( selector ),
+ j = match.length;
- // POS handling
- if ( matchExpr["POS"].test(selector) ) {
- return handlePOS( match, context, results, seed );
- }
+ if ( !seed ) {
+ // Try to minimize operations if there is only one group
+ if ( match.length === 1 ) {
- if ( seed ) {
- elements = slice.call( seed, 0 );
+ // Take a shortcut and set the context if the root selector is an ID
+ tokens = match[0] = match[0].slice( 0 );
+ if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
+ context.nodeType === 9 && !xml &&
+ Expr.relative[ tokens[1].type ] ) {
- // To maintain document order, only narrow the
- // set if there is one group
- } else if ( match.length === 1 ) {
+ context = Expr.find["ID"]( token.matches[0].replace( rbackslash, "" ), context, xml )[0];
+ if ( !context ) {
+ return results;
+ }
- // Take a shortcut and set the context if the root selector is an ID
- if ( (tokens = slice.call( match[0], 0 )).length > 2 &&
- (token = tokens[0]).part === "ID" &&
- contextNodeType === 9 && !xml &&
- Expr.relative[ tokens[1].part ] ) {
-
- context = Expr.find["ID"]( token.captures[0].replace( rbackslash, "" ), context, xml )[0];
- if ( !context ) {
- return results;
+ selector = selector.slice( tokens.shift().length );
}
- selector = selector.slice( tokens.shift().string.length );
- }
+ // Fetch a seed set for right-to-left matching
+ for ( i = matchExpr["POS"].test( selector ) ? -1 : tokens.length - 1; i >= 0; i-- ) {
+ token = tokens[i];
- findContext = ( (match = rsibling.exec( tokens[0].string )) && !match.index && context.parentNode ) || context;
+ // Abort if we hit a combinator
+ if ( Expr.relative[ (type = token.type) ] ) {
+ break;
+ }
+ if ( (find = Expr.find[ type ]) ) {
+ // Search, expanding context for leading sibling combinators
+ if ( (seed = find(
+ token.matches[0].replace( rbackslash, "" ),
+ rsibling.test( tokens[0].type ) && context.parentNode || context,
+ xml
+ )) ) {
- // Reduce the set if possible
- lastToken = "";
- for ( i = tokens.length - 1; i >= 0; i-- ) {
- token = tokens[i];
- type = token.part;
- lastToken = token.string + lastToken;
- if ( Expr.relative[ type ] ) {
- break;
- }
- if ( Expr.order.test(type) ) {
- elements = Expr.find[ type ]( token.captures[0].replace( rbackslash, "" ), findContext, xml );
- if ( elements == null ) {
- continue;
- } else {
- selector = selector.slice( 0, selector.length - lastToken.length ) +
- lastToken.replace( matchExpr[ type ], "" );
+ // If seed is empty or no tokens remain, we can return early
+ tokens.splice( i, 1 );
+ selector = seed.length && tokens.join("");
+ if ( !selector ) {
+ push.apply( results, slice.call( seed, 0 ) );
+ return results;
+ }
- if ( !selector ) {
- push.apply( results, slice.call(elements, 0) );
+ break;
}
-
- break;
}
}
}
}
- // Only loop over the given elements once
- if ( selector ) {
- matcher = compile( selector, context, xml );
- dirruns = matcher.dirruns++;
- if ( elements == null ) {
- elements = Expr.find["TAG"]( "*", (rsibling.test( selector ) && context.parentNode) || context );
- }
-
- for ( i = 0; (elem = elements[i]); i++ ) {
- cachedruns = matcher.runs++;
- if ( matcher(elem) ) {
- results.push( elem );
- }
- }
- }
-
+ // Compile and execute a filtering function
+ // Provide `match` to avoid retokenization if we modified the selector above
+ compile( selector, match )(
+ seed,
+ context,
+ xml,
+ results,
+ rsibling.test( selector )
+ );
return results;
}
@@ -5037,11 +5166,16 @@
oldSelect = select,
rescape = /'|\\/g,
rattributeQuotes = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,
- rbuggyQSA = [],
+
+ // qSa(:focus) reports false when true (Chrome 21),
+ // A support test would require too much code (would include document ready)
+ rbuggyQSA = [":focus"],
+
+ // matchesSelector(:focus) reports false when true (Chrome 21),
// matchesSelector(:active) reports false when true (IE9/Opera 11.5)
// A support test would require too much code (would include document ready)
// just skip matchesSelector for :active
- rbuggyMatches = [":active"],
+ rbuggyMatches = [ ":active", ":focus" ],
matches = docElem.matchesSelector ||
docElem.mozMatchesSelector ||
docElem.webkitMatchesSelector ||
@@ -5088,44 +5222,46 @@
}
});
- rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
+ // rbuggyQSA always contains :focus, so no need for a length check
+ rbuggyQSA = /* rbuggyQSA.length && */ new RegExp( rbuggyQSA.join("|") );
select = function( selector, context, results, seed, xml ) {
// Only use querySelectorAll when not filtering,
// when this is not xml,
// and when no QSA bugs apply
if ( !seed && !xml && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
- if ( context.nodeType === 9 ) {
- try {
- push.apply( results, slice.call(context.querySelectorAll( selector ), 0) );
- return results;
- } catch(qsaError) {}
+ var groups, i,
+ old = true,
+ nid = expando,
+ newContext = context,
+ newSelector = context.nodeType === 9 && selector;
+
// qSA works strangely on Element-rooted queries
// We can work around this by specifying an extra ID on the root
// and working up from there (Thanks to Andrew Dupont for the technique)
// IE 8 doesn't work on object elements
- } else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
- var groups, i, len,
- old = context.getAttribute("id"),
- nid = old || expando,
- newContext = rsibling.test( selector ) && context.parentNode || context;
+ if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
+ groups = tokenize( selector );
- if ( old ) {
- nid = nid.replace( rescape, "\\$&" );
+ if ( (old = context.getAttribute("id")) ) {
+ nid = old.replace( rescape, "\\$&" );
} else {
context.setAttribute( "id", nid );
}
+ nid = "[id='" + nid + "'] ";
- groups = tokenize(selector, context, xml);
- // Trailing space is unnecessary
- // There is always a context check
- nid = "[id='" + nid + "']";
- for ( i = 0, len = groups.length; i < len; i++ ) {
- groups[i] = nid + groups[i].selector;
+ i = groups.length;
+ while ( i-- ) {
+ groups[i] = nid + groups[i].join("");
}
+ newContext = rsibling.test( selector ) && context.parentNode || context;
+ newSelector = groups.join(",");
+ }
+
+ if ( newSelector ) {
try {
push.apply( results, slice.call( newContext.querySelectorAll(
- groups.join(",")
+ newSelector
), 0 ) );
return results;
} catch(qsaError) {
@@ -5150,11 +5286,11 @@
// Gecko does not error, returns false instead
try {
matches.call( div, "[test!='']:sizzle" );
- rbuggyMatches.push( matchExpr["PSEUDO"].source, matchExpr["POS"].source, "!=" );
+ rbuggyMatches.push( "!=", pseudos );
} catch ( e ) {}
});
- // rbuggyMatches always contains :active, so no need for a length check
+ // rbuggyMatches always contains :active and :focus, so no need for a length check
rbuggyMatches = /* rbuggyMatches.length && */ new RegExp( rbuggyMatches.join("|") );
Sizzle.matchesSelector = function( elem, expr ) {
@@ -5183,10 +5319,12 @@
}
// Deprecated
-Expr.setFilters["nth"] = Expr.setFilters["eq"];
+Expr.pseudos["nth"] = Expr.pseudos["eq"];
// Back-compat
-Expr.filters = Expr.pseudos;
+function setFilters() {}
+Expr.filters = setFilters.prototype = Expr.pseudos;
+Expr.setFilters = new setFilters();
// Override sizzle attribute retrieval
Sizzle.attr = jQuery.attr;
@@ -7123,10 +7261,10 @@
add( prefix, obj );
}
}
-var // Document location
+var
+ // Document location
+ ajaxLocParts,
ajaxLocation,
- // Document location segments
- ajaxLocParts,
rhash = /#.*$/,
rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
@@ -7643,7 +7781,7 @@
// Set data for the fake xhr object
jqXHR.status = status;
- jqXHR.statusText = "" + ( nativeStatusText || statusText );
+ jqXHR.statusText = ( nativeStatusText || statusText ) + "";
// Success/Error
if ( isSuccess ) {
@@ -7703,14 +7841,11 @@
// Extract dataTypes list
s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().split( core_rspace );
- // Determine if a cross-domain request is in order
+ // A cross-domain request is in order when we have a protocol:host:port mismatch
if ( s.crossDomain == null ) {
- parts = rurl.exec( s.url.toLowerCase() );
- s.crossDomain = !!( parts &&
- ( parts[ 1 ] != ajaxLocParts[ 1 ] || parts[ 2 ] != ajaxLocParts[ 2 ] ||
- ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) !=
- ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) ) )
- );
+ parts = rurl.exec( s.url.toLowerCase() ) || false;
+ s.crossDomain = parts && ( parts.join(":") + ( parts[ 3 ] ? "" : parts[ 1 ] === "http:" ? 80 : 443 ) ) !==
+ ( ajaxLocParts.join(":") + ( ajaxLocParts[ 3 ] ? "" : ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) );
}
// Convert data if not already a string
@@ -8405,12 +8540,13 @@
animationPrefilters = [ defaultPrefilter ],
tweeners = {
"*": [function( prop, value ) {
- var end, unit, prevScale,
+ var end, unit,
tween = this.createTween( prop, value ),
parts = rfxnum.exec( value ),
target = tween.cur(),
start = +target || 0,
- scale = 1;
+ scale = 1,
+ maxIterations = 20;
if ( parts ) {
end = +parts[2];
@@ -8426,17 +8562,15 @@
do {
// If previous iteration zeroed out, double until we get *something*
// Use a string for doubling factor so we don't accidentally see scale as unchanged below
- prevScale = scale = scale || ".5";
+ scale = scale || ".5";
// Adjust and apply
start = start / scale;
jQuery.style( tween.elem, prop, start + unit );
- // Update scale, tolerating zeroes from tween.cur()
- scale = tween.cur() / target;
-
- // Stop looping if we've hit the mark or scale is unchanged
- } while ( scale !== 1 && scale !== prevScale );
+ // Update scale, tolerating zero or NaN from tween.cur()
+ // And breaking the loop if scale is unchanged or perfect, or if we've just had enough
+ } while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations );
}
tween.unit = unit;
@@ -9069,7 +9203,8 @@
});
}
- var box, docElem, body, win, clientTop, clientLeft, scrollTop, scrollLeft, top, left,
+ var docElem, body, win, clientTop, clientLeft, scrollTop, scrollLeft,
+ box = { top: 0, left: 0 },
elem = this[ 0 ],
doc = elem && elem.ownerDocument;
@@ -9083,21 +9218,25 @@
docElem = doc.documentElement;
- // Make sure we're not dealing with a disconnected DOM node
+ // Make sure it's not a disconnected DOM node
if ( !jQuery.contains( docElem, elem ) ) {
- return { top: 0, left: 0 };
+ return box;
}
- box = elem.getBoundingClientRect();
+ // If we don't have gBCR, just use 0,0 rather than error
+ // BlackBerry 5, iOS 3 (original iPhone)
+ if ( typeof elem.getBoundingClientRect !== "undefined" ) {
+ box = elem.getBoundingClientRect();
+ }
win = getWindow( doc );
clientTop = docElem.clientTop || body.clientTop || 0;
clientLeft = docElem.clientLeft || body.clientLeft || 0;
scrollTop = win.pageYOffset || docElem.scrollTop;
scrollLeft = win.pageXOffset || docElem.scrollLeft;
- top = box.top + scrollTop - clientTop;
- left = box.left + scrollLeft - clientLeft;
-
- return { top: top, left: left };
+ return {
+ top: box.top + scrollTop - clientTop,
+ left: box.left + scrollLeft - clientLeft
+ };
};
jQuery.offset = {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <na...@us...> - 2012-09-16 12:17:45
|
Revision: 701
http://phpsysinfo.svn.sourceforge.net/phpsysinfo/?rev=701&view=rev
Author: namiltd
Date: 2012-09-16 12:17:39 +0000 (Sun, 16 Sep 2012)
Log Message:
-----------
PCLinuxOS to detected distros
Modified Paths:
--------------
branches/namiltd-ini/config.php
Modified: branches/namiltd-ini/config.php
===================================================================
--- branches/namiltd-ini/config.php 2012-09-16 12:08:13 UTC (rev 700)
+++ branches/namiltd-ini/config.php 2012-09-16 12:17:39 UTC (rev 701)
@@ -43,7 +43,7 @@
define('PSI_VERSION_STRING', PSI_VERSION);
}
- /* get Linux charset */
+ /* get Linux code page */
if (PHP_OS == 'Linux'){
if (file_exists ('/etc/sysconfig/i18n')){
$contents = @file_get_contents('/etc/sysconfig/i18n');
@@ -59,7 +59,7 @@
if (@exec($matches[1].' locale -k LC_CTYPE 2>/dev/null', $lines)) {
foreach ($lines as $line) {
if ($contents && preg_match("/^charmap=\"(.*)\"/m", $line, $matches2)) {
- define('PSI_SYSTEM_CHARSET', $matches2[1]);
+ define('PSI_SYSTEM_CODEPAGE', $matches2[1]);
break;
}
}
@@ -76,7 +76,7 @@
if ($lang == ""){
$lang = 'Unknown';
}
- define('PSI_SYSTEM_LANGUAGE', $lang.' ('.$matches2[1].')');
+ define('PSI_SYSTEM_SYSLANG', $lang.' ('.$matches2[1].')');
break;
}
}
@@ -84,11 +84,11 @@
}
}
- if (!defined('PSI_SYSTEM_CHARSET')){
- define('PSI_SYSTEM_CHARSET', null);
+ if (!defined('PSI_SYSTEM_SYSLANG')){
+ define('PSI_SYSTEM_SYSLANG', null);
}
- if (!defined('PSI_SYSTEM_LANGUAGE')){
- define('PSI_SYSTEM_LANGUAGE', null);
+ if (!defined('PSI_SYSTEM_CODEPAGE')){
+ define('PSI_SYSTEM_CODEPAGE', null);
}
/* restore error level */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <na...@us...> - 2012-09-16 12:08:19
|
Revision: 700
http://phpsysinfo.svn.sourceforge.net/phpsysinfo/?rev=700&view=rev
Author: namiltd
Date: 2012-09-16 12:08:13 +0000 (Sun, 16 Sep 2012)
Log Message:
-----------
PCLinuxOS to detected distros
Modified Paths:
--------------
branches/namiltd-ini/ChangeLog
branches/namiltd-ini/config.php
branches/namiltd-ini/data/distros.ini
Added Paths:
-----------
branches/namiltd-ini/gfx/images/PCLinuxOS.png
Modified: branches/namiltd-ini/ChangeLog
===================================================================
--- branches/namiltd-ini/ChangeLog 2012-09-15 11:57:13 UTC (rev 699)
+++ branches/namiltd-ini/ChangeLog 2012-09-16 12:08:13 UTC (rev 700)
@@ -2,7 +2,7 @@
phpSysInfo 3.1.0
- - [ADD] Turbolinux and Oracle Linux to detected distros
+ - [ADD] Turbolinux, Oracle Linux and PCLinuxOS to detected distros
- [ADD] Show System Language and Code Page on Linux and WINNT
- [ADD] Minor support of ReactOS
Modified: branches/namiltd-ini/config.php
===================================================================
--- branches/namiltd-ini/config.php 2012-09-15 11:57:13 UTC (rev 699)
+++ branches/namiltd-ini/config.php 2012-09-16 12:08:13 UTC (rev 700)
@@ -43,7 +43,7 @@
define('PSI_VERSION_STRING', PSI_VERSION);
}
- /* get Linux code page */
+ /* get Linux charset */
if (PHP_OS == 'Linux'){
if (file_exists ('/etc/sysconfig/i18n')){
$contents = @file_get_contents('/etc/sysconfig/i18n');
@@ -51,12 +51,15 @@
$contents = @file_get_contents('/etc/default/locale');
} else if (file_exists ('/etc/locale.conf')){
$contents = @file_get_contents('/etc/locale.conf');
+ } else if (file_exists ('/etc/sysconfig/language')){
+ $contents = @file_get_contents('/etc/sysconfig/language');
} else $contents = false;
- if ($contents && preg_match("/^(LANG=\".*\")/m", $contents, $matches)) {
+ if ($contents && ( preg_match("/^(LANG=\".*\")/m", $contents, $matches)
+ || preg_match("/^RC_(LANG=\".*\")/m", $contents, $matches))) {
if (@exec($matches[1].' locale -k LC_CTYPE 2>/dev/null', $lines)) {
foreach ($lines as $line) {
if ($contents && preg_match("/^charmap=\"(.*)\"/m", $line, $matches2)) {
- define('PSI_SYSTEM_CODEPAGE', $matches2[1]);
+ define('PSI_SYSTEM_CHARSET', $matches2[1]);
break;
}
}
@@ -73,7 +76,7 @@
if ($lang == ""){
$lang = 'Unknown';
}
- define('PSI_SYSTEM_SYSLANG', $lang.' ('.$matches2[1].')');
+ define('PSI_SYSTEM_LANGUAGE', $lang.' ('.$matches2[1].')');
break;
}
}
@@ -81,11 +84,11 @@
}
}
- if (!defined('PSI_SYSTEM_SYSLANG')){
- define('PSI_SYSTEM_SYSLANG', null);
+ if (!defined('PSI_SYSTEM_CHARSET')){
+ define('PSI_SYSTEM_CHARSET', null);
}
- if (!defined('PSI_SYSTEM_CODEPAGE')){
- define('PSI_SYSTEM_CODEPAGE', null);
+ if (!defined('PSI_SYSTEM_LANGUAGE')){
+ define('PSI_SYSTEM_LANGUAGE', null);
}
/* restore error level */
Modified: branches/namiltd-ini/data/distros.ini
===================================================================
--- branches/namiltd-ini/data/distros.ini 2012-09-15 11:57:13 UTC (rev 699)
+++ branches/namiltd-ini/data/distros.ini 2012-09-16 12:08:13 UTC (rev 700)
@@ -12,14 +12,6 @@
Image = "Suse.png"
Files = "/etc/SuSE-release;/etc/UnitedLinux-release"
-[Mandrake]
-Image = "Mandrake.png"
-Files = "/etc/mandrake-release"
-
-[MandrivaLinux]
-Image = "Mandrake.png"
-Files = "/etc/mandrake-release"
-
[Gentoo]
Image = "Gentoo.png"
Files = "/etc/gentoo-release"
@@ -62,7 +54,7 @@
[Ubuntu]
Image = "Ubuntu.png"
-;Files = "/etc/lsb-release"
+;detected in "/etc/lsb-release"
[PLD]
Image = "PLD.png"
@@ -71,7 +63,7 @@
[CentOS]
Image = "CentOS.png"
Files = "/etc/centos-release"
-;detected Files = "/etc/redhat-release"
+;detected in "/etc/redhat-release"
[LFS]
Image = "lfs.png"
@@ -83,7 +75,7 @@
[IYCC]
Image = "iycc.png"
-;Files = "/etc/lsb-release"
+;detected in "/etc/lsb-release"
[Synology]
Name = "Synology"
@@ -96,31 +88,31 @@
[Scientific]
Image = "Scientific.png"
-;detected Files = "/etc/redhat-release"
+;detected in "/etc/redhat-release"
[Scientific Linux]
Image = "Scientific.png"
-;detected Files = "/etc/redhat-release"
+;detected in "/etc/redhat-release"
[ScientificSL]
Image = "Scientific.png"
-;detected Files = "/etc/redhat-release"
+;detected in "/etc/redhat-release"
[ScientificCERNSLC]
Image = "Scientific.png"
-;detected Files = "/etc/redhat-release"
+;detected in "/etc/redhat-release"
[ScientificFermiLTS]
Image = "Scientific.png"
-;also Files = "/etc/t-release"
+;detected in "/etc/redhat-release"
[ScientificSLF]
Image = "Scientific.png"
-;detected Files = "/etc/redhat-release"
+;detected in "/etc/redhat-release"
[LinuxMint]
Image = "Mint.png"
-;Files = "/etc/lsb-release"
+;detected in "/etc/lsb-release"
[Mageia]
Image = "Mageia.png"
@@ -128,7 +120,7 @@
[Chakra]
Image = "Chakra.png"
-;Files = "/etc/lsb-release"
+;detected in "/etc/lsb-release"
[Alpine]
Name = "Alpine"
@@ -137,20 +129,20 @@
[Puppy]
Image = "Puppy.png"
-;Files = "/etc/DISTRO_SPECS"
+;detected in "/etc/DISTRO_SPECS"
[Lucid]
Name = "Lucid Puppy"
Image = "Puppy.png"
-;Files = "/etc/DISTRO_SPECS"
+;detected in "/etc/DISTRO_SPECS"
[Slacko Puppy]
Image = "Puppy.png"
-;Files = "/etc/DISTRO_SPECS"
+;detected in "/etc/DISTRO_SPECS"
[Wary Puppy]
Image = "Puppy.png"
-;Files = "/etc/DISTRO_SPECS"
+;detected in "/etc/DISTRO_SPECS"
[Turbolinux]
Image = "Turbo.png"
@@ -159,25 +151,39 @@
[Oracle]
Image = "Oracle.png"
Files = "/etc/oracle-release"
-;detected Files = "/etc/redhat-release"
+;detected in "/etc/redhat-release"
[OracleServer]
Image = "Oracle.png"
Files = "/etc/oracle-release"
-;detected Files = "/etc/redhat-release"
+;detected in "/etc/redhat-release"
-; at the end because some distros may also have the same files (like CentOS, Oracle, Scientific etc)
+[PCLinuxOS]
+Image = "PCLinuxOS.png"
+Files = "/etc/pclinuxos-release"
+
+; at the end because some distros may also have the same files (like PCLinuxOS etc)
+[MandrivaLinux]
+Image = "Mandrake.png"
+Files = "/etc/mandiva-release"
+
+; at the end because some distros may also have the same files (like MandivaLinux, PCLinuxOS etc)
+[Mandrake]
+Image = "Mandrake.png"
+Files = "/etc/mandrake-release;/etc/mandrakelinux-release"
+
+; at the end because some distros may also have the same files (like CentOS, Oracle, Scientific, Mandrake, MandivaLinux, PCLinuxOS etc)
[RedHat]
Image = "Redhat.png"
Files = "/etc/redhat_version"
-;detected Files = "/etc/redhat-release"
+;detected in "/etc/redhat-release"
[RedHatEnterpriseES]
Image = "Redhat.png"
Files = "/etc/redhat_version"
-;detected Files = "/etc/redhat-release"
+;detected in "/etc/redhat-release"
[RedHatEnterpriseAS]
Image = "Redhat.png"
Files = "/etc/redhat_version"
-;detected Files = "/etc/redhat-release"
+;detected in "/etc/redhat-release"
Added: branches/namiltd-ini/gfx/images/PCLinuxOS.png
===================================================================
(Binary files differ)
Property changes on: branches/namiltd-ini/gfx/images/PCLinuxOS.png
___________________________________________________________________
Added: svn:mime-type
+ image/png
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <na...@us...> - 2012-09-15 11:57:21
|
Revision: 699
http://phpsysinfo.svn.sourceforge.net/phpsysinfo/?rev=699&view=rev
Author: namiltd
Date: 2012-09-15 11:57:13 +0000 (Sat, 15 Sep 2012)
Log Message:
-----------
variables renaming
Modified Paths:
--------------
branches/namiltd-ini/ChangeLog
branches/namiltd-ini/config.php
branches/namiltd-ini/includes/class.CommonFunctions.inc.php
branches/namiltd-ini/includes/os/class.OS.inc.php
branches/namiltd-ini/includes/os/class.WINNT.inc.php
branches/namiltd-ini/includes/xml/class.XML.inc.php
branches/namiltd-ini/js/phpSysInfo/phpsysinfo.js
branches/namiltd-ini/language/ast.xml
branches/namiltd-ini/language/bg.xml
branches/namiltd-ini/language/cz.xml
branches/namiltd-ini/language/da.xml
branches/namiltd-ini/language/de.xml
branches/namiltd-ini/language/en.xml
branches/namiltd-ini/language/es.xml
branches/namiltd-ini/language/et.xml
branches/namiltd-ini/language/fi.xml
branches/namiltd-ini/language/fr.xml
branches/namiltd-ini/language/gl.xml
branches/namiltd-ini/language/gr.xml
branches/namiltd-ini/language/hu.xml
branches/namiltd-ini/language/is.xml
branches/namiltd-ini/language/it.xml
branches/namiltd-ini/language/ja.xml
branches/namiltd-ini/language/ko.xml
branches/namiltd-ini/language/nl.xml
branches/namiltd-ini/language/no.xml
branches/namiltd-ini/language/pl.xml
branches/namiltd-ini/language/pt-br.xml
branches/namiltd-ini/language/ro.xml
branches/namiltd-ini/language/ru.xml
branches/namiltd-ini/language/sc.xml
branches/namiltd-ini/language/sk.xml
branches/namiltd-ini/language/sl.xml
branches/namiltd-ini/language/sv.xml
branches/namiltd-ini/language/th.xml
branches/namiltd-ini/language/tr.xml
branches/namiltd-ini/language/tw.xml
branches/namiltd-ini/language/uk.xml
branches/namiltd-ini/phpsysinfo.xslt
branches/namiltd-ini/phpsysinfo3.xsd
branches/namiltd-ini/templates/html/index_dynamic.html
Modified: branches/namiltd-ini/ChangeLog
===================================================================
--- branches/namiltd-ini/ChangeLog 2012-09-14 20:33:53 UTC (rev 698)
+++ branches/namiltd-ini/ChangeLog 2012-09-15 11:57:13 UTC (rev 699)
@@ -3,7 +3,7 @@
phpSysInfo 3.1.0
- [ADD] Turbolinux and Oracle Linux to detected distros
- - [ADD] Show System Language and Charmap on Linux and WINNT
+ - [ADD] Show System Language and Code Page on Linux and WINNT
- [ADD] Minor support of ReactOS
- [UPD] Configuration moved from config.php and subdirs of "plugins" to one file phpsysinfo.ini
Modified: branches/namiltd-ini/config.php
===================================================================
--- branches/namiltd-ini/config.php 2012-09-14 20:33:53 UTC (rev 698)
+++ branches/namiltd-ini/config.php 2012-09-15 11:57:13 UTC (rev 699)
@@ -43,7 +43,7 @@
define('PSI_VERSION_STRING', PSI_VERSION);
}
- /* get Linux charset */
+ /* get Linux code page */
if (PHP_OS == 'Linux'){
if (file_exists ('/etc/sysconfig/i18n')){
$contents = @file_get_contents('/etc/sysconfig/i18n');
@@ -56,7 +56,7 @@
if (@exec($matches[1].' locale -k LC_CTYPE 2>/dev/null', $lines)) {
foreach ($lines as $line) {
if ($contents && preg_match("/^charmap=\"(.*)\"/m", $line, $matches2)) {
- define('PSI_SYSTEM_CHARSET', $matches2[1]);
+ define('PSI_SYSTEM_CODEPAGE', $matches2[1]);
break;
}
}
@@ -73,7 +73,7 @@
if ($lang == ""){
$lang = 'Unknown';
}
- define('PSI_SYSTEM_LANGUAGE', $lang.' ('.$matches2[1].')');
+ define('PSI_SYSTEM_SYSLANG', $lang.' ('.$matches2[1].')');
break;
}
}
@@ -81,11 +81,11 @@
}
}
- if (!defined('PSI_SYSTEM_CHARSET')){
- define('PSI_SYSTEM_CHARSET', null);
+ if (!defined('PSI_SYSTEM_SYSLANG')){
+ define('PSI_SYSTEM_SYSLANG', null);
}
- if (!defined('PSI_SYSTEM_LANGUAGE')){
- define('PSI_SYSTEM_LANGUAGE', null);
+ if (!defined('PSI_SYSTEM_CODEPAGE')){
+ define('PSI_SYSTEM_CODEPAGE', null);
}
/* restore error level */
Modified: branches/namiltd-ini/includes/class.CommonFunctions.inc.php
===================================================================
--- branches/namiltd-ini/includes/class.CommonFunctions.inc.php 2012-09-14 20:33:53 UTC (rev 698)
+++ branches/namiltd-ini/includes/class.CommonFunctions.inc.php 2012-09-15 11:57:13 UTC (rev 699)
@@ -225,7 +225,7 @@
*/
public static function checkForExtensions($arrExt = array())
{
- if ( (PHP_OS == "Minix") || (PSI_SYSTEM_CHARSET == "UTF-8") )
+ if ( (PHP_OS == "Minix") || (PSI_SYSTEM_CODEPAGE == "UTF-8") )
$arrReq = array('simplexml', 'pcre', 'xml', 'dom');
else if (PHP_OS == "WINNT")
$arrReq = array('simplexml', 'pcre', 'xml', 'mbstring', 'dom', 'com_dotnet');
Modified: branches/namiltd-ini/includes/os/class.OS.inc.php
===================================================================
--- branches/namiltd-ini/includes/os/class.OS.inc.php 2012-09-14 20:33:53 UTC (rev 698)
+++ branches/namiltd-ini/includes/os/class.OS.inc.php 2012-09-15 11:57:13 UTC (rev 699)
@@ -55,7 +55,7 @@
*/
public function getEncoding()
{
- return PSI_SYSTEM_CHARSET;
+ return PSI_SYSTEM_CODEPAGE;
}
/**
* get os specific language
@@ -66,7 +66,7 @@
*/
public function getLanguage()
{
- return PSI_SYSTEM_LANGUAGE;
+ return PSI_SYSTEM_SYSLANG;
}
/**
Modified: branches/namiltd-ini/includes/os/class.WINNT.inc.php
===================================================================
--- branches/namiltd-ini/includes/os/class.WINNT.inc.php 2012-09-14 20:33:53 UTC (rev 698)
+++ branches/namiltd-ini/includes/os/class.WINNT.inc.php 2012-09-15 11:57:13 UTC (rev 699)
@@ -46,14 +46,14 @@
*
* @var string
*/
- private $_charset = null;
+ private $_codepage = null;
/**
* store language of the system
*
* @var string
*/
- private $_language = null;
+ private $_syslang = null;
/**
* build the global Error object and create the WMI connection
@@ -90,7 +90,7 @@
{
$buffer = $this->_getWMI('Win32_OperatingSystem', array('CodeSet','OSLanguage'));
if ($buffer) {
- $this->_charset = 'windows-'.$buffer[0]['CodeSet'];
+ $this->_codepage = 'windows-'.$buffer[0]['CodeSet'];
$lang = "";
if (is_readable(APP_ROOT.'/data/languages.ini') && ($langdata = @parse_ini_file(APP_ROOT.'/data/languages.ini', true))){
if (isset($langdata['WINNT'][$buffer[0]['OSLanguage']])) {
@@ -100,7 +100,7 @@
if ($lang == ""){
$lang = 'Unknown';
}
- $this->_language = $lang.' ('.$buffer[0]['OSLanguage'].')';
+ $this->_syslang = $lang.' ('.$buffer[0]['OSLanguage'].')';
}
}
@@ -532,7 +532,7 @@
*/
function getEncoding()
{
- return $this->_charset;
+ return $this->_codepage;
}
/**
@@ -544,7 +544,7 @@
*/
function getLanguage()
{
- return $this->_language;
+ return $this->_syslang;
}
/**
Modified: branches/namiltd-ini/includes/xml/class.XML.inc.php
===================================================================
--- branches/namiltd-ini/includes/xml/class.XML.inc.php 2012-09-14 20:33:53 UTC (rev 698)
+++ branches/namiltd-ini/includes/xml/class.XML.inc.php 2012-09-15 11:57:13 UTC (rev 699)
@@ -131,10 +131,10 @@
$vitals->addAttribute('CPULoad', $this->_sys->getLoadPercent());
}
if ($this->_sysinfo->getLanguage() !== null) {
- $vitals->addAttribute('Language', $this->_sysinfo->getLanguage());
+ $vitals->addAttribute('SysLang', $this->_sysinfo->getLanguage());
}
if ($this->_sysinfo->getEncoding() !== null) {
- $vitals->addAttribute('Charmap', $this->_sysinfo->getEncoding());
+ $vitals->addAttribute('CodePage', $this->_sysinfo->getEncoding());
}
}
Modified: branches/namiltd-ini/js/phpSysInfo/phpsysinfo.js
===================================================================
--- branches/namiltd-ini/js/phpSysInfo/phpsysinfo.js 2012-09-14 20:33:53 UTC (rev 698)
+++ branches/namiltd-ini/js/phpSysInfo/phpsysinfo.js 2012-09-15 11:57:13 UTC (rev 699)
@@ -567,7 +567,7 @@
*/
function refreshVitals(xml) {
var hostname = "", ip = "", kernel = "", distro = "", icon = "", uptime = "", users = 0, loadavg = "";
- var language = "", charmap = "";
+ var syslang = "", codepage = "";
var lastboot = 0, timestamp = Number(new Date());
$("Vitals", xml).each(function getVitals(id) {
@@ -583,16 +583,16 @@
if ($(this).attr("CPULoad") !== undefined) {
loadavg = loadavg + "<br/>" + createBar(parseInt($(this).attr("CPULoad"), 10));
}
- if ($(this).attr("Language") !== undefined) {
- language = $(this).attr("Language");
- document.getElementById("s_language_tr").style.display='';
+ if ($(this).attr("SysLang") !== undefined) {
+ syslang = $(this).attr("SysLang");
+ document.getElementById("s_syslang_tr").style.display='';
}
- if ($(this).attr("Charmap") !== undefined) {
- charmap = $(this).attr("Charmap");
- if ($(this).attr("Language") !== undefined) {
- document.getElementById("s_charmap_tr1").style.display='';
+ if ($(this).attr("CodePage") !== undefined) {
+ codepage = $(this).attr("CodePage");
+ if ($(this).attr("SysLang") !== undefined) {
+ document.getElementById("s_codepage_tr1").style.display='';
} else {
- document.getElementById("s_charmap_tr2").style.display='';
+ document.getElementById("s_codepage_tr2").style.display='';
}
}
document.title = "System information: " + hostname + " (" + ip + ")";
@@ -606,9 +606,9 @@
$("#s_lastboot").html(lastboot.toGMTString()); //toGMTString() or toLocaleString()
$("#s_users").html(users);
$("#s_loadavg").html(loadavg);
- $("#s_language").html(language);
- $("#s_charmap_1").html(charmap);
- $("#s_charmap_2").html(charmap);
+ $("#s_syslang").html(syslang);
+ $("#s_codepage_1").html(codepage);
+ $("#s_codepage_2").html(codepage);
});
}
Modified: branches/namiltd-ini/language/ast.xml
===================================================================
--- branches/namiltd-ini/language/ast.xml 2012-09-14 20:33:53 UTC (rev 698)
+++ branches/namiltd-ini/language/ast.xml 2012-09-15 11:57:13 UTC (rev 699)
@@ -294,10 +294,10 @@
<expression id="096" name="bytes">
<exp>B</exp>
</expression>
- <expression id="097" name="language">
+ <expression id="097" name="syslang">
<exp>System Language</exp>
</expression>
- <expression id="098" name="charmap">
- <exp>Charmap</exp>
+ <expression id="098" name="codepage">
+ <exp>Code Page</exp>
</expression>
</tns:translation>
Modified: branches/namiltd-ini/language/bg.xml
===================================================================
--- branches/namiltd-ini/language/bg.xml 2012-09-14 20:33:53 UTC (rev 698)
+++ branches/namiltd-ini/language/bg.xml 2012-09-15 11:57:13 UTC (rev 699)
@@ -294,10 +294,10 @@
<expression id="096" name="bytes">
<exp>B</exp>
</expression>
- <expression id="097" name="language">
+ <expression id="097" name="syslang">
<exp>System Language</exp>
</expression>
- <expression id="098" name="charmap">
- <exp>Charmap</exp>
+ <expression id="098" name="codepage">
+ <exp>Code Page</exp>
</expression>
</tns:translation>
Modified: branches/namiltd-ini/language/cz.xml
===================================================================
--- branches/namiltd-ini/language/cz.xml 2012-09-14 20:33:53 UTC (rev 698)
+++ branches/namiltd-ini/language/cz.xml 2012-09-15 11:57:13 UTC (rev 699)
@@ -294,10 +294,10 @@
<expression id="096" name="bytes">
<exp>B</exp>
</expression>
- <expression id="097" name="language">
+ <expression id="097" name="syslang">
<exp>System Language</exp>
</expression>
- <expression id="098" name="charmap">
- <exp>Charmap</exp>
+ <expression id="098" name="codepage">
+ <exp>Code Page</exp>
</expression>
</tns:translation>
Modified: branches/namiltd-ini/language/da.xml
===================================================================
--- branches/namiltd-ini/language/da.xml 2012-09-14 20:33:53 UTC (rev 698)
+++ branches/namiltd-ini/language/da.xml 2012-09-15 11:57:13 UTC (rev 699)
@@ -294,10 +294,10 @@
<expression id="096" name="bytes">
<exp>B</exp>
</expression>
- <expression id="097" name="language">
+ <expression id="097" name="syslang">
<exp>System Language</exp>
</expression>
- <expression id="098" name="charmap">
- <exp>Charmap</exp>
+ <expression id="098" name="codepage">
+ <exp>Code Page</exp>
</expression>
</tns:translation>
Modified: branches/namiltd-ini/language/de.xml
===================================================================
--- branches/namiltd-ini/language/de.xml 2012-09-14 20:33:53 UTC (rev 698)
+++ branches/namiltd-ini/language/de.xml 2012-09-15 11:57:13 UTC (rev 699)
@@ -294,10 +294,10 @@
<expression id="096" name="bytes">
<exp>B</exp>
</expression>
- <expression id="097" name="language">
+ <expression id="097" name="syslang">
<exp>System Language</exp>
</expression>
- <expression id="098" name="charmap">
- <exp>Charmap</exp>
+ <expression id="098" name="codepage">
+ <exp>Code Page</exp>
</expression>
</tns:translation>
Modified: branches/namiltd-ini/language/en.xml
===================================================================
--- branches/namiltd-ini/language/en.xml 2012-09-14 20:33:53 UTC (rev 698)
+++ branches/namiltd-ini/language/en.xml 2012-09-15 11:57:13 UTC (rev 699)
@@ -294,10 +294,10 @@
<expression id="096" name="bytes">
<exp>B</exp>
</expression>
- <expression id="097" name="language">
+ <expression id="097" name="syslang">
<exp>System Language</exp>
</expression>
- <expression id="098" name="charmap">
- <exp>Charmap</exp>
+ <expression id="098" name="codepage">
+ <exp>Code Page</exp>
</expression>
</tns:translation>
Modified: branches/namiltd-ini/language/es.xml
===================================================================
--- branches/namiltd-ini/language/es.xml 2012-09-14 20:33:53 UTC (rev 698)
+++ branches/namiltd-ini/language/es.xml 2012-09-15 11:57:13 UTC (rev 699)
@@ -294,10 +294,10 @@
<expression id="096" name="bytes">
<exp>B</exp>
</expression>
- <expression id="097" name="language">
+ <expression id="097" name="syslang">
<exp>System Language</exp>
</expression>
- <expression id="098" name="charmap">
- <exp>Charmap</exp>
+ <expression id="098" name="codepage">
+ <exp>Code Page</exp>
</expression>
</tns:translation>
Modified: branches/namiltd-ini/language/et.xml
===================================================================
--- branches/namiltd-ini/language/et.xml 2012-09-14 20:33:53 UTC (rev 698)
+++ branches/namiltd-ini/language/et.xml 2012-09-15 11:57:13 UTC (rev 699)
@@ -294,10 +294,10 @@
<expression id="096" name="bytes">
<exp>B</exp>
</expression>
- <expression id="097" name="language">
+ <expression id="097" name="syslang">
<exp>System Language</exp>
</expression>
- <expression id="098" name="charmap">
- <exp>Charmap</exp>
+ <expression id="098" name="codepage">
+ <exp>Code Page</exp>
</expression>
</tns:translation>
Modified: branches/namiltd-ini/language/fi.xml
===================================================================
--- branches/namiltd-ini/language/fi.xml 2012-09-14 20:33:53 UTC (rev 698)
+++ branches/namiltd-ini/language/fi.xml 2012-09-15 11:57:13 UTC (rev 699)
@@ -294,10 +294,10 @@
<expression id="096" name="bytes">
<exp>B</exp>
</expression>
- <expression id="097" name="language">
+ <expression id="097" name="syslang">
<exp>System Language</exp>
</expression>
- <expression id="098" name="charmap">
- <exp>Charmap</exp>
+ <expression id="098" name="codepage">
+ <exp>Code Page</exp>
</expression>
</tns:translation>
Modified: branches/namiltd-ini/language/fr.xml
===================================================================
--- branches/namiltd-ini/language/fr.xml 2012-09-14 20:33:53 UTC (rev 698)
+++ branches/namiltd-ini/language/fr.xml 2012-09-15 11:57:13 UTC (rev 699)
@@ -294,10 +294,10 @@
<expression id="096" name="bytes">
<exp>B</exp>
</expression>
- <expression id="097" name="language">
+ <expression id="097" name="syslang">
<exp>System Language</exp>
</expression>
- <expression id="098" name="charmap">
- <exp>Charmap</exp>
+ <expression id="098" name="codepage">
+ <exp>Code Page</exp>
</expression>
</tns:translation>
Modified: branches/namiltd-ini/language/gl.xml
===================================================================
--- branches/namiltd-ini/language/gl.xml 2012-09-14 20:33:53 UTC (rev 698)
+++ branches/namiltd-ini/language/gl.xml 2012-09-15 11:57:13 UTC (rev 699)
@@ -294,10 +294,10 @@
<expression id="096" name="bytes">
<exp>B</exp>
</expression>
- <expression id="097" name="language">
+ <expression id="097" name="syslang">
<exp>System Language</exp>
</expression>
- <expression id="098" name="charmap">
- <exp>Charmap</exp>
+ <expression id="098" name="codepage">
+ <exp>Code Page</exp>
</expression>
</tns:translation>
Modified: branches/namiltd-ini/language/gr.xml
===================================================================
--- branches/namiltd-ini/language/gr.xml 2012-09-14 20:33:53 UTC (rev 698)
+++ branches/namiltd-ini/language/gr.xml 2012-09-15 11:57:13 UTC (rev 699)
@@ -294,10 +294,10 @@
<expression id="096" name="bytes">
<exp>B</exp>
</expression>
- <expression id="097" name="language">
+ <expression id="097" name="syslang">
<exp>System Language</exp>
</expression>
- <expression id="098" name="charmap">
- <exp>Charmap</exp>
+ <expression id="098" name="codepage">
+ <exp>Code Page</exp>
</expression>
</tns:translation>
Modified: branches/namiltd-ini/language/hu.xml
===================================================================
--- branches/namiltd-ini/language/hu.xml 2012-09-14 20:33:53 UTC (rev 698)
+++ branches/namiltd-ini/language/hu.xml 2012-09-15 11:57:13 UTC (rev 699)
@@ -294,10 +294,10 @@
<expression id="096" name="bytes">
<exp>B</exp>
</expression>
- <expression id="097" name="language">
+ <expression id="097" name="syslang">
<exp>System Language</exp>
</expression>
- <expression id="098" name="charmap">
- <exp>Charmap</exp>
+ <expression id="098" name="codepage">
+ <exp>Code Page</exp>
</expression>
</tns:translation>
Modified: branches/namiltd-ini/language/is.xml
===================================================================
--- branches/namiltd-ini/language/is.xml 2012-09-14 20:33:53 UTC (rev 698)
+++ branches/namiltd-ini/language/is.xml 2012-09-15 11:57:13 UTC (rev 699)
@@ -294,10 +294,10 @@
<expression id="096" name="bytes">
<exp>B</exp>
</expression>
- <expression id="097" name="language">
+ <expression id="097" name="syslang">
<exp>System Language</exp>
</expression>
- <expression id="098" name="charmap">
- <exp>Charmap</exp>
+ <expression id="098" name="codepage">
+ <exp>Code Page</exp>
</expression>
</tns:translation>
Modified: branches/namiltd-ini/language/it.xml
===================================================================
--- branches/namiltd-ini/language/it.xml 2012-09-14 20:33:53 UTC (rev 698)
+++ branches/namiltd-ini/language/it.xml 2012-09-15 11:57:13 UTC (rev 699)
@@ -294,10 +294,10 @@
<expression id="096" name="bytes">
<exp>B</exp>
</expression>
- <expression id="097" name="language">
+ <expression id="097" name="syslang">
<exp>System Language</exp>
</expression>
- <expression id="098" name="charmap">
- <exp>Charmap</exp>
+ <expression id="098" name="codepage">
+ <exp>Code Page</exp>
</expression>
</tns:translation>
Modified: branches/namiltd-ini/language/ja.xml
===================================================================
--- branches/namiltd-ini/language/ja.xml 2012-09-14 20:33:53 UTC (rev 698)
+++ branches/namiltd-ini/language/ja.xml 2012-09-15 11:57:13 UTC (rev 699)
@@ -294,10 +294,10 @@
<expression id="096" name="bytes">
<exp>B</exp>
</expression>
- <expression id="097" name="language">
+ <expression id="097" name="syslang">
<exp>System Language</exp>
</expression>
- <expression id="098" name="charmap">
- <exp>Charmap</exp>
+ <expression id="098" name="codepage">
+ <exp>Code Page</exp>
</expression>
</tns:translation>
Modified: branches/namiltd-ini/language/ko.xml
===================================================================
--- branches/namiltd-ini/language/ko.xml 2012-09-14 20:33:53 UTC (rev 698)
+++ branches/namiltd-ini/language/ko.xml 2012-09-15 11:57:13 UTC (rev 699)
@@ -294,10 +294,10 @@
<expression id="096" name="bytes">
<exp>B</exp>
</expression>
- <expression id="097" name="language">
+ <expression id="097" name="syslang">
<exp>System Language</exp>
</expression>
- <expression id="098" name="charmap">
- <exp>Charmap</exp>
+ <expression id="098" name="codepage">
+ <exp>Code Page</exp>
</expression>
</tns:translation>
Modified: branches/namiltd-ini/language/nl.xml
===================================================================
--- branches/namiltd-ini/language/nl.xml 2012-09-14 20:33:53 UTC (rev 698)
+++ branches/namiltd-ini/language/nl.xml 2012-09-15 11:57:13 UTC (rev 699)
@@ -294,10 +294,10 @@
<expression id="096" name="bytes">
<exp>B</exp>
</expression>
- <expression id="097" name="language">
+ <expression id="097" name="syslang">
<exp>System Language</exp>
</expression>
- <expression id="098" name="charmap">
- <exp>Charmap</exp>
+ <expression id="098" name="codepage">
+ <exp>Code Page</exp>
</expression>
</tns:translation>
Modified: branches/namiltd-ini/language/no.xml
===================================================================
--- branches/namiltd-ini/language/no.xml 2012-09-14 20:33:53 UTC (rev 698)
+++ branches/namiltd-ini/language/no.xml 2012-09-15 11:57:13 UTC (rev 699)
@@ -294,10 +294,10 @@
<expression id="096" name="bytes">
<exp>B</exp>
</expression>
- <expression id="097" name="language">
+ <expression id="097" name="syslang">
<exp>System Language</exp>
</expression>
- <expression id="098" name="charmap">
- <exp>Charmap</exp>
+ <expression id="098" name="codepage">
+ <exp>Code Page</exp>
</expression>
</tns:translation>
Modified: branches/namiltd-ini/language/pl.xml
===================================================================
--- branches/namiltd-ini/language/pl.xml 2012-09-14 20:33:53 UTC (rev 698)
+++ branches/namiltd-ini/language/pl.xml 2012-09-15 11:57:13 UTC (rev 699)
@@ -294,10 +294,10 @@
<expression id="096" name="bytes">
<exp>B</exp>
</expression>
- <expression id="097" name="language">
+ <expression id="097" name="syslang">
<exp>Język systemu</exp>
</expression>
- <expression id="098" name="charmap">
+ <expression id="098" name="codepage">
<exp>Strona kodowa</exp>
</expression>
</tns:translation>
Modified: branches/namiltd-ini/language/pt-br.xml
===================================================================
--- branches/namiltd-ini/language/pt-br.xml 2012-09-14 20:33:53 UTC (rev 698)
+++ branches/namiltd-ini/language/pt-br.xml 2012-09-15 11:57:13 UTC (rev 699)
@@ -295,10 +295,10 @@
<expression id="096" name="bytes">
<exp>B</exp>
</expression>
- <expression id="097" name="language">
+ <expression id="097" name="syslang">
<exp>System Language</exp>
</expression>
- <expression id="098" name="charmap">
- <exp>Charmap</exp>
+ <expression id="098" name="codepage">
+ <exp>Code Page</exp>
</expression>
</tns:translation>
Modified: branches/namiltd-ini/language/ro.xml
===================================================================
--- branches/namiltd-ini/language/ro.xml 2012-09-14 20:33:53 UTC (rev 698)
+++ branches/namiltd-ini/language/ro.xml 2012-09-15 11:57:13 UTC (rev 699)
@@ -294,10 +294,10 @@
<expression id="096" name="bytes">
<exp>B</exp>
</expression>
- <expression id="097" name="language">
+ <expression id="097" name="syslang">
<exp>System Language</exp>
</expression>
- <expression id="098" name="charmap">
- <exp>Charmap</exp>
+ <expression id="098" name="codepage">
+ <exp>Code Page</exp>
</expression>
</tns:translation>
Modified: branches/namiltd-ini/language/ru.xml
===================================================================
--- branches/namiltd-ini/language/ru.xml 2012-09-14 20:33:53 UTC (rev 698)
+++ branches/namiltd-ini/language/ru.xml 2012-09-15 11:57:13 UTC (rev 699)
@@ -295,10 +295,10 @@
<expression id="096" name="bytes">
<exp>B</exp>
</expression>
- <expression id="097" name="language">
+ <expression id="097" name="syslang">
<exp>System Language</exp>
</expression>
- <expression id="098" name="charmap">
- <exp>Charmap</exp>
+ <expression id="098" name="codepage">
+ <exp>Code Page</exp>
</expression>
</tns:translation>
Modified: branches/namiltd-ini/language/sc.xml
===================================================================
--- branches/namiltd-ini/language/sc.xml 2012-09-14 20:33:53 UTC (rev 698)
+++ branches/namiltd-ini/language/sc.xml 2012-09-15 11:57:13 UTC (rev 699)
@@ -295,10 +295,10 @@
<expression id="096" name="bytes">
<exp>B</exp>
</expression>
- <expression id="097" name="language">
+ <expression id="097" name="syslang">
<exp>System Language</exp>
</expression>
- <expression id="098" name="charmap">
- <exp>Charmap</exp>
+ <expression id="098" name="codepage">
+ <exp>Code Page</exp>
</expression>
</tns:translation>
Modified: branches/namiltd-ini/language/sk.xml
===================================================================
--- branches/namiltd-ini/language/sk.xml 2012-09-14 20:33:53 UTC (rev 698)
+++ branches/namiltd-ini/language/sk.xml 2012-09-15 11:57:13 UTC (rev 699)
@@ -295,10 +295,10 @@
<expression id="096" name="bytes">
<exp>B</exp>
</expression>
- <expression id="097" name="language">
+ <expression id="097" name="syslang">
<exp>System Language</exp>
</expression>
- <expression id="098" name="charmap">
- <exp>Charmap</exp>
+ <expression id="098" name="codepage">
+ <exp>Code Page</exp>
</expression>
</tns:translation>
Modified: branches/namiltd-ini/language/sl.xml
===================================================================
--- branches/namiltd-ini/language/sl.xml 2012-09-14 20:33:53 UTC (rev 698)
+++ branches/namiltd-ini/language/sl.xml 2012-09-15 11:57:13 UTC (rev 699)
@@ -294,10 +294,10 @@
<expression id="096" name="bytes">
<exp>B</exp>
</expression>
- <expression id="097" name="language">
+ <expression id="097" name="syslang">
<exp>System Language</exp>
</expression>
- <expression id="098" name="charmap">
- <exp>Charmap</exp>
+ <expression id="098" name="codepage">
+ <exp>Code Page</exp>
</expression>
</tns:translation>
Modified: branches/namiltd-ini/language/sv.xml
===================================================================
--- branches/namiltd-ini/language/sv.xml 2012-09-14 20:33:53 UTC (rev 698)
+++ branches/namiltd-ini/language/sv.xml 2012-09-15 11:57:13 UTC (rev 699)
@@ -294,10 +294,10 @@
<expression id="096" name="bytes">
<exp>B</exp>
</expression>
- <expression id="097" name="language">
+ <expression id="097" name="syslang">
<exp>System Language</exp>
</expression>
- <expression id="098" name="charmap">
- <exp>Charmap</exp>
+ <expression id="098" name="codepage">
+ <exp>Code Page</exp>
</expression>
</tns:translation>
Modified: branches/namiltd-ini/language/th.xml
===================================================================
--- branches/namiltd-ini/language/th.xml 2012-09-14 20:33:53 UTC (rev 698)
+++ branches/namiltd-ini/language/th.xml 2012-09-15 11:57:13 UTC (rev 699)
@@ -292,10 +292,10 @@
<expression id="096" name="bytes">
<exp>B</exp>
</expression>
- <expression id="097" name="language">
+ <expression id="097" name="syslang">
<exp>System Language</exp>
</expression>
- <expression id="098" name="charmap">
- <exp>Charmap</exp>
+ <expression id="098" name="codepage">
+ <exp>Code Page</exp>
</expression>
</tns:translation>
Modified: branches/namiltd-ini/language/tr.xml
===================================================================
--- branches/namiltd-ini/language/tr.xml 2012-09-14 20:33:53 UTC (rev 698)
+++ branches/namiltd-ini/language/tr.xml 2012-09-15 11:57:13 UTC (rev 699)
@@ -294,10 +294,10 @@
<expression id="096" name="bytes">
<exp>B</exp>
</expression>
- <expression id="097" name="language">
+ <expression id="097" name="syslang">
<exp>System Language</exp>
</expression>
- <expression id="098" name="charmap">
- <exp>Charmap</exp>
+ <expression id="098" name="codepage">
+ <exp>Code Page</exp>
</expression>
</tns:translation>
Modified: branches/namiltd-ini/language/tw.xml
===================================================================
--- branches/namiltd-ini/language/tw.xml 2012-09-14 20:33:53 UTC (rev 698)
+++ branches/namiltd-ini/language/tw.xml 2012-09-15 11:57:13 UTC (rev 699)
@@ -295,10 +295,10 @@
<expression id="096" name="bytes">
<exp>B</exp>
</expression>
- <expression id="097" name="language">
+ <expression id="097" name="syslang">
<exp>System Language</exp>
</expression>
- <expression id="098" name="charmap">
- <exp>Charmap</exp>
+ <expression id="098" name="codepage">
+ <exp>Code Page</exp>
</expression>
</tns:translation>
Modified: branches/namiltd-ini/language/uk.xml
===================================================================
--- branches/namiltd-ini/language/uk.xml 2012-09-14 20:33:53 UTC (rev 698)
+++ branches/namiltd-ini/language/uk.xml 2012-09-15 11:57:13 UTC (rev 699)
@@ -294,10 +294,10 @@
<expression id="096" name="bytes">
<exp>B</exp>
</expression>
- <expression id="097" name="language">
+ <expression id="097" name="syslang">
<exp>System Language</exp>
</expression>
- <expression id="098" name="charmap">
- <exp>Charmap</exp>
+ <expression id="098" name="codepage">
+ <exp>Code Page</exp>
</expression>
</tns:translation>
Modified: branches/namiltd-ini/phpsysinfo.xslt
===================================================================
--- branches/namiltd-ini/phpsysinfo.xslt 2012-09-14 20:33:53 UTC (rev 698)
+++ branches/namiltd-ini/phpsysinfo.xslt 2012-09-15 11:57:13 UTC (rev 699)
@@ -190,7 +190,7 @@
</td>
</tr>
<xsl:if
- test="count(@Language )>0">
+ test="count(@SysLang )>0">
<tr class="odd">
<td style="width:160px;">
<span>
@@ -199,21 +199,21 @@
</td>
<td>
<xsl:value-of
- select="@Language" />
+ select="@SysLang" />
</td>
</tr>
</xsl:if>
<xsl:if
- test="count(@Charmap )>0">
+ test="count(@CodePage )>0">
<tr class="odd">
<td style="width:160px;">
<span>
- <xsl:text>Charmap</xsl:text>
+ <xsl:text>Code Page</xsl:text>
</span>
</td>
<td>
<xsl:value-of
- select="@Charmap" />
+ select="@CodePage" />
</td>
</tr>
</xsl:if>
Modified: branches/namiltd-ini/phpsysinfo3.xsd
===================================================================
--- branches/namiltd-ini/phpsysinfo3.xsd 2012-09-14 20:33:53 UTC (rev 698)
+++ branches/namiltd-ini/phpsysinfo3.xsd 2012-09-15 11:57:13 UTC (rev 699)
@@ -30,8 +30,8 @@
<attribute name="Users" type="unsignedLong" use="required"></attribute>
<attribute name="LoadAvg" type="string" use="required"></attribute>
<attribute name="CPULoad" type="integer" use="optional"></attribute>
- <attribute name="Language" type="string" use="optional"></attribute>
- <attribute name="Charmap" type="string" use="optional"></attribute>
+ <attribute name="SysLang" type="string" use="optional"></attribute>
+ <attribute name="CodePage" type="string" use="optional"></attribute>
</complexType>
<complexType name="NetDevice">
Modified: branches/namiltd-ini/templates/html/index_dynamic.html
===================================================================
--- branches/namiltd-ini/templates/html/index_dynamic.html 2012-09-14 20:33:53 UTC (rev 698)
+++ branches/namiltd-ini/templates/html/index_dynamic.html 2012-09-15 11:57:13 UTC (rev 699)
@@ -117,17 +117,17 @@
<td style="width:160px;"><span id="lang_009">Load Averages</span></td>
<td><span id="s_loadavg"></span></td>
</tr>
- <tr style="display:none" id="s_language_tr">
+ <tr style="display:none" id="s_syslang_tr">
<td style="width:160px;"><span id="lang_097">System Language</span></td>
- <td><span id="s_language"></span></td>
+ <td><span id="s_syslang"></span></td>
</tr>
- <tr style="display:none" id="s_charmap_tr1">
- <td style="width:160px;"><span id="lang_098">Charmap</span></td>
- <td><span id="s_charmap_1"></span></td>
+ <tr style="display:none" id="s_codepage_tr1">
+ <td style="width:160px;"><span id="lang_098">Code Page</span></td>
+ <td><span id="s_codepage_1"></span></td>
</tr>
- <tr style="display:none" id="s_charmap_tr2">
- <td style="width:160px;"><span id="lang_098">Charmap</span></td>
- <td><span id="s_charmap_2"></span></td>
+ <tr style="display:none" id="s_codepage_tr2">
+ <td style="width:160px;"><span id="lang_098">Code Page</span></td>
+ <td><span id="s_codepage_2"></span></td>
</tr>
</table>
</div>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <na...@us...> - 2012-09-14 20:34:02
|
Revision: 698
http://phpsysinfo.svn.sourceforge.net/phpsysinfo/?rev=698&view=rev
Author: namiltd
Date: 2012-09-14 20:33:53 +0000 (Fri, 14 Sep 2012)
Log Message:
-----------
add Oracle Linux to detected distros
Modified Paths:
--------------
branches/namiltd-ini/ChangeLog
branches/namiltd-ini/data/distros.ini
branches/namiltd-ini/includes/os/class.Linux.inc.php
Added Paths:
-----------
branches/namiltd-ini/gfx/images/Oracle.png
Modified: branches/namiltd-ini/ChangeLog
===================================================================
--- branches/namiltd-ini/ChangeLog 2012-09-10 18:03:58 UTC (rev 697)
+++ branches/namiltd-ini/ChangeLog 2012-09-14 20:33:53 UTC (rev 698)
@@ -2,7 +2,7 @@
phpSysInfo 3.1.0
- - [ADD] Turbolinux to detected distros
+ - [ADD] Turbolinux and Oracle Linux to detected distros
- [ADD] Show System Language and Charmap on Linux and WINNT
- [ADD] Minor support of ReactOS
Modified: branches/namiltd-ini/data/distros.ini
===================================================================
--- branches/namiltd-ini/data/distros.ini 2012-09-10 18:03:58 UTC (rev 697)
+++ branches/namiltd-ini/data/distros.ini 2012-09-14 20:33:53 UTC (rev 698)
@@ -32,10 +32,6 @@
Image = "Fedora.png"
Files = "/etc/fedora-release"
-[RedHat]
-Image = "Redhat.png"
-Files = "/etc/redhat-release;/etc/redhat_version"
-
[Slackware]
Image = "Slackware.png"
Files = "/etc/slackware-release;/etc/slackware-version"
@@ -66,7 +62,7 @@
[Ubuntu]
Image = "Ubuntu.png"
-Files = "/etc/lsb-release"
+;Files = "/etc/lsb-release"
[PLD]
Image = "PLD.png"
@@ -74,16 +70,9 @@
[CentOS]
Image = "CentOS.png"
-Files = "/etc/redhat-release;/etc/redhat_version"
+Files = "/etc/centos-release"
+;detected Files = "/etc/redhat-release"
-[RedHatEnterpriseES]
-Image = "Redhat.png"
-Files = "/etc/redhat-release;/etc/redhat_version"
-
-[RedHatEnterpriseAS]
-Image = "Redhat.png"
-Files = "/etc/redhat-release;/etc/redhat_version"
-
[LFS]
Image = "lfs.png"
Files = "/etc/lfs-release;/etc/lfs_version"
@@ -94,7 +83,7 @@
[IYCC]
Image = "iycc.png"
-Files = "/etc/lsb-release"
+;Files = "/etc/lsb-release"
[Synology]
Name = "Synology"
@@ -105,33 +94,33 @@
Image = "Arch.png"
Name = "Arch Linux"
+[Scientific]
+Image = "Scientific.png"
+;detected Files = "/etc/redhat-release"
+
[Scientific Linux]
Image = "Scientific.png"
-Files = "/etc/redhat-release;/etc/redhat_version"
+;detected Files = "/etc/redhat-release"
[ScientificSL]
Image = "Scientific.png"
-Files = "/etc/redhat-release;/etc/redhat_version"
+;detected Files = "/etc/redhat-release"
[ScientificCERNSLC]
Image = "Scientific.png"
-Files = "/etc/redhat-release;/etc/redhat_version"
+;detected Files = "/etc/redhat-release"
[ScientificFermiLTS]
Image = "Scientific.png"
-Files = "/etc/redhat-release;/etc/redhat_version"
+;also Files = "/etc/t-release"
[ScientificSLF]
Image = "Scientific.png"
-Files = "/etc/redhat-release;/etc/redhat_version"
+;detected Files = "/etc/redhat-release"
-[Scientific]
-Image = "Scientific.png"
-Files = "/etc/redhat-release;/etc/redhat_version"
-
[LinuxMint]
Image = "Mint.png"
-Files = "/etc/lsb-release"
+;Files = "/etc/lsb-release"
[Mageia]
Image = "Mageia.png"
@@ -139,26 +128,56 @@
[Chakra]
Image = "Chakra.png"
-Files = "/etc/lsb-release"
+;Files = "/etc/lsb-release"
[Alpine]
Name = "Alpine"
Image = "Alpine.png"
Files = "/etc/alpine-release"
+[Puppy]
+Image = "Puppy.png"
+;Files = "/etc/DISTRO_SPECS"
+
[Lucid]
Name = "Lucid Puppy"
Image = "Puppy.png"
-Files = "/etc/DISTRO_SPECS"
+;Files = "/etc/DISTRO_SPECS"
[Slacko Puppy]
Image = "Puppy.png"
-Files = "/etc/DISTRO_SPECS"
+;Files = "/etc/DISTRO_SPECS"
[Wary Puppy]
Image = "Puppy.png"
-Files = "/etc/DISTRO_SPECS"
+;Files = "/etc/DISTRO_SPECS"
[Turbolinux]
Image = "Turbo.png"
Files = "/etc/turbolinux-release"
+
+[Oracle]
+Image = "Oracle.png"
+Files = "/etc/oracle-release"
+;detected Files = "/etc/redhat-release"
+
+[OracleServer]
+Image = "Oracle.png"
+Files = "/etc/oracle-release"
+;detected Files = "/etc/redhat-release"
+
+; at the end because some distros may also have the same files (like CentOS, Oracle, Scientific etc)
+[RedHat]
+Image = "Redhat.png"
+Files = "/etc/redhat_version"
+;detected Files = "/etc/redhat-release"
+
+[RedHatEnterpriseES]
+Image = "Redhat.png"
+Files = "/etc/redhat_version"
+;detected Files = "/etc/redhat-release"
+
+[RedHatEnterpriseAS]
+Image = "Redhat.png"
+Files = "/etc/redhat_version"
+;detected Files = "/etc/redhat-release"
Added: branches/namiltd-ini/gfx/images/Oracle.png
===================================================================
(Binary files differ)
Property changes on: branches/namiltd-ini/gfx/images/Oracle.png
___________________________________________________________________
Added: svn:mime-type
+ image/png
Modified: branches/namiltd-ini/includes/os/class.Linux.inc.php
===================================================================
--- branches/namiltd-ini/includes/os/class.Linux.inc.php 2012-09-10 18:03:58 UTC (rev 697)
+++ branches/namiltd-ini/includes/os/class.Linux.inc.php 2012-09-14 20:33:53 UTC (rev 698)
@@ -529,6 +529,7 @@
*/
private function _distro()
{
+ $this->sys->setDistribution("Linux");
$list = @parse_ini_file(APP_ROOT."/data/distros.ini", true);
if (!$list) {
return;
@@ -553,76 +554,123 @@
}
/* fatal errors only */
$old_err_rep = error_reporting();
- error_reporting(E_ERROR);
- // Fall back in case 'lsb_release' does not exist ;)
+ error_reporting(E_ERROR);
+
+ // Fall back in case 'lsb_release' does not exist and file 'lsb-release' and 'DISTRO_SPECS' does not exist
foreach ($list as $section=>$distribution) {
if (!isset($distribution["Files"])) {
continue;
} else {
foreach (preg_split("/;/", $distribution["Files"], -1, PREG_SPLIT_NO_EMPTY) as $filename) {
if (file_exists($filename)) {
- CommonFunctions::rfts($filename, $buf);
-
- // lsb-release file
- if (preg_match('/^DISTRIB_ID=(.*)/m', $buf, $id_buf)) {
- if (preg_match('/^DISTRIB_DESCRIPTION="(.*)"/m', $buf, $desc_buf)) {
- $this->sys->setDistribution(trim($desc_buf[1]));
+ if (!CommonFunctions::rfts($filename, $buf, 1, 4096, false)) {
+ $buf = "";
+ }
+ if (isset($distribution["Image"])) {
+ $this->sys->setDistributionIcon($distribution["Image"]);
+ }
+ if (isset($distribution["Name"])) {
+ if (($distribution["Name"] == 'Synology') || is_null($buf) || (trim($buf) == "")) {
+ $this->sys->setDistribution($distribution["Name"]);
} else {
- if (isset($list[trim($id_buf[1])]['Name'])) {
- $dist = trim($list[trim($id_buf[1])]['Name']);
- } else {
- $dist = trim($id_buf[1]);
- }
- if (preg_match('/^DISTRIB_RELEASE=(.*)/m', $buf, $vers_buf)) {
- $this->sys->setDistribution(trim($dist." ".trim($vers_buf[1])));
- } else {
- $this->sys->setDistribution($dist);
- }
+ $this->sys->setDistribution($distribution["Name"]." ".trim($buf));
}
- if (isset($list[trim($id_buf[1])]['Image'])) {
- $this->sys->setDistributionIcon($list[trim($id_buf[1])]['Image']);
- }
- // DISTRO_SPECS file
- } else if (preg_match('/^DISTRO_NAME=\'(.*)\'/m', $buf, $id_buf)) {
- if (isset($list[trim($id_buf[1])]['Name'])) {
- $dist = trim($list[trim($id_buf[1])]['Name']);
- } else {
- $dist = trim($id_buf[1]);
- }
- if (preg_match('/^DISTRO_VERSION=(.*)/m', $buf, $vers_buf)) {
- $this->sys->setDistribution(trim($dist." ".trim($vers_buf[1])));
- } else {
- $this->sys->setDistribution($dist);
- }
- if (isset($list[trim($id_buf[1])]['Image'])) {
- $this->sys->setDistributionIcon($list[trim($id_buf[1])]['Image']);
- }
} else {
- if (isset($distribution["Image"])) {
- $this->sys->setDistributionIcon($distribution["Image"]);
- }
- if (isset($distribution["Name"])) {
- if ($distribution["Name"] == 'Synology') {
- $this->sys->setDistribution($distribution["Name"]);
- } else {
- $this->sys->setDistribution($distribution["Name"]." ".trim($buf));
- }
+ if ( is_null($buf) || (trim($buf) == "") ) {
+ $this->sys->setDistribution($section);
} else {
$this->sys->setDistribution(trim($buf));
}
}
- return;
+ break 2;
}
}
}
}
+ // Otherwise, if no files found
+ if ($this->sys->getDistribution() == "Linux") {
+ if ( file_exists($filename="/etc/lsb-release")
+ && CommonFunctions::rfts($filename, $buf, 0, 4096, false)
+ && preg_match('/^DISTRIB_ID=(.*)/m', $buf, $id_buf) ) {
+ if (preg_match('/^DISTRIB_DESCRIPTION="(.*)"/m', $buf, $desc_buf)) {
+ $this->sys->setDistribution(trim($desc_buf[1]));
+ } else {
+ if (isset($list[trim($id_buf[1])]['Name'])) {
+ $dist = trim($list[trim($id_buf[1])]['Name']);
+ } else {
+ $dist = trim($id_buf[1]);
+ }
+ if (preg_match('/^DISTRIB_RELEASE=(.*)/m', $buf, $vers_buf)) {
+ $this->sys->setDistribution(trim($dist." ".trim($vers_buf[1])));
+ } else {
+ $this->sys->setDistribution($dist);
+ }
+ }
+ if (isset($list[trim($id_buf[1])]['Image'])) {
+ $this->sys->setDistributionIcon($list[trim($id_buf[1])]['Image']);
+ }
+ } else
+ if ( file_exists($filename="/etc/DISTRO_SPECS")
+ && CommonFunctions::rfts($filename, $buf, 0, 4096, false)
+ && preg_match('/^DISTRO_NAME=\'(.*)\'/m', $buf, $id_buf) ) {
+ if (isset($list[trim($id_buf[1])]['Name'])) {
+ $dist = trim($list[trim($id_buf[1])]['Name']);
+ } else {
+ $dist = trim($id_buf[1]);
+ }
+ if (preg_match('/^DISTRO_VERSION=(.*)/m', $buf, $vers_buf)) {
+ $this->sys->setDistribution(trim($dist." ".trim($vers_buf[1])));
+ } else {
+ $this->sys->setDistribution($dist);
+ }
+ if (isset($list[trim($id_buf[1])]['Image'])) {
+ $this->sys->setDistributionIcon($list[trim($id_buf[1])]['Image']);
+ } else {
+ if (isset($list['Puppy']["Image"])) {
+ $this->sys->setDistributionIcon($list['Puppy']["Image"]);
+ }
+ }
+ } else
+ if ( file_exists($filename="/etc/redhat-release")
+ && CommonFunctions::rfts($filename, $buf, 1, 4096, false) ){
+ if ( (is_null($buf)) || (trim($buf) == "") ) {
+ if (isset($list['RedHat']['Name'])) {
+ $this->sys->setDistribution(trim($list['RedHat']['Name']));
+ } else {
+ $this->sys->setDistribution('RedHat');
+ }
+ if (isset($list['RedHat']["Image"])) {
+ $this->sys->setDistributionIcon($list['RedHat']["Image"]);
+ }
+ } else {
+ $this->sys->setDistribution(trim($buf));
+ if ( preg_match('/^(\S+)\s*/', $buf, $id_buf)
+ && isset($list[trim($id_buf[1])]['Image'])) {
+ $this->sys->setDistributionIcon($list[trim($id_buf[1])]['Image']);
+ } else {
+ if (isset($list['RedHat']["Image"])) {
+ $this->sys->setDistributionIcon($list['RedHat']["Image"]);
+ }
+ }
+ }
+ }
+ }
+ /*if ($this->sys->getDistribution() == "Linux") {
+ if (file_exists($filename="/etc/issue")) {
+ if (CommonFunctions::rfts($filename, $buf, 1, 4096, false)
+ && (!is_null($buf))
+ && ($buf != "")) {
+ $this->sys->setDistribution($buf);
+ }
+ }
+
+ }*/
/* restore error level */
error_reporting($old_err_rep);
/* restore error handler */
if (function_exists('errorHandlerPsi')) {
set_error_handler('errorHandlerPsi');
}
-
}
}
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <na...@us...> - 2012-09-10 18:04:04
|
Revision: 697
http://phpsysinfo.svn.sourceforge.net/phpsysinfo/?rev=697&view=rev
Author: namiltd
Date: 2012-09-10 18:03:58 +0000 (Mon, 10 Sep 2012)
Log Message:
-----------
ReactOS minor support
Modified Paths:
--------------
branches/namiltd-ini/ChangeLog
branches/namiltd-ini/README
branches/namiltd-ini/includes/os/class.WINNT.inc.php
Modified: branches/namiltd-ini/ChangeLog
===================================================================
--- branches/namiltd-ini/ChangeLog 2012-09-09 11:24:04 UTC (rev 696)
+++ branches/namiltd-ini/ChangeLog 2012-09-10 18:03:58 UTC (rev 697)
@@ -4,6 +4,7 @@
- [ADD] Turbolinux to detected distros
- [ADD] Show System Language and Charmap on Linux and WINNT
+ - [ADD] Minor support of ReactOS
- [UPD] Configuration moved from config.php and subdirs of "plugins" to one file phpsysinfo.ini
- [UPD] Plugin ipmi ranamed to IPMIInfo and Update-Notifier to UpdateNotifier (to avoid name conflicts)
Modified: branches/namiltd-ini/README
===================================================================
--- branches/namiltd-ini/README 2012-09-09 11:24:04 UTC (rev 696)
+++ branches/namiltd-ini/README 2012-09-10 18:03:58 UTC (rev 697)
@@ -25,6 +25,7 @@
- Haiku
- Minix
- SunOS
+ - ReactOS
If your platform is not here try checking out the mailing list archives or
the message boards on SourceForge.
Modified: branches/namiltd-ini/includes/os/class.WINNT.inc.php
===================================================================
--- branches/namiltd-ini/includes/os/class.WINNT.inc.php 2012-09-09 11:24:04 UTC (rev 696)
+++ branches/namiltd-ini/includes/os/class.WINNT.inc.php 2012-09-10 18:03:58 UTC (rev 697)
@@ -180,7 +180,7 @@
private function _hostname()
{
if (PSI_USE_VHOST === true) {
- $this->sys->setHostname(getenv('SERVER_NAME'));
+ if ($hnm = getenv('SERVER_NAME')) $this->sys->setHostname($hnm);
} else {
$buffer = $this->_getWMI('Win32_ComputerSystem', array('Name'));
if ($buffer) {
@@ -189,6 +189,8 @@
if ($ip != $result) {
$this->sys->setHostname(gethostbyaddr($ip));
}
+ } else {
+ if ($hnm = getenv('COMPUTERNAME')) $this->sys->setHostname($hnm);
}
}
}
@@ -201,12 +203,16 @@
private function _ip()
{
if (PSI_USE_VHOST === true) {
- $this->sys->setIp(gethostbyname($this->sys->getHostname()));
+ if ( (($hnm=$this->sys->getHostname()) != 'localhost') &&
+ (($hip=gethostbyname($hnm)) != $hnm) ) $this->sys->setIp($hip);
} else {
$buffer = $this->_getWMI('Win32_ComputerSystem', array('Name'));
if ($buffer) {
$result = $buffer[0]['Name'];
$this->sys->setIp(gethostbyname($result));
+ } else {
+ if ( (($hnm=$this->sys->getHostname()) != 'localhost') &&
+ (($hip=gethostbyname($hnm)) != $hnm) ) $this->sys->setIp($hip);
}
}
}
@@ -284,12 +290,12 @@
else
$icon = 'WinXP.png';
$this->sys->setDistributionIcon($icon);
- } else if (CommonFunctions::executeProgram("cmd", "/c ver", $ver_value)) {
+ } else if (CommonFunctions::executeProgram("cmd", "/c ver 2>nul", $ver_value, false)) {
if (preg_match("/ReactOS\nVersion\s+(.+)/", $ver_value, $ar_temp)){
$this->sys->setDistribution("ReactOS");
$this->sys->setKernel($ar_temp[1]);
$this->sys->setDistributionIcon('ReactOS.png');
- }else if (preg_match("/^(Microsoft [^\[]*)\s*\[(.+)\]/", $ver_value, $ar_temp)){
+ } else if (preg_match("/^(Microsoft [^\[]*)\s*\[\D*\s*(.+)\]/", $ver_value, $ar_temp)){
$this->sys->setDistribution($ar_temp[1]);
$this->sys->setKernel($ar_temp[2]);
$this->sys->setDistributionIcon('Win2000.png');
@@ -494,6 +500,27 @@
}
$this->sys->setDiskDevices($dev);
}
+ if ((!$buffer) && ($this->sys->getDistribution()=="ReactOS")){
+ // test for command 'free' on current disk
+ if (CommonFunctions::executeProgram("cmd", "/c free 2>nul", $out_value, true)) {
+ for ($letter='A'; $letter!='AA'; $letter++) if (CommonFunctions::executeProgram("cmd", "/c free ".$letter.": 2>nul", $out_value, false)){
+ if (preg_match('/\n\s*([\d\.\,]+).*\n\s*([\d\.\,]+).*\n\s*([\d\.\,]+).*$/',$out_value, $out_dig )) {
+ $size = preg_replace('/(\.)|(\,)/', '', $out_dig[1]);
+ $used = preg_replace('/(\.)|(\,)/', '', $out_dig[2]);
+ $free = preg_replace('/(\.)|(\,)/', '', $out_dig[3]);
+ if ($used + $free == $size ) {
+ $dev = new DiskDevice();
+ $dev->setMountPoint($letter.":");
+ $dev->setFsType('Unknown');
+ $dev->setTotal($size);
+ $dev->setFree($free);
+ $dev->setUsed($used);
+ $this->sys->setDiskDevices($dev);
+ }
+ }
+ }
+ }
+ }
}
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <na...@us...> - 2012-09-09 11:24:10
|
Revision: 696
http://phpsysinfo.svn.sourceforge.net/phpsysinfo/?rev=696&view=rev
Author: namiltd
Date: 2012-09-09 11:24:04 +0000 (Sun, 09 Sep 2012)
Log Message:
-----------
clean up
Modified Paths:
--------------
branches/namiltd-ini/includes/os/class.FreeBSD.inc.php
Modified: branches/namiltd-ini/includes/os/class.FreeBSD.inc.php
===================================================================
--- branches/namiltd-ini/includes/os/class.FreeBSD.inc.php 2012-09-09 11:18:57 UTC (rev 695)
+++ branches/namiltd-ini/includes/os/class.FreeBSD.inc.php 2012-09-09 11:24:04 UTC (rev 696)
@@ -96,8 +96,9 @@
$dev->setDrops($ar_buf[11]);
}
if (defined('PSI_SHOW_NETWORK_INFOS') && (PSI_SHOW_NETWORK_INFOS)) {
- $dev->setInfo(preg_replace('/:/', '-', $ar_buf[3])); }
+ $dev->setInfo(preg_replace('/:/', '-', $ar_buf[3]));
}
+ }
}
else if (!is_null($dev)) {
if ($dev->getName() == $ar_buf[0]) { /* other infos */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <na...@us...> - 2012-09-09 11:19:03
|
Revision: 695
http://phpsysinfo.svn.sourceforge.net/phpsysinfo/?rev=695&view=rev
Author: namiltd
Date: 2012-09-09 11:18:57 +0000 (Sun, 09 Sep 2012)
Log Message:
-----------
clean up
Modified Paths:
--------------
branches/namiltd-ini/includes/os/class.FreeBSD.inc.php
Removed Paths:
-------------
branches/namiltd/gfx/unsupported_yet/ReactOS.png
Deleted: branches/namiltd/gfx/unsupported_yet/ReactOS.png
===================================================================
(Binary files differ)
Modified: branches/namiltd-ini/includes/os/class.FreeBSD.inc.php
===================================================================
--- branches/namiltd-ini/includes/os/class.FreeBSD.inc.php 2012-09-09 09:28:32 UTC (rev 694)
+++ branches/namiltd-ini/includes/os/class.FreeBSD.inc.php 2012-09-09 11:18:57 UTC (rev 695)
@@ -95,12 +95,15 @@
$dev->setErrors($ar_buf[5] + $ar_buf[8]);
$dev->setDrops($ar_buf[11]);
}
- $dev->setInfo(preg_replace('/:/', '-', $ar_buf[3])); }
+ if (defined('PSI_SHOW_NETWORK_INFOS') && (PSI_SHOW_NETWORK_INFOS)) {
+ $dev->setInfo(preg_replace('/:/', '-', $ar_buf[3])); }
+ }
}
else if (!is_null($dev)) {
if ($dev->getName() == $ar_buf[0]) { /* other infos */
- if (!preg_match('/^fe80::/i',$ar_buf[3]))
+ if (defined('PSI_SHOW_NETWORK_INFOS') && (PSI_SHOW_NETWORK_INFOS) && (!preg_match('/^fe80::/i',$ar_buf[3]))) {
$dev->setInfo(($dev->getInfo()?$dev->getInfo().';':'').$ar_buf[3]);
+ }
}
else { /* something wrong */
$this->sys->setNetDevices($dev);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <na...@us...> - 2012-09-09 09:28:38
|
Revision: 694
http://phpsysinfo.svn.sourceforge.net/phpsysinfo/?rev=694&view=rev
Author: namiltd
Date: 2012-09-09 09:28:32 +0000 (Sun, 09 Sep 2012)
Log Message:
-----------
show P-t-P address
Modified Paths:
--------------
branches/namiltd-ini/includes/os/class.Linux.inc.php
Modified: branches/namiltd-ini/includes/os/class.Linux.inc.php
===================================================================
--- branches/namiltd-ini/includes/os/class.Linux.inc.php 2012-09-09 00:20:11 UTC (rev 693)
+++ branches/namiltd-ini/includes/os/class.Linux.inc.php 2012-09-09 09:28:32 UTC (rev 694)
@@ -262,7 +262,7 @@
}
}
// sparc64 specific code ends
-
+
// XScale detection code
if ($dev->getModel() === "") {
foreach ($details as $detail) {
@@ -451,10 +451,17 @@
foreach ($bufe2 as $buf2) {
if (preg_match('/\s+encap:Ethernet\s+HWaddr\s(\S*)/i', $buf2, $ar_buf2))
$dev->setInfo(preg_replace('/:/', '-', $ar_buf2[1]));
+ else if (preg_match('/^\s+inet\saddr:(\S*)\s+P-t-P:(\S*)/i', $buf2, $ar_buf2)) {
+ if ($ar_buf2[1] != $ar_buf2[2]) {
+ $dev->setInfo(($dev->getInfo()?$dev->getInfo().';':'').$ar_buf2[1].";:".$ar_buf2[2]);
+ } else {
+ $dev->setInfo(($dev->getInfo()?$dev->getInfo().';':'').$ar_buf2[1]);
+ }
+ }
else if (preg_match('/^\s+inet\saddr:(\S*)/i', $buf2, $ar_buf2))
- $dev->setInfo(($dev->getInfo()?$dev->getInfo().';':'').$ar_buf2[1]);
- else if (preg_match('/^\s+inet6\saddr:\s([^\/]*)(.*)\s+Scope:[GH]/i', $buf2, $ar_buf2))
- $dev->setInfo(($dev->getInfo()?$dev->getInfo().';':'').$ar_buf2[1]);
+ $dev->setInfo(($dev->getInfo()?$dev->getInfo().';':'').$ar_buf2[1]);
+ else if (preg_match('/^\s+inet6\saddr:\s([^\/]*)(.*)\s+Scope:[GH]/i', $buf2, $ar_buf2))
+ $dev->setInfo(($dev->getInfo()?$dev->getInfo().';':'').$ar_buf2[1]);
}
}
$this->sys->setNetDevices($dev);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <na...@us...> - 2012-09-09 00:20:18
|
Revision: 693
http://phpsysinfo.svn.sourceforge.net/phpsysinfo/?rev=693&view=rev
Author: namiltd
Date: 2012-09-09 00:20:11 +0000 (Sun, 09 Sep 2012)
Log Message:
-----------
ReactOS detection
Modified Paths:
--------------
branches/namiltd-ini/includes/class.CommonFunctions.inc.php
branches/namiltd-ini/includes/os/class.WINNT.inc.php
Added Paths:
-----------
branches/namiltd-ini/gfx/images/ReactOS.png
Added: branches/namiltd-ini/gfx/images/ReactOS.png
===================================================================
(Binary files differ)
Property changes on: branches/namiltd-ini/gfx/images/ReactOS.png
___________________________________________________________________
Added: svn:mime-type
+ image/png
Modified: branches/namiltd-ini/includes/class.CommonFunctions.inc.php
===================================================================
--- branches/namiltd-ini/includes/class.CommonFunctions.inc.php 2012-09-08 17:12:08 UTC (rev 692)
+++ branches/namiltd-ini/includes/class.CommonFunctions.inc.php 2012-09-09 00:20:11 UTC (rev 693)
@@ -63,7 +63,11 @@
if ((isset($open_basedir) && !in_array($strPath, $open_basedir)) || !is_dir($strPath)) {
continue;
}
- $strProgrammpath = $strPath."/".$strProgram;
+ if (PHP_OS == 'WINNT') {
+ $strProgrammpath = rtrim($strPath,'\\').'\\'.$strProgram;
+ } else {
+ $strProgrammpath = rtrim($strPath,"/")."/".$strProgram;
+ }
if (is_executable($strProgrammpath)) {
return $strProgrammpath;
}
Modified: branches/namiltd-ini/includes/os/class.WINNT.inc.php
===================================================================
--- branches/namiltd-ini/includes/os/class.WINNT.inc.php 2012-09-08 17:12:08 UTC (rev 692)
+++ branches/namiltd-ini/includes/os/class.WINNT.inc.php 2012-09-09 00:20:11 UTC (rev 693)
@@ -266,13 +266,14 @@
*/
private function _distro()
{
- $buffer = $this->_getWMI('Win32_OperatingSystem', array('Version', 'ServicePackMajorVersion'));
+ $buffer = $this->_getWMI('Win32_OperatingSystem', array('Version', 'ServicePackMajorVersion', 'Caption'));
if ($buffer) {
$kernel = $buffer[0]['Version'];
if ($buffer[0]['ServicePackMajorVersion'] > 0) {
$kernel .= ' SP'.$buffer[0]['ServicePackMajorVersion'];
}
$this->sys->setKernel($kernel);
+ $this->sys->setDistribution($buffer[0]['Caption']);
if ((($kernel[1] == ".") && ($kernel[0] <5)) || (substr($kernel,0,4) == "5.0."))
$icon = 'Win2000.png';
@@ -283,16 +284,23 @@
else
$icon = 'WinXP.png';
$this->sys->setDistributionIcon($icon);
+ } else if (CommonFunctions::executeProgram("cmd", "/c ver", $ver_value)) {
+ if (preg_match("/ReactOS\nVersion\s+(.+)/", $ver_value, $ar_temp)){
+ $this->sys->setDistribution("ReactOS");
+ $this->sys->setKernel($ar_temp[1]);
+ $this->sys->setDistributionIcon('ReactOS.png');
+ }else if (preg_match("/^(Microsoft [^\[]*)\s*\[(.+)\]/", $ver_value, $ar_temp)){
+ $this->sys->setDistribution($ar_temp[1]);
+ $this->sys->setKernel($ar_temp[2]);
+ $this->sys->setDistributionIcon('Win2000.png');
+ } else {
+ $this->sys->setDistribution("WinNT");
+ $this->sys->setDistributionIcon('Win2000.png');
+ }
} else {
+ $this->sys->setDistribution("WinNT");
$this->sys->setDistributionIcon('Win2000.png');
- }
-
- $buffer = $this->_getWMI('Win32_OperatingSystem', array('Caption'));
- if ($buffer) {
- $this->sys->setDistribution($buffer[0]['Caption']);
- } else {
- $this->sys->setDistribution("WinNT");
- }
+ }
}
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <na...@us...> - 2012-09-08 17:12:14
|
Revision: 692
http://phpsysinfo.svn.sourceforge.net/phpsysinfo/?rev=692&view=rev
Author: namiltd
Date: 2012-09-08 17:12:08 +0000 (Sat, 08 Sep 2012)
Log Message:
-----------
Windows WMI exceptions
Modified Paths:
--------------
branches/namiltd-ini/includes/os/class.WINNT.inc.php
branches/namiltd-ini/plugins/ps/class.ps.inc.php
branches/namiltd-ini/plugins/psstatus/class.psstatus.inc.php
Modified: branches/namiltd-ini/includes/os/class.WINNT.inc.php
===================================================================
--- branches/namiltd-ini/includes/os/class.WINNT.inc.php 2012-09-08 16:34:21 UTC (rev 691)
+++ branches/namiltd-ini/includes/os/class.WINNT.inc.php 2012-09-08 17:12:08 UTC (rev 692)
@@ -32,7 +32,7 @@
*
* @var Object
*/
- private $_wmi;
+ private $_wmi = null;
/**
* holds all devices, which are in the system
@@ -65,9 +65,9 @@
$strHostname = '';
$strUser = '';
$strPassword = '';
- // initialize the wmi object
- $objLocator = new COM('WbemScripting.SWbemLocator');
try {
+ // initialize the wmi object
+ $objLocator = new COM('WbemScripting.SWbemLocator');
if ($strHostname == "") {
$this->_wmi = $objLocator->ConnectServer();
@@ -76,7 +76,7 @@
}
}
catch(Exception $e) {
- $this->error->addError("WMI connect error", "PhpSysInfo can not connect to the WMI interface for security reasons.\nCheck an authentication mechanism for the directory where phpSysInfo is installed in the IIS admin interface.");
+ $this->error->addError("WMI connect error", "PhpSysInfo can not connect to the WMI interface for security reasons.\nCheck an authentication mechanism for the directory where phpSysInfo is installed.");
}
$this->_getCodeSet();
}
Modified: branches/namiltd-ini/plugins/ps/class.ps.inc.php
===================================================================
--- branches/namiltd-ini/plugins/ps/class.ps.inc.php 2012-09-08 16:34:21 UTC (rev 691)
+++ branches/namiltd-ini/plugins/ps/class.ps.inc.php 2012-09-08 17:12:08 UTC (rev 692)
@@ -51,8 +51,8 @@
switch (strtolower(PSI_PLUGIN_PS_ACCESS)) {
case 'command':
if (PHP_OS == 'WINNT') {
- $objLocator = new COM("WbemScripting.SWbemLocator");
try {
+ $objLocator = new COM("WbemScripting.SWbemLocator");
$wmi = $objLocator->ConnectServer();
$os_wmi = $wmi->InstancesOf('Win32_OperatingSystem');
foreach ($os_wmi as $os) {
Modified: branches/namiltd-ini/plugins/psstatus/class.psstatus.inc.php
===================================================================
--- branches/namiltd-ini/plugins/psstatus/class.psstatus.inc.php 2012-09-08 16:34:21 UTC (rev 691)
+++ branches/namiltd-ini/plugins/psstatus/class.psstatus.inc.php 2012-09-08 17:12:08 UTC (rev 692)
@@ -54,8 +54,8 @@
switch (strtolower(PSI_PLUGIN_PSSTATUS_ACCESS)) {
case 'command':
if (PHP_OS == 'WINNT') {
- $objLocator = new COM("WbemScripting.SWbemLocator");
try {
+ $objLocator = new COM("WbemScripting.SWbemLocator");
$wmi = $objLocator->ConnectServer();
$process_wmi = $wmi->InstancesOf('Win32_Process');
foreach ($process_wmi as $process) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <na...@us...> - 2012-09-08 16:34:27
|
Revision: 691
http://phpsysinfo.svn.sourceforge.net/phpsysinfo/?rev=691&view=rev
Author: namiltd
Date: 2012-09-08 16:34:21 +0000 (Sat, 08 Sep 2012)
Log Message:
-----------
Windows WMI exceptions of plugins
Modified Paths:
--------------
branches/namiltd-ini/plugins/ps/class.ps.inc.php
branches/namiltd-ini/plugins/psstatus/class.psstatus.inc.php
Modified: branches/namiltd-ini/plugins/ps/class.ps.inc.php
===================================================================
--- branches/namiltd-ini/plugins/ps/class.ps.inc.php 2012-09-08 14:32:10 UTC (rev 690)
+++ branches/namiltd-ini/plugins/ps/class.ps.inc.php 2012-09-08 16:34:21 UTC (rev 691)
@@ -52,31 +52,35 @@
case 'command':
if (PHP_OS == 'WINNT') {
$objLocator = new COM("WbemScripting.SWbemLocator");
- $wmi = $objLocator->ConnectServer();
- $os_wmi = $wmi->InstancesOf('Win32_OperatingSystem');
- foreach ($os_wmi as $os) {
- $memtotal = $os->TotalVisibleMemorySize * 1024;
- }
- $process_wmi = $wmi->InstancesOf('Win32_Process');
- foreach ($process_wmi as $process) {
- if (strlen(trim($process->CommandLine)) > 0) {
- $ps = trim($process->CommandLine);
- } else {
- $ps = trim($process->Caption);
+ try {
+ $wmi = $objLocator->ConnectServer();
+ $os_wmi = $wmi->InstancesOf('Win32_OperatingSystem');
+ foreach ($os_wmi as $os) {
+ $memtotal = $os->TotalVisibleMemorySize * 1024;
}
- if (trim($process->ProcessId) != 0) {
- $memusage = round(trim($process->WorkingSetSize) * 100 / $memtotal, 1);
- //ParentProcessId
- //Unique identifier of the process that creates a process. Process identifier numbers are reused, so they
- //only identify a process for the lifetime of that process. It is possible that the process identified by
- //ParentProcessId is terminated, so ParentProcessId may not refer to a running process. It is also
- //possible that ParentProcessId incorrectly refers to a process that reuses a process identifier. You can
- //use the CreationDate property to determine whether the specified parent was created after the process
- //represented by this Win32_Process instance was created.
- //=> subtrees of processes may be missing (WHAT TODO?!?)
- $this->_filecontent[] = trim($process->ProcessId)." ".trim($process->ParentProcessId)." ".$memusage." ".$ps;
+ $process_wmi = $wmi->InstancesOf('Win32_Process');
+ foreach ($process_wmi as $process) {
+ if (strlen(trim($process->CommandLine)) > 0) {
+ $ps = trim($process->CommandLine);
+ } else {
+ $ps = trim($process->Caption);
+ }
+ if (trim($process->ProcessId) != 0) {
+ $memusage = round(trim($process->WorkingSetSize) * 100 / $memtotal, 1);
+ //ParentProcessId
+ //Unique identifier of the process that creates a process. Process identifier numbers are reused, so they
+ //only identify a process for the lifetime of that process. It is possible that the process identified by
+ //ParentProcessId is terminated, so ParentProcessId may not refer to a running process. It is also
+ //possible that ParentProcessId incorrectly refers to a process that reuses a process identifier. You can
+ //use the CreationDate property to determine whether the specified parent was created after the process
+ //represented by this Win32_Process instance was created.
+ //=> subtrees of processes may be missing (WHAT TODO?!?)
+ $this->_filecontent[] = trim($process->ProcessId)." ".trim($process->ParentProcessId)." ".$memusage." ".$ps;
+ }
}
}
+ catch(Exception $e) {
+ }
} else {
CommonFunctions::executeProgram("ps", "axo pid,ppid,pmem,args", $buffer, PSI_DEBUG);
}
@@ -130,8 +134,10 @@
*/
public function xml()
{
- $positions = array(0=>0);
- $xml = $this->_addchild($this->_result['childs'], $this->xml, $positions);
+ if ($this->_result){
+ $positions = array(0=>0);
+ $xml = $this->_addchild($this->_result['childs'], $this->xml, $positions);
+ }
return $this->xml->getSimpleXmlElement();
}
/**
Modified: branches/namiltd-ini/plugins/psstatus/class.psstatus.inc.php
===================================================================
--- branches/namiltd-ini/plugins/psstatus/class.psstatus.inc.php 2012-09-08 14:32:10 UTC (rev 690)
+++ branches/namiltd-ini/plugins/psstatus/class.psstatus.inc.php 2012-09-08 16:34:21 UTC (rev 691)
@@ -55,11 +55,15 @@
case 'command':
if (PHP_OS == 'WINNT') {
$objLocator = new COM("WbemScripting.SWbemLocator");
- $wmi = $objLocator->ConnectServer();
- $process_wmi = $wmi->InstancesOf('Win32_Process');
- foreach ($process_wmi as $process) {
- $this->_filecontent[] = array(trim($process->Caption), trim($process->ProcessId));
+ try {
+ $wmi = $objLocator->ConnectServer();
+ $process_wmi = $wmi->InstancesOf('Win32_Process');
+ foreach ($process_wmi as $process) {
+ $this->_filecontent[] = array(trim($process->Caption), trim($process->ProcessId));
+ }
}
+ catch(Exception $e) {
+ }
} else {
if ( defined('PSI_PLUGIN_PSSTATUS_PROCESSES') && is_string(PSI_PLUGIN_PSSTATUS_PROCESSES) ) {
if (preg_match(ARRAY_EXP, PSI_PLUGIN_PSSTATUS_PROCESSES)) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <na...@us...> - 2012-09-08 14:32:17
|
Revision: 690
http://phpsysinfo.svn.sourceforge.net/phpsysinfo/?rev=690&view=rev
Author: namiltd
Date: 2012-09-08 14:32:10 +0000 (Sat, 08 Sep 2012)
Log Message:
-----------
Windows WMI exceptions
Modified Paths:
--------------
branches/namiltd-ini/includes/os/class.WINNT.inc.php
Modified: branches/namiltd-ini/includes/os/class.WINNT.inc.php
===================================================================
--- branches/namiltd-ini/includes/os/class.WINNT.inc.php 2012-09-07 11:27:48 UTC (rev 689)
+++ branches/namiltd-ini/includes/os/class.WINNT.inc.php 2012-09-08 14:32:10 UTC (rev 690)
@@ -46,14 +46,14 @@
*
* @var string
*/
- private $_charset = "";
+ private $_charset = null;
/**
* store language of the system
*
* @var string
*/
- private $_language = "";
+ private $_language = null;
/**
* build the global Error object and create the WMI connection
@@ -64,15 +64,20 @@
// don't set this params for local connection, it will not work
$strHostname = '';
$strUser = '';
- $strPassword = '';
-
+ $strPassword = '';
// initialize the wmi object
$objLocator = new COM('WbemScripting.SWbemLocator');
- if ($strHostname == "") {
- $this->_wmi = $objLocator->ConnectServer();
- } else {
- $this->_wmi = $objLocator->ConnectServer($strHostname, 'rootcimv2', $strHostname.'\\'.$strUser, $strPassword);
+ try {
+ if ($strHostname == "") {
+ $this->_wmi = $objLocator->ConnectServer();
+
+ } else {
+ $this->_wmi = $objLocator->ConnectServer($strHostname, 'rootcimv2', $strHostname.'\\'.$strUser, $strPassword);
+ }
}
+ catch(Exception $e) {
+ $this->error->addError("WMI connect error", "PhpSysInfo can not connect to the WMI interface for security reasons.\nCheck an authentication mechanism for the directory where phpSysInfo is installed in the IIS admin interface.");
+ }
$this->_getCodeSet();
}
@@ -84,17 +89,19 @@
private function _getCodeSet()
{
$buffer = $this->_getWMI('Win32_OperatingSystem', array('CodeSet','OSLanguage'));
- $this->_charset = 'windows-'.$buffer[0]['CodeSet'];
- $lang = "";
- if (is_readable(APP_ROOT.'/data/languages.ini') && ($langdata = @parse_ini_file(APP_ROOT.'/data/languages.ini', true))){
- if (isset($langdata['WINNT'][$buffer[0]['OSLanguage']])) {
- $lang = $langdata['WINNT'][$buffer[0]['OSLanguage']];
+ if ($buffer) {
+ $this->_charset = 'windows-'.$buffer[0]['CodeSet'];
+ $lang = "";
+ if (is_readable(APP_ROOT.'/data/languages.ini') && ($langdata = @parse_ini_file(APP_ROOT.'/data/languages.ini', true))){
+ if (isset($langdata['WINNT'][$buffer[0]['OSLanguage']])) {
+ $lang = $langdata['WINNT'][$buffer[0]['OSLanguage']];
+ }
}
+ if ($lang == ""){
+ $lang = 'Unknown';
+ }
+ $this->_language = $lang.' ('.$buffer[0]['OSLanguage'].')';
}
- if ($lang == ""){
- $lang = 'Unknown';
- }
- $this->_language = $lang.' ('.$buffer[0]['OSLanguage'].')';
}
/**
@@ -109,34 +116,36 @@
private function _getWMI($strClass, $strValue = array())
{
$arrData = array();
- $value = "";
- try {
- $objWEBM = $this->_wmi->Get($strClass);
- $arrProp = $objWEBM->Properties_;
- $arrWEBMCol = $objWEBM->Instances_();
- foreach ($arrWEBMCol as $objItem) {
- if (is_array($arrProp)) {
- reset($arrProp);
- }
- $arrInstance = array();
- foreach ($arrProp as $propItem) {
- eval("\$value = \$objItem->".$propItem->Name.";");
- if ( empty($strValue)) {
- if (is_string($value)) $arrInstance[$propItem->Name] = trim($value);
- else $arrInstance[$propItem->Name] = $value;
- } else {
- if (in_array($propItem->Name, $strValue)) {
+ if ($this->_wmi) {
+ $value = "";
+ try {
+ $objWEBM = $this->_wmi->Get($strClass);
+ $arrProp = $objWEBM->Properties_;
+ $arrWEBMCol = $objWEBM->Instances_();
+ foreach ($arrWEBMCol as $objItem) {
+ if (is_array($arrProp)) {
+ reset($arrProp);
+ }
+ $arrInstance = array();
+ foreach ($arrProp as $propItem) {
+ eval("\$value = \$objItem->".$propItem->Name.";");
+ if ( empty($strValue)) {
if (is_string($value)) $arrInstance[$propItem->Name] = trim($value);
else $arrInstance[$propItem->Name] = $value;
+ } else {
+ if (in_array($propItem->Name, $strValue)) {
+ if (is_string($value)) $arrInstance[$propItem->Name] = trim($value);
+ else $arrInstance[$propItem->Name] = $value;
+ }
}
}
+ $arrData[] = $arrInstance;
}
- $arrData[] = $arrInstance;
}
- }
- catch(Exception $e) {
- if (PSI_DEBUG) {
- $this->error->addError($e->getCode(), $e->getMessage());
+ catch(Exception $e) {
+ if (PSI_DEBUG) {
+ $this->error->addError($e->getCode(), $e->getMessage());
+ }
}
}
return $arrData;
@@ -174,10 +183,12 @@
$this->sys->setHostname(getenv('SERVER_NAME'));
} else {
$buffer = $this->_getWMI('Win32_ComputerSystem', array('Name'));
- $result = $buffer[0]['Name'];
- $ip = gethostbyname($result);
- if ($ip != $result) {
- $this->sys->setHostname(gethostbyaddr($ip));
+ if ($buffer) {
+ $result = $buffer[0]['Name'];
+ $ip = gethostbyname($result);
+ if ($ip != $result) {
+ $this->sys->setHostname(gethostbyaddr($ip));
+ }
}
}
}
@@ -193,8 +204,10 @@
$this->sys->setIp(gethostbyname($this->sys->getHostname()));
} else {
$buffer = $this->_getWMI('Win32_ComputerSystem', array('Name'));
- $result = $buffer[0]['Name'];
- $this->sys->setIp(gethostbyname($result));
+ if ($buffer) {
+ $result = $buffer[0]['Name'];
+ $this->sys->setIp(gethostbyname($result));
+ }
}
}
@@ -209,22 +222,24 @@
$result = 0;
date_default_timezone_set('UTC');
$buffer = $this->_getWMI('Win32_OperatingSystem', array('LastBootUpTime', 'LocalDateTime'));
- $byear = intval(substr($buffer[0]['LastBootUpTime'], 0, 4));
- $bmonth = intval(substr($buffer[0]['LastBootUpTime'], 4, 2));
- $bday = intval(substr($buffer[0]['LastBootUpTime'], 6, 2));
- $bhour = intval(substr($buffer[0]['LastBootUpTime'], 8, 2));
- $bminute = intval(substr($buffer[0]['LastBootUpTime'], 10, 2));
- $bseconds = intval(substr($buffer[0]['LastBootUpTime'], 12, 2));
- $lyear = intval(substr($buffer[0]['LocalDateTime'], 0, 4));
- $lmonth = intval(substr($buffer[0]['LocalDateTime'], 4, 2));
- $lday = intval(substr($buffer[0]['LocalDateTime'], 6, 2));
- $lhour = intval(substr($buffer[0]['LocalDateTime'], 8, 2));
- $lminute = intval(substr($buffer[0]['LocalDateTime'], 10, 2));
- $lseconds = intval(substr($buffer[0]['LocalDateTime'], 12, 2));
- $boottime = mktime($bhour, $bminute, $bseconds, $bmonth, $bday, $byear);
- $localtime = mktime($lhour, $lminute, $lseconds, $lmonth, $lday, $lyear);
- $result = $localtime - $boottime;
- $this->sys->setUptime($result);
+ if ($buffer) {
+ $byear = intval(substr($buffer[0]['LastBootUpTime'], 0, 4));
+ $bmonth = intval(substr($buffer[0]['LastBootUpTime'], 4, 2));
+ $bday = intval(substr($buffer[0]['LastBootUpTime'], 6, 2));
+ $bhour = intval(substr($buffer[0]['LastBootUpTime'], 8, 2));
+ $bminute = intval(substr($buffer[0]['LastBootUpTime'], 10, 2));
+ $bseconds = intval(substr($buffer[0]['LastBootUpTime'], 12, 2));
+ $lyear = intval(substr($buffer[0]['LocalDateTime'], 0, 4));
+ $lmonth = intval(substr($buffer[0]['LocalDateTime'], 4, 2));
+ $lday = intval(substr($buffer[0]['LocalDateTime'], 6, 2));
+ $lhour = intval(substr($buffer[0]['LocalDateTime'], 8, 2));
+ $lminute = intval(substr($buffer[0]['LocalDateTime'], 10, 2));
+ $lseconds = intval(substr($buffer[0]['LocalDateTime'], 12, 2));
+ $boottime = mktime($bhour, $bminute, $bseconds, $bmonth, $bday, $byear);
+ $localtime = mktime($lhour, $lminute, $lseconds, $lmonth, $lday, $lyear);
+ $result = $localtime - $boottime;
+ $this->sys->setUptime($result);
+ }
}
/**
@@ -252,25 +267,32 @@
private function _distro()
{
$buffer = $this->_getWMI('Win32_OperatingSystem', array('Version', 'ServicePackMajorVersion'));
- $kernel = $buffer[0]['Version'];
- if ($buffer[0]['ServicePackMajorVersion'] > 0) {
- $kernel .= ' SP'.$buffer[0]['ServicePackMajorVersion'];
+ if ($buffer) {
+ $kernel = $buffer[0]['Version'];
+ if ($buffer[0]['ServicePackMajorVersion'] > 0) {
+ $kernel .= ' SP'.$buffer[0]['ServicePackMajorVersion'];
+ }
+ $this->sys->setKernel($kernel);
+
+ if ((($kernel[1] == ".") && ($kernel[0] <5)) || (substr($kernel,0,4) == "5.0."))
+ $icon = 'Win2000.png';
+ elseif ((substr($kernel,0,4) == "6.0.") || (substr($kernel,0,4) == "6.1."))
+ $icon = 'WinVista.png';
+ elseif (substr($kernel,0,4) == "6.2.")
+ $icon = 'Win8.png';
+ else
+ $icon = 'WinXP.png';
+ $this->sys->setDistributionIcon($icon);
+ } else {
+ $this->sys->setDistributionIcon('Win2000.png');
}
- $this->sys->setKernel($kernel);
$buffer = $this->_getWMI('Win32_OperatingSystem', array('Caption'));
- $this->sys->setDistribution($buffer[0]['Caption']);
-
- if ((($kernel[1] == ".") && ($kernel[0] <5)) || (substr($kernel,0,4) == "5.0."))
- $icon = 'Win2000.png';
- elseif ((substr($kernel,0,4) == "6.0.") || (substr($kernel,0,4) == "6.1."))
- $icon = 'WinVista.png';
- elseif (substr($kernel,0,4) == "6.2.")
- $icon = 'Win8.png';
- else
- $icon = 'WinXP.png';
-
- $this->sys->setDistributionIcon($icon);
+ if ($buffer) {
+ $this->sys->setDistribution($buffer[0]['Caption']);
+ } else {
+ $this->sys->setDistribution("WinNT");
+ }
}
/**
@@ -420,10 +442,11 @@
private function _memory()
{
$buffer = $this->_getWMI("Win32_OperatingSystem", array('TotalVisibleMemorySize', 'FreePhysicalMemory'));
- $this->sys->setMemTotal($buffer[0]['TotalVisibleMemorySize'] * 1024);
- $this->sys->setMemFree($buffer[0]['FreePhysicalMemory'] * 1024);
- $this->sys->setMemUsed($this->sys->getMemTotal() - $this->sys->getMemFree());
-
+ if ($buffer) {
+ $this->sys->setMemTotal($buffer[0]['TotalVisibleMemorySize'] * 1024);
+ $this->sys->setMemFree($buffer[0]['FreePhysicalMemory'] * 1024);
+ $this->sys->setMemUsed($this->sys->getMemTotal() - $this->sys->getMemFree());
+ }
$buffer = $this->_getWMI('Win32_PageFileUsage');
foreach ($buffer as $swapdevice) {
$dev = new DiskDevice();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|