[Phpsysinfo-subversion] SF.net SVN: phpsysinfo:[669] branches/namiltd-ini
Brought to you by:
namiltd
|
From: <na...@us...> - 2012-09-02 11:20:02
|
Revision: 669
http://phpsysinfo.svn.sourceforge.net/phpsysinfo/?rev=669&view=rev
Author: namiltd
Date: 2012-09-02 11:19:56 +0000 (Sun, 02 Sep 2012)
Log Message:
-----------
Fixed UTF8 encoding for Linux
Modified Paths:
--------------
branches/namiltd-ini/ChangeLog
branches/namiltd-ini/config.php
branches/namiltd-ini/data/distros.ini
branches/namiltd-ini/includes/class.CommonFunctions.inc.php
branches/namiltd-ini/includes/os/class.OS.inc.php
branches/namiltd-ini/includes/output/class.Output.inc.php
Added Paths:
-----------
branches/namiltd-ini/gfx/images/Turbo.png
Modified: branches/namiltd-ini/ChangeLog
===================================================================
--- branches/namiltd-ini/ChangeLog 2012-08-31 15:51:27 UTC (rev 668)
+++ branches/namiltd-ini/ChangeLog 2012-09-02 11:19:56 UTC (rev 669)
@@ -2,6 +2,8 @@
phpSysInfo 3.1.0
+ - [ADD] Turbolinux to detected distros
+
- [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
@@ -9,6 +11,7 @@
- [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)
+ - [FIX] Fixed UTF8 encoding for Linux
phpSysInfo 3.0.19
Modified: branches/namiltd-ini/config.php
===================================================================
--- branches/namiltd-ini/config.php 2012-08-31 15:51:27 UTC (rev 668)
+++ branches/namiltd-ini/config.php 2012-09-02 11:19:56 UTC (rev 669)
@@ -1,10 +1,10 @@
<?php
if (!defined('PSI_CONFIG_FILE')){
+//putenv('LANG=C.UTF-8');
/**
* phpSysInfo version
*/
define('PSI_VERSION','3.1.x');
-
/**
* phpSysInfo configuration
*/
@@ -41,6 +41,29 @@
define('PSI_VERSION_STRING', PSI_VERSION);
}
+ /* get Linux charset */
+ if (PHP_OS == 'Linux'){
+ if (file_exists ('/etc/sysconfig/i18n')){
+ if (function_exists('errorHandlerPsi')) restore_error_handler();
+ $contents = file_get_contents('/etc/sysconfig/i18n');
+ if (function_exists('errorHandlerPsi')) set_error_handler('errorHandlerPsi');
+ if ($contents && preg_match("/^(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, $matches)) {
+ define('PSI_SYSTEM_CHARSET', $matches[1]);
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+ if (!defined('PSI_SYSTEM_CHARSET')){
+ define('PSI_SYSTEM_CHARSET', null);
+ }
+
+
define('ARRAY_EXP', '/^return array \([^;]*\);$/'); //array expression search
if ((!is_readable(PSI_CONFIG_FILE)) || !($config = @parse_ini_file(PSI_CONFIG_FILE, true))){
Modified: branches/namiltd-ini/data/distros.ini
===================================================================
--- branches/namiltd-ini/data/distros.ini 2012-08-31 15:51:27 UTC (rev 668)
+++ branches/namiltd-ini/data/distros.ini 2012-09-02 11:19:56 UTC (rev 669)
@@ -158,3 +158,7 @@
[Wary Puppy]
Image = "Puppy.png"
Files = "/etc/DISTRO_SPECS"
+
+[Turbolinux]
+Image = "Turbo.png"
+Files = "/etc/turbolinux-release"
Added: branches/namiltd-ini/gfx/images/Turbo.png
===================================================================
(Binary files differ)
Property changes on: branches/namiltd-ini/gfx/images/Turbo.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-08-31 15:51:27 UTC (rev 668)
+++ branches/namiltd-ini/includes/class.CommonFunctions.inc.php 2012-09-02 11:19:56 UTC (rev 669)
@@ -221,11 +221,11 @@
*/
public static function checkForExtensions($arrExt = array())
{
- if (PHP_OS == "Minix")
- $arrReq = array('simplexml', 'pcre', 'xml', 'dom');
- if (PHP_OS == "WINNT")
+ if ( (PHP_OS == "Minix") || (PSI_SYSTEM_CHARSET == "UTF-8") )
+ $arrReq = array('simplexml', 'pcre', 'xml', 'dom');
+ else if (PHP_OS == "WINNT")
$arrReq = array('simplexml', 'pcre', 'xml', 'mbstring', 'dom', 'com_dotnet');
- else
+ else
$arrReq = array('simplexml', 'pcre', 'xml', 'mbstring', 'dom');
$extensions = array_merge($arrExt, $arrReq);
$text = "";
Modified: branches/namiltd-ini/includes/os/class.OS.inc.php
===================================================================
--- branches/namiltd-ini/includes/os/class.OS.inc.php 2012-08-31 15:51:27 UTC (rev 668)
+++ branches/namiltd-ini/includes/os/class.OS.inc.php 2012-09-02 11:19:56 UTC (rev 669)
@@ -55,7 +55,7 @@
*/
public function getEncoding()
{
- return null;
+ return PSI_SYSTEM_CHARSET;
}
/**
Modified: branches/namiltd-ini/includes/output/class.Output.inc.php
===================================================================
--- branches/namiltd-ini/includes/output/class.Output.inc.php 2012-08-31 15:51:27 UTC (rev 668)
+++ branches/namiltd-ini/includes/output/class.Output.inc.php 2012-09-02 11:19:56 UTC (rev 669)
@@ -37,9 +37,11 @@
*/
public function __construct()
{
- CommonFunctions::checkForExtensions();
$this->error = Error::singleton();
$this->_checkConfig();
+ CommonFunctions::checkForExtensions();
+// $this->error = Error::singleton();
+// $this->_checkConfig();
}
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|