[Phpsysinfo-subversion] SF.net SVN: phpsysinfo:[703] branches/namiltd-ini
Brought to you by:
namiltd
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. |