[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [11812] bkbooking: stavanger phpsysinfo 1st
From: |
Kjell Arne Espedal |
Subject: |
[Fmsystem-commits] [11812] bkbooking: stavanger phpsysinfo 1st |
Date: |
Thu, 13 Mar 2014 14:55:26 +0000 |
Revision: 11812
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=11812
Author: kjell
Date: 2014-03-13 14:55:26 +0000 (Thu, 13 Mar 2014)
Log Message:
-----------
bkbooking: stavanger phpsysinfo 1st
Modified Paths:
--------------
branches/stavangerkommune/phpsysinfo/config.php
branches/stavangerkommune/phpsysinfo/data/ModelTranslation.txt
branches/stavangerkommune/phpsysinfo/data/distros.ini
branches/stavangerkommune/phpsysinfo/gfx/attention.png
branches/stavangerkommune/phpsysinfo/gfx/body.gif
branches/stavangerkommune/phpsysinfo/gfx/images/CentOS.png
branches/stavangerkommune/phpsysinfo/gfx/images/Cobalt.png
branches/stavangerkommune/phpsysinfo/gfx/images/Debian.png
branches/stavangerkommune/phpsysinfo/gfx/images/DragonFly.png
branches/stavangerkommune/phpsysinfo/gfx/images/Fedora.png
branches/stavangerkommune/phpsysinfo/gfx/images/FreeBSD.png
branches/stavangerkommune/phpsysinfo/gfx/images/Gentoo.png
branches/stavangerkommune/phpsysinfo/gfx/images/NetBSD.png
branches/stavangerkommune/phpsysinfo/gfx/images/ReactOS.png
branches/stavangerkommune/phpsysinfo/gfx/images/Redhat.png
branches/stavangerkommune/phpsysinfo/gfx/images/Rubix.png
branches/stavangerkommune/phpsysinfo/gfx/images/SunOS.png
branches/stavangerkommune/phpsysinfo/gfx/images/Synology.png
branches/stavangerkommune/phpsysinfo/gfx/images/Trustix.png
branches/stavangerkommune/phpsysinfo/gfx/images/Ubuntu.png
branches/stavangerkommune/phpsysinfo/gfx/images/free-eos.png
branches/stavangerkommune/phpsysinfo/gfx/images/lfs.png
branches/stavangerkommune/phpsysinfo/gfx/images/unknown.png
branches/stavangerkommune/phpsysinfo/gfx/next.gif
branches/stavangerkommune/phpsysinfo/gfx/prev.gif
branches/stavangerkommune/phpsysinfo/gfx/reload.png
branches/stavangerkommune/phpsysinfo/gfx/treeTable/tv-expandable-last.gif
branches/stavangerkommune/phpsysinfo/gfx/treeTable/tv-expandable.gif
branches/stavangerkommune/phpsysinfo/inc/class.menu.inc.php
branches/stavangerkommune/phpsysinfo/includes/autoloader.inc.php
branches/stavangerkommune/phpsysinfo/includes/class.CommonFunctions.inc.php
branches/stavangerkommune/phpsysinfo/includes/class.Parser.inc.php
branches/stavangerkommune/phpsysinfo/includes/error/class.Error.inc.php
branches/stavangerkommune/phpsysinfo/includes/interface/class.PSI_Interface_OS.inc.php
branches/stavangerkommune/phpsysinfo/includes/interface/class.PSI_Interface_Output.inc.php
branches/stavangerkommune/phpsysinfo/includes/interface/class.PSI_Interface_Plugin.inc.php
branches/stavangerkommune/phpsysinfo/includes/interface/class.PSI_Interface_Sensor.inc.php
branches/stavangerkommune/phpsysinfo/includes/interface/class.PSI_Interface_UPS.inc.php
branches/stavangerkommune/phpsysinfo/includes/js/class.JavaScriptPacker.inc.php
branches/stavangerkommune/phpsysinfo/includes/os/class.BSDCommon.inc.php
branches/stavangerkommune/phpsysinfo/includes/os/class.Darwin.inc.php
branches/stavangerkommune/phpsysinfo/includes/os/class.DragonFly.inc.php
branches/stavangerkommune/phpsysinfo/includes/os/class.FreeBSD.inc.php
branches/stavangerkommune/phpsysinfo/includes/os/class.HPUX.inc.php
branches/stavangerkommune/phpsysinfo/includes/os/class.Linux.inc.php
branches/stavangerkommune/phpsysinfo/includes/os/class.NetBSD.inc.php
branches/stavangerkommune/phpsysinfo/includes/os/class.OS.inc.php
branches/stavangerkommune/phpsysinfo/includes/os/class.OpenBSD.inc.php
branches/stavangerkommune/phpsysinfo/includes/os/class.SunOS.inc.php
branches/stavangerkommune/phpsysinfo/includes/os/class.WINNT.inc.php
branches/stavangerkommune/phpsysinfo/includes/output/class.Output.inc.php
branches/stavangerkommune/phpsysinfo/includes/output/class.Webpage.inc.php
branches/stavangerkommune/phpsysinfo/includes/output/class.WebpageXML.inc.php
branches/stavangerkommune/phpsysinfo/includes/output/class.WebpageXSLT.inc.php
branches/stavangerkommune/phpsysinfo/includes/plugin/class.PSI_Plugin.inc.php
branches/stavangerkommune/phpsysinfo/includes/to/class.MBInfo.inc.php
branches/stavangerkommune/phpsysinfo/includes/to/class.System.inc.php
branches/stavangerkommune/phpsysinfo/includes/to/class.UPSInfo.inc.php
branches/stavangerkommune/phpsysinfo/includes/to/device/class.CpuDevice.inc.php
branches/stavangerkommune/phpsysinfo/includes/to/device/class.DiskDevice.inc.php
branches/stavangerkommune/phpsysinfo/includes/to/device/class.HWDevice.inc.php
branches/stavangerkommune/phpsysinfo/includes/to/device/class.NetDevice.inc.php
branches/stavangerkommune/phpsysinfo/includes/to/device/class.SensorDevice.inc.php
branches/stavangerkommune/phpsysinfo/includes/to/device/class.UPSDevice.inc.php
branches/stavangerkommune/phpsysinfo/includes/xml/class.SimpleXMLExtended.inc.php
branches/stavangerkommune/phpsysinfo/includes/xml/class.XML.inc.php
branches/stavangerkommune/phpsysinfo/index.php
branches/stavangerkommune/phpsysinfo/js/jQuery/README
branches/stavangerkommune/phpsysinfo/js/jQuery/jquery.dataTables.js
branches/stavangerkommune/phpsysinfo/js/jQuery/jquery.jgrowl.js
branches/stavangerkommune/phpsysinfo/js/jQuery/jquery.js
branches/stavangerkommune/phpsysinfo/js/jQuery/jquery.nyroModal.js
branches/stavangerkommune/phpsysinfo/js/jQuery/jquery.treeTable.js
branches/stavangerkommune/phpsysinfo/js/phpSysInfo/phpsysinfo.js
branches/stavangerkommune/phpsysinfo/js.php
branches/stavangerkommune/phpsysinfo/language/ast.xml
branches/stavangerkommune/phpsysinfo/language/bg.xml
branches/stavangerkommune/phpsysinfo/language/cz.xml
branches/stavangerkommune/phpsysinfo/language/da.xml
branches/stavangerkommune/phpsysinfo/language/de.xml
branches/stavangerkommune/phpsysinfo/language/en.xml
branches/stavangerkommune/phpsysinfo/language/es.xml
branches/stavangerkommune/phpsysinfo/language/et.xml
branches/stavangerkommune/phpsysinfo/language/fi.xml
branches/stavangerkommune/phpsysinfo/language/fr.xml
branches/stavangerkommune/phpsysinfo/language/gl.xml
branches/stavangerkommune/phpsysinfo/language/hu.xml
branches/stavangerkommune/phpsysinfo/language/is.xml
branches/stavangerkommune/phpsysinfo/language/it.xml
branches/stavangerkommune/phpsysinfo/language/ja.xml
branches/stavangerkommune/phpsysinfo/language/ko.xml
branches/stavangerkommune/phpsysinfo/language/language.php
branches/stavangerkommune/phpsysinfo/language/nl.xml
branches/stavangerkommune/phpsysinfo/language/no.xml
branches/stavangerkommune/phpsysinfo/language/pl.xml
branches/stavangerkommune/phpsysinfo/language/pt-br.xml
branches/stavangerkommune/phpsysinfo/language/ro.xml
branches/stavangerkommune/phpsysinfo/language/ru.xml
branches/stavangerkommune/phpsysinfo/language/sk.xml
branches/stavangerkommune/phpsysinfo/language/sl.xml
branches/stavangerkommune/phpsysinfo/language/sv.xml
branches/stavangerkommune/phpsysinfo/language/tw.xml
branches/stavangerkommune/phpsysinfo/language/uk.xml
branches/stavangerkommune/phpsysinfo/phpsysinfo.xslt
branches/stavangerkommune/phpsysinfo/phpsysinfo3.xsd
branches/stavangerkommune/phpsysinfo/setup/setup.inc.php
branches/stavangerkommune/phpsysinfo/setup/tables_update.inc.php
branches/stavangerkommune/phpsysinfo/templates/aqua.css
branches/stavangerkommune/phpsysinfo/templates/clean.css
branches/stavangerkommune/phpsysinfo/templates/cream.css
branches/stavangerkommune/phpsysinfo/templates/jstyle_blue.css
branches/stavangerkommune/phpsysinfo/templates/jstyle_green.css
branches/stavangerkommune/phpsysinfo/templates/phpsysinfo.css
branches/stavangerkommune/phpsysinfo/templates/plugin/jquery.dataTables.css
branches/stavangerkommune/phpsysinfo/templates/plugin/jquery.jgrowl.css
branches/stavangerkommune/phpsysinfo/templates/two/gradient.png
branches/stavangerkommune/phpsysinfo/templates/two.css
branches/stavangerkommune/phpsysinfo/xml.php
Added Paths:
-----------
branches/stavangerkommune/phpsysinfo/CHANGELOG.md
branches/stavangerkommune/phpsysinfo/README.md
branches/stavangerkommune/phpsysinfo/README_PLUGIN.md
branches/stavangerkommune/phpsysinfo/phpsysinfo.ini
branches/stavangerkommune/phpsysinfo/phpsysinfo.ini.new
branches/stavangerkommune/phpsysinfo/tools/
branches/stavangerkommune/phpsysinfo/tools/MakeRelease.sh
branches/stavangerkommune/phpsysinfo/tools/README
branches/stavangerkommune/phpsysinfo/tools/aptana/
branches/stavangerkommune/phpsysinfo/tools/aptana/js.xml
branches/stavangerkommune/phpsysinfo/tools/aptana/php.xml
branches/stavangerkommune/phpsysinfo/tools/check.sh
branches/stavangerkommune/phpsysinfo/tools/lint.bat
branches/stavangerkommune/phpsysinfo/tools/phpsysinfo.ini
Added: branches/stavangerkommune/phpsysinfo/CHANGELOG.md
===================================================================
--- branches/stavangerkommune/phpsysinfo/CHANGELOG.md
(rev 0)
+++ branches/stavangerkommune/phpsysinfo/CHANGELOG.md 2014-03-13 14:55:26 UTC
(rev 11812)
@@ -0,0 +1,104 @@
+Changelog of phpSysInfo
+=======================
+
+http://phpsysinfo.sourceforge.net/
+
+phpSysInfo 3.1.7
+----------------
+
+ - [ADD] Ksplice support for Linux
+ - [ADD] Show CPU frequency max and min for Darwin (Mac OS X)
+ - [ADD] Show System Language and Code Page on Darwin (Mac OS X)
+ - [ADD] Show network interfaces infos for Minix and SunOS
+ - [ADD] SMS, gNewSense and Vector to detected distros
+ - [ADD] LMSensors power information
+ - [ADD] Battery installation date for the UPS info
+
+ - [UPD] Network interfaces infos and filesystems infos for FreeBSD
+ - [UPD] Updated support of SunOS
+ - [UPD] Memory informations on Darwin systems
+ - [UPD] BAT plugin - updated Linux support
+ - [UPD] Updated HWSensors - OpenBSD sensor program
+
+phpSysInfo 3.1.6
+----------------
+
+ - [ADD] Porteus, Peppermint, Manjaro, Netrunner and Salix to detected distros
+ - [ADD] Show CPU frequency max for WINNT
+ - [ADD] Show network interfaces infos for Darwin (Mac OS X)
+
+ - [UPD] SNMPPInfo plugin, ink level for some of the data
+ - [UPD] jQuery 2.0.3 and jQuery 1.10.2
+ - [UPD] Russian Translation ru.xml
+ - [UPD] BAT plugin - WINNT support
+
+ - [SEC] Fix JSONP
+
+phpSysInfo 3.1.5
+----------------
+
+ - [ADD] Possibility to define multiple SENSOR_PROGRAM
+ - [ADD] Added display of temperature and fan speed for IPMI sensor program
+ - [ADD] openSUSE and Eisfair to detected distros
+ - [ADD] Portuguese Translation pt-pt.xml
+
+ - [FIX] Fixed incorrect display of the minimum fan speed
+ - [FIX] Fix recovery detection of RAID arrays on debian systems #18
+
+phpSysInfo 3.1.4
+----------------
+
+ - [ADD] Option for reading the results of functions executeProgram() and
rfts() from log
+ - [ADD] Show CPU frequency max and min for variable speed processors for
Linux and Android
+ - [ADD] Filesystem usage warning on defined threshold FS_USAGE_THRESHOLD
+
+ - [UPD] BAT plugin - added temperature, condition and type of battery,
Android support
+ - [UPD] jQuery 2.0.2 and jQuery 1.10.1
+
+phpSysInfo 3.1.3
+----------------
+
+ - [ADD] IPFire, Sabayon, PearOS, ClearOS, Frugalware, Fuduntu, Foresight,
Tinycore, ALT Linux, ROSA and RedHatEnterpriseServer to detected distros
+
+ - [UPD] Added "username" to filtered mount credentials
+ - [UPD] jQuery 2.0 coexistent with jQuery 1.9.1 for old Internet Explorer
browser versions (IE 6/7/8)
+
+ - [FIX] proc_open() malfunction on some PHP for Android by replacing by
popen()
+ - [FIX] Run php-cs-fixer on php files (PSR-2 fixer)
+
+phpSysInfo 3.1.2
+----------------
+
+ - [ADD] Tempsensor and CPU frequency for Raspberry Pi (thanks to hawkeyexp)
+ - [ADD] Linaro to detected distros
+ - [ADD] Option for logging of functions executeProgram() and rfts()
+ - [ADD] Add support of JSONP
+
+ - [FIX] Incorrect display of chunk size for the plugin mdstatus for some
results
+
+phpSysInfo 3.1.1
+----------------
+
+ - [ADD] SolusOS, Deepin and antiX to detected distros
+ - [ADD] Simplified Chinese translation
+
+ - [UPD] jQuery 1.9.1
+
+phpSysInfo 3.1.0
+----------------
+
+ - [NEW] Configuration moved from config.php and subdirs of "plugins" to one
file phpsysinfo.ini
+
+ - [ADD] Turbolinux, Oracle Linux, CloudLinux, PCLinuxOS, StartOS, Trisquel,
CRUX, Slax, Pear, Android, Zorin and elementary OS to detected distros
+ - [ADD] Show System Language and Code Page on Linux, Haiku and WINNT
+ - [ADD] Minor support of ReactOS
+ - [ADD] apcupsd-cgi support (thanks to duhast)
+
+ - [UPD] Plugin ipmi renamed to IPMIInfo and Update-Notifier to UpdateNotifier
(to avoid name conflicts)
+ - [UPD] Case-insensitive for most of parameters
+ - [UPD] Detection of Mac OS X and Linux distribution
+ - [UPD] CPU detection on Mac OS X
+
+ - [FIX] Fixed UTF8 encoding for Linux
+ - [FIX] SMART plugin doesn't display for some results
+ - [FIX] Incorrect display of mountpoint on Mac OS X
Added: branches/stavangerkommune/phpsysinfo/README.md
===================================================================
--- branches/stavangerkommune/phpsysinfo/README.md
(rev 0)
+++ branches/stavangerkommune/phpsysinfo/README.md 2014-03-13 14:55:26 UTC
(rev 11812)
@@ -0,0 +1,112 @@
+phpSysInfo
+==============
+
+* Copyright (c), 1999-2008, Uriah Welcome (address@hidden)
+* Copyright (c), 1999-2009, Michael Cramer (address@hidden)
+* Copyright (c), 2007-2008, Audun Larsen (address@hidden)
+* Copyright (c), 2007-2013, Erkan Valentin
+* Copyright (c), 2009-2013, Mieczyslaw Nalewaj (address@hidden)
+* Copyright (c), 2010-2012, Damien Roth (address@hidden)
+
+
+
+CURRENT TESTED PLATFORMS
+------------------------
+
+- Linux 2.6.x
+- FreeBSD 7.x
+- OpenBSD 2.8+
+- NetBSD
+- DragonFly
+- IBM AIX
+- HP-UX
+- Darwin/OSX
+- Windows 2000 / Windows 2003 / Windows XP / Windows Vista / Windows 7 /
Windows 8
+- > PHP 5.2 or later
+ - With PCRE, XML, XSL, MBString and SimpleXML extension.
+
+####Platforms currently in progress:
+- Haiku
+- Minix
+- SunOS
+- ReactOS
+- Android
+
+If your platform is not here try checking out the mailing list archives or
+the message boards on SourceForge.
+
+INSTALLATION AND CONFIGURATION
+------------------------------
+
+Just decompress and untar the source (which you should have done by now,
+if you're reading this...), into your webserver's document root.
+
+There is a configuration file called phpsysinfo.ini.new. If this a brand new
+installation, you should copy this file to phpsysinfo.ini and edit it.
+
+- make sure your `php.ini` file's `include_path` entry contains "."
+- make sure your `php.ini` has `safe_mode` set to 'off'.
+
+phpSysInfo require php-xml extension.
+
+Please keep in the mind that because phpSysInfo requires access to many
+files in `/proc` and other system binary you **MUST DISABLE** `php's
safe_mode`.
+Please see the PHP documentation for information on how you
+can do this.
+
+That's it. Restart your webserver (if you changed php.ini), and voila.
+
+KNOWN PROBLEMS
+--------------
+
+- phpSysInfo is not compatible with SELinux Systems
+- small bug under FreeBSD with memory reporting
+
+PLATFORM SPECIFIC ISSUES
+------------------------
+
+####Windows with IIS
+ On Windows systems we get our informations through the WMI interface.
+ If you run phpSysInfo on the IIS webserver, phpSysInfo will not connect
+ to the WMI interface for security reasons. At this point you MUST set
+ an authentication mechanism for the directory in the IIS admin
+ interface for the directory where phpSysInfo is installed. Then you
+ will be asked for an user and a password when opening the page. At this
+ point it is necassary to log in with an user that will be able to
+ connect to the WMI interface. If you use the wrong user and/or password
+ you might get an "ACCESS DENIED ERROR".
+
+SENSOR RELATED INFORMATION
+---------------------------
+
+####MBM5
+ Make sure you set MBM5 Interval Logging to csv and to the data
+ directory of phpSysInfo. The file must be called MBM5. Also make sure
+ MBM5 doesn't add symbols to the values. This is a Quick MBM5 log parser,
+ need more csv logs to make it better.
+
+WHAT TO DO IF IT DOESN'T WORK
+-----------------------------
+
+First make sure you've read this file completely, especially the
+"INSTALLATION AND CONFIGURATION" section. If it still doesn't work then
+you can:
+
+Submit a bug on SourceForge (preferred)
(http://sourceforge.net/projects/phpsysinfo/)
+
+Ask for help in the forum (http://sourceforge.net/projects/phpsysinfo/)
+
+***!! If you have any problems, please set `DEBUG` to true in `phpsysinfo.ini`
+and include any error messages in your bug report / help request !!***
+
+OTHER NOTES
+-----------
+
+If you have a great idea or want to help out, just drop by the project
+page at SourceForge (http://sourceforge.net/projects/phpsysinfo/).
+
+LICENSING
+---------
+
+This program and all associated files are released under the GNU Public
+License, see [COPYING](COPYING) for details.
Added: branches/stavangerkommune/phpsysinfo/README_PLUGIN.md
===================================================================
--- branches/stavangerkommune/phpsysinfo/README_PLUGIN.md
(rev 0)
+++ branches/stavangerkommune/phpsysinfo/README_PLUGIN.md 2014-03-13
14:55:26 UTC (rev 11812)
@@ -0,0 +1,134 @@
+phpSysInfo 3.1 - http://phpsysinfo.sourceforge.net/
+===================================================
+
+Document written by Michael Cramer (bigmichi1 at sourceforge.net)
+
+!!Please read if you want to develop a plugin to understand our plugin system!!
+
+
+Plugins
+-------
+
+Beginning with phpSysInfo 3.0, phpSysInfo can be extended by Plugins. So here
is
+a description that a developer of a plugin must take care of. Plugins can be
+enabled through the `phpsysinfo.ini` in the PLUGINS variable. The name of the
+plugin is essential for the function of the plugin system. Lets say you write a
+plugin with the name 'hdd_stats', then this name is added to the PLUGINS
+variable in `phpsysinfo.ini`. And this is also then the name which is
everywhere in
+the plugin system used, like creating the object, locate the needed files and
+so on.
+
+So if the name is now specified, phpSysInfo needs a special directory structure
+to find the needed files. The directory structure for the example `hdd_stats`
+plugin can be seen here:
+
+```
+-+ phpSysInfo root
+ |
+ +---+ plugins (directory in that plugins are installed)
+ | |
+ | +---+ hdd_stats (the real plugin directory, must have the same name like
+ | | | the plugin named in PLUGINS, else it won't be found)
+ | | |
+ | | +---+ js (directory in which the needed JavaScript file is located,
+ | | | | to generate the html output out of the xml)
+ | | | # hdd_stats.js (the js file must have the same name, like the
+ | | | plugin in PSI_PLUGINS with the extension js)
+ | | +---+ css (directory in which the needed style sheet information are
+ | | | | located, can exists, but it's up to the author)
+ | | | # hdd_stats.css (the css file must have the same name, like the
+ | | | plugin in PSI_PLUGINS with the extension css)
+ | | +---+ lang (directory where translations for the plugin are located)
+ | | | |
+ | | | # en.xml (at least an english translation file must exist)
+ | | |
+ | | # class.hdd_stats.inc.php (this is the core file of the plugin,
+ | | name must consists of 'class' +
+ | | name from PSI_PLUGINS + '.inc.php')
+```
+
+other files or directorys can be included in the plugin directory, but then
+its up to the developer to include them in the plugin. So it might be possible
+to have a 'gfx' directory in which some pics are located that are used in the
+output.
+
+If the directory structure is build up, then it's time to start programming.
+
+Files
+-----
+
+An example implementation is the mdstat plugin, which is shipped with
phpSysInfo
+
+* en.xml - at least this file must exist to get the translation working, and
the
+ the first entry in this file is normally the headline of the plugin.
+ So one translation migth exists everytime. Other translation files
+ are also in the same directory like the `en.xml` file.
+ The id's specified in the translation file SHOULD have the following
+ look `plugin_hdd_status_001`. First we say that this is a plugin
+ translation, then the name of plugin and at last a increasing number
+ for each translation. Please create your id's in that way, so that
+ other plugins don't redefine your translations. At the time of writing
+ this, there is no check to verify the id's, so be carfull.
+
+* hdd_stats.css - here can all custom style sheet informations written down.
The
+ names of the id's and classes SHOULD also begin, like the translation
+ id's, with `'plugin_' + pluginname`. If thats not the case it might be
+ possible that another plugin is overwriting your css definitions.
+
+* class.hdd_stats.inc.php - this file MUST include a class with the plugin name
+ and also this class MUST extend the 'psi_plugin' class. A check that
+ such a class exist and also extends 'psi_plugin' will be included in
+ the near future. And if the check fails the plugin won't be loaded.
+ The psi_plugin class checks the existens of the js and the en.xml
+ files. Also an extra configuration of the plugin is loaded
+ automatically from `phpsysinfo.ini`, if present.
+ Through the extension of the psi_plugin class there is a need to
+ include at least two public function. These are the execute() function
+ and the xml() function. Other functions can be exist, that depends on
+ the plugin needs or the author of the class. The execute() function is
+ called to get the required information that should be later included
+ in the xml file. The xml() function is called when the xml output
+ should be generated. This function must return a simplexml object.
This
+ object is then included in another xml at the right position or as a
+ standalone xml. So there is no need to do some special things, only
+ create a xml object for the plugin.
+
+* hdd_stats.js - this file is called when the page is loaded. A block for the
+ plugin is automatically created. This one is a div container with the
+ id `'plugin_'+ pluginname ("plugin_hdd_stats")`. The entire output
must be
+ placed in that container.
+ There is a helper function for creating the headline: buildBlock() that
+ can be called. This function returns a string with the html code of the
+ headline, this code can then be appended to the plugin block. The
+ generated headline can provide a reload icon for an ajax request. Only
+ the click action of that icon must be created. The id of this icon is
+ `'reload_' + pluginname + 'Table' ("reload_hdd_statsTable")`.
+ Everything that then is done to get the html output out of the xml is
up
+ to the author.
+ To get the xml document the ajax request url is `'xml.php?plugin=' +
+ pluginname (xml.php?plugin=hdd_stats)`. This xml includes only the xml
+ from the plugin nothing more.
+ The last two executed commands should/must be the translation call and
+ the unhide of the filled div container.
+ The translation function that needs to be called is named
+ plugin_traslate() with one argument, that is the pluginname like in
+ `PSI_PLUGINS (plugin_translate("hdd_stats");)`.
+ To unhide the filled container call the .show() function of it.
+ `$("plugin_" + pluginname).show() ($("plugin_hdd_stat").show())`.
+
+FAQ
+---
+
+Q: Is the plugin system ready to use?
+
+A: It can be used, but it might change slightly in the future, if there are
some
+ special needs.
+
+SUGGESTION
+----------
+
+If anybody out there has some suggestions in improving the plugin system let us
+know. We are looking forward to get some feedback, suggestions and patches and
+more. Feel free to contact us on our website:
http://phpsysinfo.sourceforge.net.
+
+$Id: README_PLUGIN 463 2011-04-19 17:34:41Z namiltd $
Modified: branches/stavangerkommune/phpsysinfo/config.php
===================================================================
--- branches/stavangerkommune/phpsysinfo/config.php 2014-03-12 14:19:06 UTC
(rev 11811)
+++ branches/stavangerkommune/phpsysinfo/config.php 2014-03-13 14:55:26 UTC
(rev 11812)
@@ -1,245 +1,237 @@
<?php
-/**
- * PSI Config File
- *
- * PHP version 5
- *
- * @category PHP
- * @package PSI
- * @author Michael Cramer <address@hidden>
- * @copyright 2009 phpSysInfo
- * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public
License
- * @version SVN: $Id$
- * @link http://phpsysinfo.sourceforge.net
- */
-
-// ********************************
-// MAIN PARAMETERS
-// ********************************
+if (!defined('PSI_CONFIG_FILE')) {
+ /**
+ * phpSysInfo version
+ */
+ define('PSI_VERSION','3.1.7');
+ /**
+ * phpSysInfo configuration
+ */
+ define('PSI_CONFIG_FILE', APP_ROOT.'/phpsysinfo.ini');
-/**
- * Turn on debugging of some functions and include errors and warnings in xml
and provide a popup for displaying errors
- * - false : no debug information are stored in xml or displayed
- * - true : debug information stored in xml and displayed *be careful if set
this to true, may include sensitive information from your pc*
- */
-define('PSI_DEBUG', false);
+ define('ARRAY_EXP', '/^return array \([^;]*\);$/'); //array expression
search
-/**
- * Additional paths where to look for installed programs
- * Example : define('PSI_ADD_PATHS', '/opt/bin,/opt/sbin');
- */
-define('PSI_ADD_PATHS', false);
+ if (!is_readable(PSI_CONFIG_FILE) || !($config =
@parse_ini_file(PSI_CONFIG_FILE, true))) {
+ $tpl = new Template("/templates/html/error_config.html");
+ echo $tpl->fetch();
+ die();
+ } else {
+ foreach ($config as $name=>$group) {
+ if (strtoupper($name)=="MAIN") {
+ $name_prefix='PSI_';
+ } else {
+ $name_prefix='PSI_PLUGIN_'.strtoupper($name).'_';
+ }
+ foreach ($group as $param=>$value) {
+ if (($value==="") || ($value==="0")) {
+ define($name_prefix.strtoupper($param), false);
+ } elseif ($value==="1") {
+ define($name_prefix.strtoupper($param), true);
+ } else {
+ if (strstr($value, ',')) {
+ define($name_prefix.strtoupper($param), 'return
'.var_export(preg_split('/\s*,\s*/', $value, -1, PREG_SPLIT_NO_EMPTY),1).';');
+ } else {
+ define($name_prefix.strtoupper($param), $value);
+ }
+ }
+ }
+ }
+ }
-/**
- * Plugins that should be included in xml and output (!!!plugin names are
case-sensitive!!!)
- * List of plugins should look like "plugin,plugin,plugin". See /plugins
directory
- * - define('PSI_PLUGINS', 'MDStatus,PS'); // list of plugins
- * - define('PSI_PLUGINS', false); //no plugins
- * included plugins:
- * - MDStatus - show the raid status and whats currently going on
- * - PS - show a process tree of all running processes
- * - PSStatus - show a graphical representation if a process is running or not
- * - 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
- */
-define('PSI_PLUGINS', false);
+ /* default error handler */
+ if (function_exists('errorHandlerPsi')) {
+ restore_error_handler();
+ }
+ /* fatal errors only */
+ $old_err_rep = error_reporting();
+ error_reporting(E_ERROR);
-// ********************************
-// DISPLAY PARAMETERS
-// ********************************
+ /* get git revision */
+ if (file_exists(APP_ROOT.'/.git/HEAD')) {
+ $contents = @file_get_contents(APP_ROOT.'/.git/HEAD');
+ if ($contents && preg_match("/^ref:\s+(.*)\/([^\/\s]*)/m", $contents,
$matches)) {
+ $contents =
@file_get_contents(APP_ROOT.'/.git/'.$matches[1]."/".$matches[2]);
+ if ($contents && preg_match("/^([^\s]*)/m", $contents, $revision))
{
+ define('PSI_VERSION_STRING', PSI_VERSION
."-".$matches[2]."-".substr($revision[1],0,7));
+ } else {
+ define('PSI_VERSION_STRING', PSI_VERSION ."-".$matches[2]);
+ }
+ }
+ }
+ /* get svn revision */
+ if (!defined('PSI_VERSION_STRING') &&
file_exists(APP_ROOT.'/.svn/entries')) {
+ $contents = @file_get_contents(APP_ROOT.'/.svn/entries');
+ if ($contents && preg_match("/dir\n(.+)/", $contents, $matches)) {
+ define('PSI_VERSION_STRING', PSI_VERSION."-r".$matches[1]);
+ } else {
+ define('PSI_VERSION_STRING', PSI_VERSION);
+ }
+ }
+ if (!defined('PSI_VERSION_STRING')) {
+ define('PSI_VERSION_STRING', PSI_VERSION);
+ }
-/**
- * Define the default language
- */
-define('PSI_DEFAULT_LANG', 'en');
+ if (!defined('PSI_OS')) { //if not overloaded in phpsysinfo.ini
+ /* get Linux code page */
+ if (PHP_OS == 'Linux') {
+ if (file_exists('/etc/sysconfig/i18n')) {
+ $contents = @file_get_contents('/etc/sysconfig/i18n');
+ } elseif (file_exists('/etc/default/locale')) {
+ $contents = @file_get_contents('/etc/default/locale');
+ } elseif (file_exists('/etc/locale.conf')) {
+ $contents = @file_get_contents('/etc/locale.conf');
+ } elseif (file_exists('/etc/sysconfig/language')) {
+ $contents = @file_get_contents('/etc/sysconfig/language');
+ } elseif (file_exists('/etc/profile.d/lang.sh')) {
+ $contents = @file_get_contents('/etc/profile.d/lang.sh');
+ } else {
+ $contents = false;
+ if (file_exists('/system/build.prop')) { //Android
+ define('PSI_OS', 'Android');
+ if (!defined('PSI_MODE_POPEN')) { //if not overloaded in
phpsysinfo.ini
+ if (!function_exists("proc_open")) { //proc_open
function test by executing 'pwd' command
+ define('PSI_MODE_POPEN', true); //use popen()
function - no stderr error handling
+ } else {
+ $out = '';
+ $err = '';
+ $pipes = array();
+ $descriptorspec = array(0=>array("pipe", "r"),
1=>array("pipe", "w"), 2=>array("pipe", "w"));
+ $process = proc_open("pwd 2>/dev/null ",
$descriptorspec, $pipes);
+ if (!is_resource($process)) {
+ define('PSI_MODE_POPEN', true);
+ } else {
+ $w = null;
+ $e = null;
-/**
- * Define the default template
- */
-define('PSI_DEFAULT_TEMPLATE', 'phpsysinfo');
+ while (!(feof($pipes[1]) || feof($pipes[2]))) {
+ $read = array($pipes[1], $pipes[2]);
-/**
- * Show or hide language picklist
- */
-define('PSI_SHOW_PICKLIST_LANG', true);
+ $n = stream_select($read, $w, $e, 5);
-/**
- * Show or hide template picklist
- */
-define('PSI_SHOW_PICKLIST_TEMPLATE', true);
+ if (($n === FALSE) || ($n === 0)) {
+ break;
+ }
-/**
- * Define the interval for refreshing data in ms
- * - 0 = disabled
- * - 1000 = 1 second
- * - Default is 60 seconds
- */
-define('PSI_REFRESH', 60000);
+ foreach ($read as $r) {
+ if ($r == $pipes[1]) {
+ $out .= fread($r, 4096);
+ }
+ if ($r == $pipes[2]) {
+ $err .= fread($r, 4096);
+ }
+ }
+ }
+
+ if (is_null($out) || (trim($out) == "") ||
(substr(trim($out),0 ,1) != "/")) {
+ define('PSI_MODE_POPEN', true);
+ }
+ fclose($pipes[0]);
+ fclose($pipes[1]);
+ fclose($pipes[2]);
+ // It is important that you close any pipes
before calling
+ // proc_close in order to avoid a deadlock
+ proc_close($process);
+ }
+ }
+ }
+ }
+ }
+ if (!(defined('PSI_SYSTEM_CODEPAGE') &&
defined('PSI_SYSTEM_LANG')) //also if both not overloaded in phpsysinfo.ini
+ && $contents && ( preg_match('/^(LANG="?[^"\n]*"?)/m',
$contents, $matches)
+ || preg_match('/^RC_(LANG="?[^"\n]*"?)/m', $contents, $matches)
+ || preg_match('/^export (LANG="?[^"\n]*"?)/m', $contents,
$matches))) {
+ if (!defined('PSI_SYSTEM_CODEPAGE') && @exec($matches[1].'
locale -k LC_CTYPE 2>/dev/null', $lines)) { //if not overloaded in
phpsysinfo.ini
+ foreach ($lines as $line) {
+ if (preg_match('/^charmap="?([^"]*)/', $line,
$matches2)) {
+ define('PSI_SYSTEM_CODEPAGE', $matches2[1]);
+ break;
+ }
+ }
+ }
+ if (!defined('PSI_SYSTEM_LANG') && @exec($matches[1].' locale
2>/dev/null', $lines)) { //also if not overloaded in phpsysinfo.ini
+ foreach ($lines as $line) {
+ 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]])) {
+ $lang =
$langdata['Linux']['_'.$matches2[1]];
+ }
+ }
+ if ($lang == "") {
+ $lang = 'Unknown';
+ }
+ define('PSI_SYSTEM_LANG', $lang.'
('.$matches2[1].')');
+ break;
+ }
+ }
+ }
+ }
+ } elseif (PHP_OS == 'Haiku') {
+ if (!(defined('PSI_SYSTEM_CODEPAGE') &&
defined('PSI_SYSTEM_LANG')) //also if both not overloaded in phpsysinfo.ini
+ && @exec('locale -m 2>/dev/null', $lines)) {
+ foreach ($lines as $line) {
+ if (preg_match('/^"?([^\."]*)\.?([^"]*)/', $line,
$matches2)) {
-/**
- * Show a graph for current cpuload
- * - true = displayed, but it's a performance hit (because we have to wait to
get a value, 1 second)
- * - false = will not be displayed
- */
-define('PSI_LOAD_BAR', false);
+ if (!defined('PSI_SYSTEM_CODEPAGE') &&
isset($matches2[2]) && !is_null($matches2[2]) && (trim($matches2[2]) != "") ) {
//also if not overloaded in phpsysinfo.ini
+ define('PSI_SYSTEM_CODEPAGE', $matches2[2]);
+ }
-/**
- * Display the virtual host name and address
- * - Default is canonical host name and address
- * - Use define('PSI_USE_VHOST', true); to display virtual host name.
- */
-define('PSI_USE_VHOST', false);
+ if (!defined('PSI_SYSTEM_LANG')) { //if not overloaded
in phpsysinfo.ini
+ $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_LANG', $lang.'
('.$matches2[1].')');
+ }
+ break;
+ }
+ }
+ }
+ } elseif (PHP_OS == 'Darwin') {
+ if (!defined('PSI_SYSTEM_LANG') //if not overloaded in
phpsysinfo.ini
+ && @exec('defaults read
/Library/Preferences/.GlobalPreferences AppleLocale 2>/dev/null', $lines)) {
+ $lang = "";
+ if (is_readable(APP_ROOT.'/data/languages.ini') && ($langdata
= @parse_ini_file(APP_ROOT.'/data/languages.ini', true))) {
+ if (isset($langdata['Linux']['_'.$lines[0]])) {
+ $lang = $langdata['Linux']['_'.$lines[0]];
+ }
+ }
+ if ($lang == "") {
+ $lang = 'Unknown';
+ }
+ define('PSI_SYSTEM_LANG', $lang.' ('.$lines[0].')');
+ }
+ }
+ }
-/**
- * Controls the units & format for network, memory and filesystem
- * - 1 KiB = 2^10 bytes = 1,024 bytes
- * - 1 KB = 10^3 bytes = 1,000 bytes
- * - 'PiB' everything is in PeBiByte
- * - 'TiB' everything is in TeBiByte
- * - 'GiB' everything is in GiBiByte
- * - 'MiB' everything is in MeBiByte
- * - 'KiB' everything is in KiBiByte
- * - 'auto_binary' everything is automatic done if value is to big for, e.g
MiB then it will be in GiB
- * - 'PB' everything is in PetaByte
- * - 'TB' everything is in TeraByte
- * - 'GB' everything is in GigaByte
- * - 'MB' everything is in MegaByte
- * - 'KB' everything is in KiloByte
- * - 'auto_decimal' everything is automatic done if value is to big for, e.g
MB then it will be in GB
- */
-define('PSI_BYTE_FORMAT', 'auto_binary');
+ if (!defined('PSI_OS')) {
+ define('PSI_OS', PHP_OS);
+ }
-/**
- * Format in which temperature is displayed
- * - 'c' shown in celsius
- * - 'f' shown in fahrenheit
- * - 'c-f' both shown first celsius and fahrenheit in braces
- * - 'f-c' both shown first fahrenheit and celsius in braces
- */
-define('PSI_TEMP_FORMAT', 'c');
+ if (!defined('PSI_SYSTEM_LANG')) {
+ define('PSI_SYSTEM_LANG', null);
+ }
+ if (!defined('PSI_SYSTEM_CODEPAGE')) { //if not overloaded in
phpsysinfo.ini
+ if ((PSI_OS=='Android') || (PSI_OS=='Darwin')) {
+ define('PSI_SYSTEM_CODEPAGE', 'UTF-8');
+ } elseif (PSI_OS=='Minix') {
+ define('PSI_SYSTEM_CODEPAGE', 'CP437');
+ } else {
+ define('PSI_SYSTEM_CODEPAGE', null);
+ }
+ }
+ /* restore error level */
+ error_reporting($old_err_rep);
-// ********************************
-// SENSORS PARAMETERS
-// ********************************
-
-/**
- * Define the motherboard monitoring program (!!!names are case-sensitive!!!)
- * We support the following programs so far
- * - LMSensors http://www.lm-sensors.org/
- * - Healthd http://healthd.thehousleys.net/
- * - HWSensors http://www.openbsd.org/
- * - MBMon
http://www.nt.phys.kyushu-u.ac.jp/shimizu/download/download.html
- * - MBM5 http://mbm.livewiredev.com/
- * - Coretemp
- * - IPMI http://openipmi.sourceforge.net/
- * - K8Temp http://hur.st/k8temp/
- * Example: If you want to use lmsensors : define('PSI_SENSOR_PROGRAM',
'LMSensors');
- */
-define('PSI_SENSOR_PROGRAM', false);
-
-/**
- * Define how to access the monitor program
- * Available methods for the above list are in the following list
- * default method 'command' should be fine for everybody
- * !!! tcp connections are only made local and on the default port !!!
- * - LMSensors command, file
- * - Healthd command
- * - HWSensors command
- * - MBMon command, tcp
- * - MBM5 file
- * - Coretemp command
- * - IPMI command
- * - K8Temp command
- */
-define('PSI_SENSOR_ACCESS', 'command');
-
-/**
- * Hddtemp program
- * If the hddtemp program is available we can read the temperature, if hdd is
smart capable
- * !!ATTENTION!! hddtemp might be a security issue
- * - define('PSI_HDD_TEMP', 'tcp'); // read data from hddtemp deamon
(localhost:7634)
- * - define('PSI_HDD_TEMP', 'command'); // read data from hddtemp programm
(must be set suid)
- */
-define('PSI_HDD_TEMP', false);
-
-
-// ********************************
-// FILESYSTEM PARAMETERS
-// ********************************
-
-/**
- * Show mount point
- * - true = show mount point
- * - false = do not show mount point
- */
-define('PSI_SHOW_MOUNT_POINT', true);
-
-/**
- * Show mount option
- * - true = show mount option
- * - false = do not show mount option
- */
-define('PSI_SHOW_MOUNT_OPTION', true);
-
-/**
- * Show inode usage
- * - true = display used inodes in percent
- * - false = hide them
- */
-define('PSI_SHOW_INODES', true);
-
-/**
- * Hide mounts
- * Example : define('PSI_HIDE_MOUNTS', '/home,/usr');
- */
-define('PSI_HIDE_MOUNTS', '');
-
-/**
- * Hide filesystem types
- * Example : define('PSI_HIDE_FS_TYPES', 'tmpfs,usbfs');
- */
-define('PSI_HIDE_FS_TYPES', '');
-
-/**
- * Hide partitions
- * Example : define('PSI_HIDE_DISKS', 'rootfs');
- */
-define('PSI_HIDE_DISKS', '');
-
-
-// ********************************
-// NETWORK PARAMETERS
-// ********************************
-
-/**
- * Hide network interfaces
- * Example : define('PSI_HIDE_NETWORK_INTERFACE', 'eth0,sit0');
- */
-define('PSI_HIDE_NETWORK_INTERFACE', '');
-
-
-// ********************************
-// UPS PARAMETERS
-// ********************************
-
-/**
- * Define the ups monitoring program (!!!names are case-sensitive!!!)
- * We support the following programs so far
- * - 1. Apcupsd http://www.apcupsd.com/
- * - 2. Nut http://www.networkupstools.org/
- * Example: If you want to use Apcupsd : define('PSI_UPS_PROGRAM', 'Apcupsd');
- */
-define('PSI_UPS_PROGRAM', false);
-
-/**
- * Apcupsd supports multiple UPSes
- * You can specify comma delimited list in the form <hostname>:<port> or
<ip>:<port>. The defaults are: 127.0.0.1:3551
- * See the following parameters in apcupsd.conf: NETSERVER, NISIP, NISPORT
- */
-define('PSI_UPS_APCUPSD_LIST', '127.0.0.1:3551');
-
-?>
+ /* restore error handler */
+ if (function_exists('errorHandlerPsi')) {
+ set_error_handler('errorHandlerPsi');
+ }
+}
Modified: branches/stavangerkommune/phpsysinfo/data/ModelTranslation.txt
===================================================================
--- branches/stavangerkommune/phpsysinfo/data/ModelTranslation.txt
2014-03-12 14:19:06 UTC (rev 11811)
+++ branches/stavangerkommune/phpsysinfo/data/ModelTranslation.txt
2014-03-13 14:55:26 UTC (rev 11812)
@@ -1,12 +1,40 @@
ADP2,1:Developer Transition Kit
+iMac,1:iMac
iMac1,1:iMac G3 (Rev A-D)
iMac4,1:iMac (Core Duo)
iMac4,2:iMac for Education (17-inch, Core Duo)
-Macmini1,1:Mac Mini (Core Solo/Duo)
-MacBook1,1:MacBook
-MacBookPro1,1:MacBook Pro (15-inch)
-MacBookPro3,1:MacBook Pro SR (15-inch)
-MacBookPro1,2:MacBook Pro (17-inch)
+iMac5,1:iMac (Core 2 Duo)
+iMac6,1:iMac (24-inch Core 2 Duo)
+iMac7,1:iMac (Aluminum Core 2 Duo)
+iMac8,1:iMac (Aluminum Core 2 Duo)
+iMac9,1:iMac (Aluminum Core 2 Duo)
+iMac10,1:iMac (Unibody Core 2 Duo)
+iMac10,2:iMac (Unibody Core 2 Duo)
+iMac11,1:iMac (Unibody Core i5/i7)
+iMac11,2:iMac (Unibody Core i3)
+iMac11,3:iMac (Unibody Core i3/i5/i7)
+iMac12,1:iMac (Unibody Core i5/i7)
+iMac12,2:iMac (Unibody Core i5/i7)
+iMac13,1:iMac (Core i5/i7)
+iMac13,2:iMac (Core i5/i7)
+M43ADP1,1:Development Mac Pro
+MacBook1,1:MacBook (Core Duo)
+MacBook2,1:MacBook (Core 2 Duo)
+MacBook3,1:MacBook (Core 2 Duo)
+MacBook4,1:MacBook (Early 2008)
+MacBookAir1,1:MacBook Air
+MacBookPro1,1:MacBook Pro (15-inch Core Duo)
+MacBookPro1,2:MacBook Pro (17-inch Core Duo)
+MacBookPro2,1:MacBook Pro (17-inch Core 2 Duo)
+MacBookPro2,2:MacBook Pro (15-inch Core 2 Duo)
+MacBookPro3,1:MacBook Pro (15-inch or 17-inch LED, Core 2 Duo)
+MacBookPro4,1:MacBook Pro (15-inch or 17-inch LED, Early 2008)
+MacBookPro5,1:MacBook Pro (15-inch LED Unibody, Late 2008)
+MacBookPro5,4:MacBook Pro (15-inch LED Unibody, Mid 2009)
+Macmini1,1:Mac mini (Core Solo/Duo)
+MacPro1,1:Mac Pro (Quad Xeon)
+MacPro2,1:Mac Pro (Octal Xeon)
+MacPro3,1:Mac Pro (Early 2008)
PowerBook1,1:PowerBook G3
PowerBook2,1:iBook G3
PowerBook2,2:iBook G3 (FireWire)
@@ -20,50 +48,51 @@
PowerBook4,1:iBook G3 (Dual USB, Late 2001)
PowerBook4,2:iBook G3 (16MB VRAM)
PowerBook4,3:iBook G3 Opaque 16MB VRAM, 32MB VRAM, Early 2003)
-PowerBook5,1:PowerBook G4 (17 inch)
-PowerBook5,2:PowerBook G4 (15 inch FW 800)
+PowerBook5,1:PowerBook G4 (17-inch)
+PowerBook5,2:PowerBook G4 (15-inch FW800)
PowerBook5,3:PowerBook G4 (17-inch 1.33GHz)
-PowerBook5,4:PowerBook G4 (15 inch 1.5/1.33GHz)
+PowerBook5,4:PowerBook G4 (15-inch 1.5/1.33GHz)
PowerBook5,5:PowerBook G4 (17-inch 1.5GHz)
-PowerBook5,6:PowerBook G4 (15 inch 1.67GHz/1.5GHz)
+PowerBook5,6:PowerBook G4 (15-inch 1.67/1.5GHz)
PowerBook5,7:PowerBook G4 (17-inch 1.67GHz)
-PowerBook5,8:PowerBook G4 (Double layer SD, 15 inch)
-PowerBook5,9:PowerBook G4 (Double layer SD, 17 inch)
-PowerBook6,1:PowerBook G4 (12 inch)
-PowerBook6,2:PowerBook G4 (12 inch, DVI)
+PowerBook5,8:PowerBook G4 (Double-Layer SD, 15-inch)
+PowerBook5,9:PowerBook G4 (Double-Layer SD, 17-inch)
+PowerBook6,1:PowerBook G4 (12-inch)
+PowerBook6,2:PowerBook G4 (12-inch DVI)
PowerBook6,3:iBook G4
-PowerBook6,4:PowerBook G4 (12 inch 1.33GHz)
+PowerBook6,4:PowerBook G4 (12-inch 1.33GHz)
PowerBook6,5:iBook G4 (Early-Late 2004)
PowerBook6,7:iBook G4 (Mid 2005)
-PowerBook6,8:PowerBook G4 (12 inch 1.5GHz)
+PowerBook6,8:PowerBook G4 (12-inch 1.5GHz)
PowerMac1,1:Power Macintosh G3 (Blue & White)
-PowerMac1,2:Power Macintosh G4 (PCI Graphics)
-PowerMac2,1:iMac G3 (Slot-loading CD-ROM)
+PowerMac1,2:Power Macintosh G4 (PCI-Graphics)
+PowerMac2,1:iMac G3 (Slot-Loading)
PowerMac2,2:iMac G3 (Summer 2000)
-PowerMac3,1:Power Macintosh G4 (AGP Graphics)
-PowerMac3,2:Power Macintosh G4 (AGP Graphics)
+PowerMac3,1:Power Macintosh G4 (AGP-Graphics)
+PowerMac3,2:Power Macintosh G4 (AGP-Graphics)
PowerMac3,3:Power Macintosh G4 (Gigabit Ethernet)
PowerMac3,4:Power Macintosh G4 (Digital Audio)
PowerMac3,5:Power Macintosh G4 (Quick Silver)
-PowerMac3,6:Power Macintosh G4 (Mirrored Drive Door)
+PowerMac3,6:Power Macintosh G4 (Mirrored Drive Doors)
PowerMac4,1:iMac G3 (Early/Summer 2001)
PowerMac4,2:iMac G4 (Flat Panel)
-PowerMac4,4:eMac
+PowerMac4,4:eMac G3
PowerMac4,5:iMac G4 (17-inch Flat Panel)
PowerMac5,1:Power Macintosh G4 Cube
PowerMac6,1:iMac G4 (USB 2.0)
PowerMac6,3:iMac G4 (20-inch Flat Panel)
-PowerMac6,4:eMac (USB 2.0, 2005)
+PowerMac6,4:eMac (USB 2.0)
PowerMac7,2:Power Macintosh G5
PowerMac7,3:Power Macintosh G5
PowerMac8,1:iMac G5
PowerMac8,2:iMac G5 (Ambient Light Sensor)
-PowerMac9,1:Power Macintosh G5 (Late 2005)
+PowerMac9,1:Power Macintosh G5 (Late 2004)
PowerMac10,1:Mac Mini G4
PowerMac10,2:Mac Mini (Late 2005)
-PowerMac11,2:Power Macintosh G5 (Late 2005)
+PowerMac11,2:Power Macintosh G5 (PCIe, Late 2005)
PowerMac12,1:iMac G5 (iSight)
-Xserve1,1:Xserve
RackMac1,1:Xserve G4
-RackMac1,2:Xserve G4 (slot-loading, cluster node)
+RackMac1,2:Xserve G4 (Slot-Loading, Cluster Node)
RackMac3,1:Xserve G5
+Xserve1,1:Xserve Xeon
+Xserve2,1:Xserve Xeon
Modified: branches/stavangerkommune/phpsysinfo/data/distros.ini
===================================================================
--- branches/stavangerkommune/phpsysinfo/data/distros.ini 2014-03-12
14:19:06 UTC (rev 11811)
+++ branches/stavangerkommune/phpsysinfo/data/distros.ini 2014-03-13
14:55:26 UTC (rev 11812)
@@ -1,45 +1,44 @@
; linux-distros.ini - Defines known linux distros for phpSysInfo.
; http://phpsysinfo.sourceforge.net/
-; $Id: distros.ini 328 2009-09-07 09:58:01Z bigmichi1 $
+; $Id: distros.ini 709 2012-12-05 11:20:40Z namiltd $
;
-[Debian]
-Name = "Debian"
-Image = "Debian.png"
-Files = "/etc/debian_release;/etc/debian_version"
+[eisfair]
+Image = "Eisfair.png"
+Files = "/etc/eisfair-system"
+Files2 = "/etc/version"
-[SUSE LINUX]
-Image = "Suse.png"
-Files = "/etc/SuSE-release;/etc/UnitedLinux-release"
+[Tinycore]
+Image = "Tinycore.png"
+Name = "Tiny Core Linux"
+Files = "/usr/share/doc/tc/release.txt"
-[Mandrage]
-Image = "Mandrake.png"
-Files = "/etc/mandrake-release"
+[Frugalware]
+Image = "Frugalware.png"
+Files = "/etc/frugalware-release"
-[MandrivaLinux]
-Image = "Mandrake.png"
-Files = "/etc/mandrake-release"
+[antiX]
+Image = "antiX.png"
+Files = "/etc/antix-version"
-[Gentoo]
-Image = "Gentoo.png"
-Files = "/etc/gentoo-release"
+[IPFire]
+Image = "IPFire.png"
+;detected in "/etc/system-release"
-[Fedora]
-Image = "Fedora.png"
-Files = "/etc/fedora-release"
+[CRUX]
+Image = "Crux.png"
+Mode = "Execute"
+Files = "/usr/bin/crux"
-[FedoraCore]
-Image = "Fedora.png"
-Files = "/etc/fedora-release"
+[Foresight]
+Image = "Foresight.png"
+;detected in "/etc/distro-release"
-[RedHat]
-Image = "Redhat.png"
-Files = "/etc/redhat-release;/etc/redhat_version"
+[Android]
+Name = "Android"
+Image = "Android.png"
+;detected in "/system/build.prop"
-[Slackware]
-Image = "Slackware.png"
-Files = "/etc/slackware-release;/etc/slackware-version"
-
[Trustix]
Image = "Trustix.png"
Files = "/etc/trustix-release;/etc/trustix-version"
@@ -48,6 +47,23 @@
Image = "free-eos.png"
Files = "/etc/eos-version"
+[Manjaro Linux]
+Image = "Manjaro.png"
+;detected in "/etc/os-release"
+
+[ManjaroLinux]
+Image = "Manjaro.png"
+Files = "/etc/manjaro-release"
+;detected in "/etc/lsb-release"
+
+[Arch Linux]
+Image = "Arch.png"
+;detected in "/etc/os-release"
+
+[arch]
+Image = "Arch.png"
+Name = "Arch Linux"
+
[Arch]
Image = "Arch.png"
Files = "/etc/arch-release"
@@ -64,43 +80,292 @@
Image = "Rubix.png"
Files = "/etc/rubix-version"
+[Linaro]
+Image = "Linaro.png"
+;detected in "/etc/lsb-release"
+
+[LinuxDeepin]
+Image = "Deepin.png"
+;detected in "/etc/lsb-release"
+
+[elementary OS]
+Image = "elementaryOS.png"
+;detected in "/etc/lsb-release"
+
+[PearLinux]
+Image = "Pear.png"
+;detected in "/etc/lsb-release"
+
+[Pear Linux]
+Image = "Pear.png"
+;detected in "/etc/lsb-release"
+
+[PearOS]
+Image = "Pear.png"
+;detected in "/etc/lsb-release"
+
+[SolusOS]
+Image = "SolusOS.png"
+Files = "/etc/solusos_version"
+;detected in "/etc/lsb-release"
+
+[LinuxMint]
+Image = "Mint.png"
+;detected in "/etc/lsb-release"
+
+[Trisquel]
+Image = "Trisquel.png"
+;detected in "/etc/lsb-release"
+
+[Zorin]
+Image = "Zorin.png"
+;detected in "/etc/lsb-release"
+
+[Netrunner]
+Image = "Netrunner.png"
+;detected in "/etc/lsb-release"
+;detected in "/etc/os-release"
+
+[Peppermint]
+Image = "Peppermint.png"
+;detected in "/etc/lsb-release"
+;detected in "/etc/os-release"
+
[Ubuntu]
Image = "Ubuntu.png"
-Files = "/etc/lsb-release"
+;detected in "/etc/lsb-release"
+;detected in "/etc/os-release"
-[PLD]
-Image = "PLD.gif"
-Files = "/etc/pld-release"
+[Chakra]
+Image = "Chakra.png"
+;detected in "/etc/lsb-release"
-[CentOS]
-Image = "CentOS.png"
-Files = "/etc/redhat-release;/etc/redhat_version"
+[IYCC]
+Image = "iycc.png"
+;detected in "/etc/lsb-release"
-[RedHatEnterpriseES]
-Image = "Redhat.png"
-Files = "/etc/redhat-release;/etc/redhat_version"
+[Mageia]
+Image = "Mageia.png"
+Files = "/etc/mageia-release"
-[RedHatEnterpriseAS]
-Image = "Redhat.png"
-Files = "/etc/redhat-release;/etc/redhat_version"
+[PLD]
+Image = "PLD.png"
+Files = "/etc/pld-release"
[LFS]
Image = "lfs.png"
Files = "/etc/lfs-release;/etc/lfs_version"
[HLFS]
-Image = "hlfs.png"
+Image = "lfs.png"
Files = "/etc/hlfs-release;/etc/hlfs_version"
-[IYCC]
-Image = "iycc.png"
-Files = "/etc/lsb-release"
-
[Synology]
-Name = "Synology"
Image = "Synology.png"
+Mode = "Detection"
Files = "/etc/synoinfo.conf"
-[arch]
-Image = "Arch.png"
-Name = "Arch Linux"
+[Alpine]
+Name = "Alpine"
+Image = "Alpine.png"
+Files = "/etc/alpine-release"
+
+[Puppy]
+Image = "Puppy.png"
+;detected in "/etc/DISTRO_SPECS"
+
+[Lucid]
+Name = "Lucid Puppy"
+Image = "Puppy.png"
+;detected in "/etc/DISTRO_SPECS"
+
+[Slacko Puppy]
+Image = "Puppy.png"
+;detected in "/etc/DISTRO_SPECS"
+
+[Wary Puppy]
+Image = "Puppy.png"
+;detected in "/etc/DISTRO_SPECS"
+
+[Turbolinux]
+Image = "Turbo.png"
+Files = "/etc/turbolinux-release"
+
+[StartOS]
+Image = "StartOS.png"
+Files = "/etc/startos-release"
+
+[Scientific]
+Image = "Scientific.png"
+;detected in "/etc/redhat-release"
+
+[Scientific Linux]
+Image = "Scientific.png"
+;detected in "/etc/redhat-release"
+
+[ScientificSL]
+Image = "Scientific.png"
+;detected in "/etc/redhat-release"
+
+[ScientificCERNSLC]
+Image = "Scientific.png"
+;detected in "/etc/redhat-release"
+
+[ScientificFermiLTS]
+Image = "Scientific.png"
+;detected in "/etc/redhat-release"
+
+[ScientificSLF]
+Image = "Scientific.png"
+;detected in "/etc/redhat-release"
+
+[ClearOS]
+Image = "ClearOS.png"
+Files = "/etc/clearos-release"
+;detected in "/etc/redhat-release"
+
+[CloudLinuxServer]
+Image = "CloudLinux.png"
+;detected in "/etc/lsb-release"
+
+[CloudLinux]
+Image = "CloudLinux.png"
+Files = "/etc/CloudLinux-release"
+;detected in "/etc/redhat-release"
+
+[CentOS]
+Image = "CentOS.png"
+Files = "/etc/centos-release"
+;detected in "/etc/redhat-release"
+
+[Oracle]
+Image = "Oracle.png"
+Files = "/etc/oracle-release"
+;detected in "/etc/redhat-release"
+
+[OracleServer]
+Image = "Oracle.png"
+Files = "/etc/oracle-release"
+;detected in "/etc/redhat-release"
+
+[RosaDesktop.Marathon]
+Image = "ROSA.png"
+;detected in "/etc/lsb-release"
+;detected in "/etc/redhat-release"
+
+[PCLinuxOS]
+Image = "PCLinuxOS.png"
+Files = "/etc/pclinuxos-release"
+
+[Salix]
+Image = "Salix.png"
+Mode = "Detection"
+Files = "/etc/salix-update-notifier.conf"
+Files2 = "/etc/slackware-version"
+
+[Slax]
+Image = "Slax.png"
+Files = "/etc/slax-version"
+
+[SMS]
+Image = "SMS.png"
+Files = "/etc/sms-version"
+;detected in "/etc/os-release"
+
+[Porteus]
+Image = "Porteus.png"
+Files = "/etc/porteus-version"
+
+[Vector]
+Image = "Vector.png"
+Files = "/etc/vector-version"
+
+[Sabayon]
+Image = "Sabayon.png"
+Files = "/etc/sabayon-release"
+
+[ALT]
+Image = "ALT.png"
+Files = "/etc/altlinux-release"
+;detected in "/etc/redhat-release"
+
+[Fuduntu]
+Image = "Fuduntu.png"
+Files = "/etc/fuduntu-release"
+;detected in "/etc/lsb-release"
+;detected in "/etc/redhat-release"
+
+[gNewSense]
+Image = "gNewSense.png"
+;detected in "/etc/lsb-release"
+
+[Debian GNU/Linux]
+Image = "Debian.png"
+;detected in "/etc/os-release"
+
+[Debian]
+Name = "Debian"
+Image = "Debian.png"
+Files = "/etc/debian_release"
+;detected in "/etc/debian_version"
+
+[openSUSE project]
+Image = "Suse.png"
+;detected in "/etc/lsb-release"
+
+; at the end because some distros may also have the same files (like openSUSE)
+[SUSE LINUX]
+Image = "Suse.png"
+Files = "/etc/SuSE-release;/etc/UnitedLinux-release"
+
+; at the end because some distros may also have the same files (like Sabayon)
+[Gentoo]
+Image = "Gentoo.png"
+Files = "/etc/gentoo-release"
+
+; at the end because some distros may also have the same files (like Salix,
Slax, SMS, Porteus, Vector)
+[Slackware]
+Image = "Slackware.png"
+Files = "/etc/slackware-release;/etc/slackware-version"
+;detected in "/etc/os-release"
+
+; at the end because some distros may also have the same files (like Fuduntu,
ALT etc)
+[Fedora]
+Image = "Fedora.png"
+Files = "/etc/fedora-release"
+;detected in "/etc/os-release"
+
+[FedoraCore]
+Image = "Fedora.png"
+Files = "/etc/fedora-release"
+
+; at the end because some distros may also have the same files (like
PCLinuxOS, RosaDesktop.Marathon etc)
+[MandrivaLinux]
+Image = "Mandrake.png"
+Files = "/etc/mandiva-release"
+
+; at the end because some distros may also have the same files (like
MandivaLinux, PCLinuxOS, RosaDesktop.Marathon 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, CloudLinux, CloudLinuxServer, Mandrake, MandivaLinux,
PCLinuxOS, RosaDesktop.Marathon etc)
+[RedHat]
+Image = "Redhat.png"
+Files = "/etc/redhat_version"
+;detected in "/etc/redhat-release"
+
+[RedHatEnterpriseES]
+Image = "Redhat.png"
+Files = "/etc/redhat_version"
+;detected in "/etc/redhat-release"
+
+[RedHatEnterpriseAS]
+Image = "Redhat.png"
+Files = "/etc/redhat_version"
+;detected in "/etc/redhat-release"
+
+[RedHatEnterpriseServer]
+Image = "Redhat.png"
+Files = "/etc/redhat_version"
+;detected in "/etc/redhat-release"
Modified: branches/stavangerkommune/phpsysinfo/gfx/attention.png
===================================================================
(Binary files differ)
Modified: branches/stavangerkommune/phpsysinfo/gfx/body.gif
===================================================================
(Binary files differ)
Modified: branches/stavangerkommune/phpsysinfo/gfx/images/CentOS.png
===================================================================
(Binary files differ)
Modified: branches/stavangerkommune/phpsysinfo/gfx/images/Cobalt.png
===================================================================
(Binary files differ)
Modified: branches/stavangerkommune/phpsysinfo/gfx/images/Debian.png
===================================================================
(Binary files differ)
Modified: branches/stavangerkommune/phpsysinfo/gfx/images/DragonFly.png
===================================================================
(Binary files differ)
Modified: branches/stavangerkommune/phpsysinfo/gfx/images/Fedora.png
===================================================================
(Binary files differ)
Modified: branches/stavangerkommune/phpsysinfo/gfx/images/FreeBSD.png
===================================================================
(Binary files differ)
Modified: branches/stavangerkommune/phpsysinfo/gfx/images/Gentoo.png
===================================================================
(Binary files differ)
Modified: branches/stavangerkommune/phpsysinfo/gfx/images/NetBSD.png
===================================================================
(Binary files differ)
Modified: branches/stavangerkommune/phpsysinfo/gfx/images/ReactOS.png
===================================================================
(Binary files differ)
Modified: branches/stavangerkommune/phpsysinfo/gfx/images/Redhat.png
===================================================================
(Binary files differ)
Modified: branches/stavangerkommune/phpsysinfo/gfx/images/Rubix.png
===================================================================
(Binary files differ)
Modified: branches/stavangerkommune/phpsysinfo/gfx/images/SunOS.png
===================================================================
(Binary files differ)
Modified: branches/stavangerkommune/phpsysinfo/gfx/images/Synology.png
===================================================================
(Binary files differ)
Modified: branches/stavangerkommune/phpsysinfo/gfx/images/Trustix.png
===================================================================
(Binary files differ)
Modified: branches/stavangerkommune/phpsysinfo/gfx/images/Ubuntu.png
===================================================================
(Binary files differ)
Modified: branches/stavangerkommune/phpsysinfo/gfx/images/free-eos.png
===================================================================
(Binary files differ)
Modified: branches/stavangerkommune/phpsysinfo/gfx/images/lfs.png
===================================================================
(Binary files differ)
Modified: branches/stavangerkommune/phpsysinfo/gfx/images/unknown.png
===================================================================
(Binary files differ)
Modified: branches/stavangerkommune/phpsysinfo/gfx/next.gif
===================================================================
(Binary files differ)
Modified: branches/stavangerkommune/phpsysinfo/gfx/prev.gif
===================================================================
(Binary files differ)
Modified: branches/stavangerkommune/phpsysinfo/gfx/reload.png
===================================================================
(Binary files differ)
Modified:
branches/stavangerkommune/phpsysinfo/gfx/treeTable/tv-expandable-last.gif
===================================================================
(Binary files differ)
Modified: branches/stavangerkommune/phpsysinfo/gfx/treeTable/tv-expandable.gif
===================================================================
(Binary files differ)
Modified: branches/stavangerkommune/phpsysinfo/inc/class.menu.inc.php
===================================================================
--- branches/stavangerkommune/phpsysinfo/inc/class.menu.inc.php 2014-03-12
14:19:06 UTC (rev 11811)
+++ branches/stavangerkommune/phpsysinfo/inc/class.menu.inc.php 2014-03-13
14:55:26 UTC (rev 11812)
@@ -29,7 +29,7 @@
/**
* Menus
*
- * @package property
+ * @package phpsysinfo
*/
class phpsysinfo_menu
{
@@ -43,42 +43,22 @@
$incoming_app =
$GLOBALS['phpgw_info']['flags']['currentapp'];
$GLOBALS['phpgw_info']['flags']['currentapp'] =
'phpsysinfo';
-/*
- $menus['navbar'] = array
- (
- 'phpsysinfo' => array
- (
- 'text' => lang('phpsysinfo'),
- 'url' =>
$GLOBALS['phpgw']->link('/phpsysinfo/index.php'),
- 'image' => array('phpsysinfo',
'navbar'),
- 'order' => 35,
- 'group' => 'system tools'
- ),
- );
-*/
$menus['toolbar'] = array();
if (
isset($GLOBALS['phpgw_info']['user']['apps']['admin']) )
{
- $menus['admin'] = array
- (
- 'phpsysinfo' => array
+ $menus['admin'][] = array
(
'text' => lang('phpsysinfo'),
'url' =>
$GLOBALS['phpgw']->link('/phpsysinfo/index.php')
- ),
+ . '"
onclick="window.open(\''
+ .
$GLOBALS['phpgw']->link('/phpsysinfo/index.php')
+ . '\'); return
false;"',
+ 'image' => array('admin', 'php')
);
+
}
-/*
- $menus['navigation'] = array
- (
- 'user' => array
- (
- 'text' => lang('phpsysinfo'),
- 'url' =>
$GLOBALS['phpgw']->link('phpsysinfo/index.php')
- )
- );
-*/
+
$GLOBALS['phpgw_info']['flags']['currentapp'] =
$incoming_app;
return $menus;
}
Modified: branches/stavangerkommune/phpsysinfo/includes/autoloader.inc.php
===================================================================
--- branches/stavangerkommune/phpsysinfo/includes/autoloader.inc.php
2014-03-12 14:19:06 UTC (rev 11811)
+++ branches/stavangerkommune/phpsysinfo/includes/autoloader.inc.php
2014-03-13 14:55:26 UTC (rev 11812)
@@ -24,12 +24,26 @@
*/
function __autoload($class_name)
{
- $class_name = str_replace('-', '', $class_name);
- $dirs = array('/plugins/'.$class_name.'/', '/includes/',
'/includes/interface/', '/includes/to/', '/includes/to/device/',
'/includes/os/', '/includes/mb/', '/includes/plugin/', '/includes/xml/',
'/includes/web/', '/includes/error/', '/includes/js/', '/includes/output/',
'/includes/ups/');
+ //$class_name = str_replace('-', '', $class_name);
+
+ /* case-insensitive folders */
+ $dirs = array('/plugins/'.strtolower($class_name).'/', '/includes/mb/',
'/includes/ups/');
+
+ foreach ($dirs as $dir) {
+ if
(file_exists(APP_ROOT.$dir.'class.'.strtolower($class_name).'.inc.php')) {
+ include_once
APP_ROOT.$dir.'class.'.strtolower($class_name).'.inc.php';
+
+ return;
+ }
+ }
+
+ /* case-sensitive folders */
+ $dirs = array('/includes/', '/includes/interface/', '/includes/to/',
'/includes/to/device/', '/includes/os/', '/includes/plugin/', '/includes/xml/',
'/includes/web/', '/includes/error/', '/includes/js/', '/includes/output/');
foreach ($dirs as $dir) {
if (file_exists(APP_ROOT.$dir.'class.'.$class_name.'.inc.php')) {
include_once APP_ROOT.$dir.'class.'.$class_name.'.inc.php';
+
return;
}
}
@@ -57,4 +71,3 @@
}
set_error_handler('errorHandlerPsi');
-?>
Modified:
branches/stavangerkommune/phpsysinfo/includes/class.CommonFunctions.inc.php
===================================================================
--- branches/stavangerkommune/phpsysinfo/includes/class.CommonFunctions.inc.php
2014-03-12 14:19:06 UTC (rev 11811)
+++ branches/stavangerkommune/phpsysinfo/includes/class.CommonFunctions.inc.php
2014-03-13 14:55:26 UTC (rev 11812)
@@ -25,12 +25,30 @@
*/
class CommonFunctions
{
- /**
- * phpSysInfo version
- *
- * @var string
- */
- const PSI_VERSION = '3.0.4';
+ private static function _parse_log_file($string)
+ {
+ if (defined('PSI_LOG') && is_string(PSI_LOG) && (strlen(PSI_LOG)>0) &&
((substr(PSI_LOG, 0, 1)=="-") || (substr(PSI_LOG, 0, 1)=="+"))) {
+ $log_file = substr(PSI_LOG, 1);
+ if (file_exists($log_file)) {
+ $contents = @file_get_contents($log_file);
+ if ($contents && preg_match("/^\-\-\-[^-\n]+\-\-\-
".preg_quote($string, '/')."\n/m", $contents, $matches, PREG_OFFSET_CAPTURE)) {
+ $findIndex = $matches[0][1];
+ if (preg_match("/\n/m", $contents, $matches,
PREG_OFFSET_CAPTURE, $findIndex)) {
+ $startIndex = $matches[0][1]+1;
+ if (preg_match("/^\-\-\-[^-\n]+\-\-\- /m", $contents,
$matches, PREG_OFFSET_CAPTURE, $startIndex)) {
+ $stopIndex = $matches[0][1];
+
+ return substr($contents, $startIndex,
$stopIndex-$startIndex );
+ } else {
+ return substr($contents, $startIndex );
+ }
+ }
+ }
+ }
+ }
+
+ return false;
+ }
/**
* Find a system program, do also path checking when not running on WINNT
@@ -42,31 +60,55 @@
*/
private static function _findProgram($strProgram)
{
+ $path_parts = pathinfo($strProgram);
+ if (empty($path_parts['basename'])) {
+ return;
+ }
$arrPath = array();
- if (PHP_OS == 'WINNT') {
+ if ((PSI_OS == 'WINNT') && empty($path_parts['extension'])) {
$strProgram .= '.exe';
+ $path_parts = pathinfo($strProgram);
+ }
+ if (empty($path_parts['dirname']) || ($path_parts['dirname'] == '.')) {
+ if (PSI_OS == 'WINNT') {
$arrPath = preg_split('/;/', getenv("Path"), -1,
PREG_SPLIT_NO_EMPTY);
} else {
$arrPath = preg_split('/:/', getenv("PATH"), -1,
PREG_SPLIT_NO_EMPTY);
}
- if (PSI_ADD_PATHS !== false) {
- $addpaths = preg_split('/,/', PSI_ADD_PATHS, -1,
PREG_SPLIT_NO_EMPTY);
- $arrPath = array_merge($addpaths, $arrPath); // In this order so
$addpaths is before $arrPath when looking for a program
+ } else {
+ array_push($arrPath, $path_parts['dirname']);
+ $strProgram = $path_parts['basename'];
+ }
+ if ( defined('PSI_ADD_PATHS') && is_string(PSI_ADD_PATHS) ) {
+ if (preg_match(ARRAY_EXP, PSI_ADD_PATHS)) {
+ $arrPath = array_merge(eval(PSI_ADD_PATHS), $arrPath); // In
this order so $addpaths is before $arrPath when looking for a program
+ } else {
+ $arrPath = array_merge(array(PSI_ADD_PATHS), $arrPath); // In
this order so $addpaths is before $arrPath when looking for a program
+ }
}
//add some default paths if we still have no paths here
- if ( empty($arrPath) && PHP_OS != 'WINNT') {
+ if (empty($arrPath) && PSI_OS != 'WINNT') {
+ if (PSI_OS == 'Android') {
+ array_push($arrPath, '/system/bin');
+ } else {
array_push($arrPath, '/bin', '/sbin', '/usr/bin', '/usr/sbin',
'/usr/local/bin', '/usr/local/sbin');
}
+ }
// If open_basedir defined, fill the $open_basedir array with
authorized paths,. (Not tested when no open_basedir restriction)
- if ((bool)ini_get('open_basedir')) {
+ if ((bool) ini_get('open_basedir')) {
$open_basedir = preg_split('/:/', ini_get('open_basedir'), -1,
PREG_SPLIT_NO_EMPTY);
}
foreach ($arrPath as $strPath) {
// To avoid "open_basedir restriction in effect" error when
testing paths if restriction is enabled
- if ((isset($open_basedir) && !in_array($strPath, $open_basedir))
|| !is_dir($strPath)) {
+ if ((isset($open_basedir) && !in_array($strPath, $open_basedir)) ||
+ !(((PSI_OS == 'Android') && ($strPath=='/system/bin')) ||
is_dir($strPath))) { //is_dir('/system/bin') Android patch
continue;
}
- $strProgrammpath = $strPath."/".$strProgram;
+ if (PSI_OS == 'WINNT') {
+ $strProgrammpath = rtrim($strPath,'\\').'\\'.$strProgram;
+ } else {
+ $strProgrammpath = rtrim($strPath,"/")."/".$strProgram;
+ }
if (is_executable($strProgrammpath)) {
return $strProgrammpath;
}
@@ -88,6 +130,21 @@
*/
public static function executeProgram($strProgramname, $strArgs,
&$strBuffer, $booErrorRep = true)
{
+ if (defined('PSI_LOG') && is_string(PSI_LOG) && (strlen(PSI_LOG)>0) &&
((substr(PSI_LOG, 0, 1)=="-") || (substr(PSI_LOG, 0, 1)=="+"))) {
+ $out = self::_parse_log_file("Executing: ".trim($strProgramname.'
'.$strArgs));
+ if ($out == false) {
+ if (substr(PSI_LOG, 0, 1)=="-") {
+ $strBuffer = '';
+
+ return false;
+ }
+ } else {
+ $strBuffer = $out;
+
+ return true;
+ }
+ }
+
$strBuffer = '';
$strError = '';
$pipes = array();
@@ -97,6 +154,7 @@
if ($booErrorRep) {
$error->addError('find_program('.$strProgramname.')', 'program
not found on the machine');
}
+
return false;
}
// see if we've gotten a |, if we have we need to do path checking on
the cmd
@@ -111,25 +169,43 @@
}
}
$descriptorspec = array(0=>array("pipe", "r"), 1=>array("pipe", "w"),
2=>array("pipe", "w"));
+ if (defined("PSI_MODE_POPEN") && PSI_MODE_POPEN === true) {
+ $process = $pipes[1] = popen($strProgram." ".$strArgs."
2>/dev/null", "r");
+ } else {
$process = proc_open($strProgram." ".$strArgs, $descriptorspec,
$pipes);
+ }
if (is_resource($process)) {
- $strBuffer .= self::_timeoutfgets($pipes, $strBuffer, $strError);
+ self::_timeoutfgets($pipes, $strBuffer, $strError);
+ if (defined("PSI_MODE_POPEN") && PSI_MODE_POPEN === true) {
+ $return_value = pclose($pipes[1]);
+ } else {
+ fclose($pipes[0]);
+ fclose($pipes[1]);
+ fclose($pipes[2]);
+ // It is important that you close any pipes before calling
+ // proc_close in order to avoid a deadlock
$return_value = proc_close($process);
}
- $strError = trim($strError);
- $strBuffer = trim($strBuffer);
- if (! empty($strError) && $return_value <> 0) {
+ } else {
if ($booErrorRep) {
- $error->addError($strProgram, $strError."\nReturn value:
".$return_value);
+ $error->addError($strProgram, "\nOpen process error");
}
+
return false;
}
+ $strError = trim($strError);
+ $strBuffer = trim($strBuffer);
+ if (defined('PSI_LOG') && is_string(PSI_LOG) && (strlen(PSI_LOG)>0) &&
(substr(PSI_LOG, 0, 1)!="-") && (substr(PSI_LOG, 0, 1)!="+")) {
+ error_log("---".gmdate('r T')."--- Executing:
".trim($strProgramname.' '.$strArgs)."\n".$strBuffer."\n", 3, PSI_LOG);
+ }
if (! empty($strError)) {
if ($booErrorRep) {
$error->addError($strProgram, $strError."\nReturn value:
".$return_value);
}
- return true;
+
+ return $return_value == 0;
}
+
return true;
}
@@ -146,10 +222,26 @@
*/
public static function rfts($strFileName, &$strRet, $intLines = 0,
$intBytes = 4096, $booErrorRep = true)
{
+ if (defined('PSI_LOG') && is_string(PSI_LOG) && (strlen(PSI_LOG)>0) &&
((substr(PSI_LOG, 0, 1)=="-") || (substr(PSI_LOG, 0, 1)=="+"))) {
+ $out = self::_parse_log_file("Reading: ".$strFileName);
+ if ($out == false) {
+ if (substr(PSI_LOG, 0, 1)=="-") {
+ $strRet = '';
+
+ return false;
+ }
+ } else {
+ $strRet = $out;
+
+ return true;
+ }
+ }
+
$strFile = "";
$intCurLine = 1;
$error = Error::singleton();
if (file_exists($strFileName)) {
+ if (is_readable($strFileName)) {
if ($fd = fopen($strFileName, 'r')) {
while (!feof($fd)) {
$strFile .= fgets($fd, $intBytes);
@@ -161,18 +253,31 @@
}
fclose($fd);
$strRet = $strFile;
+ if (defined('PSI_LOG') && is_string(PSI_LOG) &&
(strlen(PSI_LOG)>0) && (substr(PSI_LOG, 0, 1)!="-") && (substr(PSI_LOG, 0,
1)!="+")) {
+ error_log("---".gmdate('r T')."--- Reading:
".$strFileName."\n".$strRet, 3, PSI_LOG);
+ }
} else {
if ($booErrorRep) {
$error->addError('fopen('.$strFileName.')', 'file can not
read by phpsysinfo');
}
+
+ return false;
+ }
+ } else {
+ if ($booErrorRep) {
+ $error->addError('fopen('.$strFileName.')', 'file
permission error');
+ }
+
return false;
}
} else {
if ($booErrorRep) {
$error->addError('file_exists('.$strFileName.')', 'the file
does not exist on your machine');
}
+
return false;
}
+
return true;
}
@@ -206,6 +311,7 @@
$error->addError('is_dir('.$strPath.')', 'directory does not
exist on your machine');
}
}
+
return $arrDirectoryContent;
}
@@ -224,7 +330,12 @@
*/
public static function checkForExtensions($arrExt = array())
{
- $arrReq = array('simplexml', 'pcre', 'xml', 'mbstring');
+ if ((strcasecmp(PSI_SYSTEM_CODEPAGE,"UTF-8") == 0) ||
(strcasecmp(PSI_SYSTEM_CODEPAGE,"CP437") == 0))
+ $arrReq = array('simplexml', 'pcre', 'xml', 'dom');
+ elseif (PSI_OS == "WINNT")
+ $arrReq = array('simplexml', 'pcre', 'xml', 'mbstring', 'dom',
'com_dotnet');
+ else
+ $arrReq = array('simplexml', 'pcre', 'xml', 'mbstring', 'dom');
$extensions = array_merge($arrExt, $arrReq);
$text = "";
$error = false;
@@ -247,51 +358,118 @@
}
}
-
/**
* get the content of stdout/stderr with the option to set a timeout for
reading
*
* @param array $pipes array of file pointers for stdin, stdout, stderr
(proc_open())
* @param string &$out target string for the output message (reference)
* @param string &$err target string for the error message (reference)
- * @param integer $sek timeout value in seconds
+ * @param integer $timeout timeout value in seconds (default value is 30)
*
* @return void
*/
- private static function _timeoutfgets($pipes, &$out, &$err, $sek = 10)
+ private static function _timeoutfgets($pipes, &$out, &$err, $timeout = 30)
{
- // fill output string
- $time = $sek;
- $w = null;
- $e = null;
+ $w = NULL;
+ $e = NULL;
- while ($time >= 0) {
+ if (defined("PSI_MODE_POPEN") && PSI_MODE_POPEN === true) {
+ $pipe2 = false;
+ } else {
+ $pipe2 = true;
+ }
+ while (!(feof($pipes[1]) || ($pipe2 && feof($pipes[2])))) {
+ if ($pipe2) {
+ $read = array($pipes[1], $pipes[2]);
+ } else {
$read = array($pipes[1]);
- while (!feof($read[0]) && ($n = stream_select($read, $w, $e,
$time)) !== false && $n > 0 && strlen($c = fgetc($read[0])) > 0) {
- $out .= $c;
}
- --$time;
+
+ $n = stream_select($read, $w, $e, $timeout);
+
+ if ($n === FALSE) {
+ error_log('stream_select: failed !');
+ break;
+ }
+ else if ($n === 0) {
+ error_log('stream_select: timeout expired !');
+ break;
+ }
+
+ foreach ($read as $r) {
+ if ($r == $pipes[1]) {
+ $out .= fread($r, 4096);
+ }
+ if ($pipe2 && ($r == $pipes[2])) {
+ $err .= fread($r, 4096);
}
- // fill error string
- $time = $sek;
- while ($time >= 0) {
- $read = array($pipes[2]);
- while (!feof($read[0]) && ($n = stream_select($read, $w, $e,
$time)) !== false && $n > 0 && strlen($c = fgetc($read[0])) > 0) {
- $err .= $c;
}
- --$time;
}
}
/**
+ * function for getting a list of values in the specified context
+ * optionally filter this list, based on the list from third parameter
+ *
+ * @param $wmi holds the COM object that we pull the WMI data from
+ * @param string $strClass name of the class where the values are stored
+ * @param array $strValue filter out only needed values, if not set all
values of the class are returned
+ *
+ * @return array content of the class stored in an array
+ */
+ public static function getWMI($wmi, $strClass, $strValue = array())
+ {
+ $arrData = array();
+ if ($wmi) {
+ $value = "";
+ try {
+ $objWEBM = $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;
+ }
+ } catch (Exception $e) {
+ if (PSI_DEBUG) {
+ $this->error->addError($e->getCode(), $e->getMessage());
+ }
+ }
+ }
+
+ return $arrData;
+ }
+
+ /**
* get all configured plugins from config.php (file must be included
before calling this function)
*
* @return array
*/
public static function getPlugins()
{
- $plugins = preg_split("/[\s]?,[\s]?/", PSI_PLUGINS, -1,
PREG_SPLIT_NO_EMPTY);
- return $plugins;
+ if ( defined('PSI_PLUGINS') && is_string(PSI_PLUGINS) ) {
+ if (preg_match(ARRAY_EXP, PSI_PLUGINS)) {
+ return eval(strtolower(PSI_PLUGINS));
+ } else {
+ return array(strtolower(PSI_PLUGINS));
+ }
+ } else {
+ return array();
+ }
}
}
-?>
Modified: branches/stavangerkommune/phpsysinfo/includes/class.Parser.inc.php
===================================================================
--- branches/stavangerkommune/phpsysinfo/includes/class.Parser.inc.php
2014-03-12 14:19:06 UTC (rev 11811)
+++ branches/stavangerkommune/phpsysinfo/includes/class.Parser.inc.php
2014-03-13 14:55:26 UTC (rev 11812)
@@ -36,13 +36,18 @@
if (CommonFunctions::executeProgram("lspci", "", $strBuf, PSI_DEBUG)) {
$arrLines = preg_split("/\n/", $strBuf, -1, PREG_SPLIT_NO_EMPTY);
foreach ($arrLines as $strLine) {
- list($strAddr, $strName) = preg_split('/ /', trim($strLine),
2);
+ $arrParams = preg_split('/ /', trim($strLine), 2);
+ if (count($arrParams) == 2)
+ $strName = $arrParams[1];
+ else
+ $strName = "unknown";
$strName = preg_replace('/\(.*\)/', '', $strName);
$dev = new HWDevice();
$dev->setName($strName);
$arrResults[] = $dev;
}
}
+
return $arrResults;
}
@@ -74,6 +79,7 @@
$arrResults[] = $dev;
}
}
+
return $arrResults;
}
@@ -105,22 +111,29 @@
foreach ($mount as $mount_line) {
if (preg_match("/\S+ on (\S+) type (.*) \((.*)\)/",
$mount_line, $mount_buf)) {
$mount_parm[$mount_buf[1]]['fstype'] = $mount_buf[2];
- $mount_parm[$mount_buf[1]]['options'] = $mount_buf[3];
+ if (PSI_SHOW_MOUNT_OPTION)
$mount_parm[$mount_buf[1]]['options'] = $mount_buf[3];
+ } elseif (preg_match("/\S+ is (.*) mounted on (\S+) \(type
(.*)\)/", $mount_line, $mount_buf)) {
+ $mount_parm[$mount_buf[2]]['fstype'] = $mount_buf[3];
+ if (PSI_SHOW_MOUNT_OPTION)
$mount_parm[$mount_buf[2]]['options'] = $mount_buf[1];
} elseif (preg_match("/\S+ (.*) on (\S+) \((.*)\)/",
$mount_line, $mount_buf)) {
$mount_parm[$mount_buf[2]]['fstype'] = $mount_buf[1];
- $mount_parm[$mount_buf[2]]['options'] = $mount_buf[3];
- } elseif (preg_match("/\S+ on (\S+) \((\S+)(,\s(.*))?\)/",
$mount_line, $mount_buf)) {
+ if (PSI_SHOW_MOUNT_OPTION)
$mount_parm[$mount_buf[2]]['options'] = $mount_buf[3];
+ } elseif (preg_match("/\S+ on ([\S ]+)
\((\S+)(,\s(.*))?\)/", $mount_line, $mount_buf)) {
$mount_parm[$mount_buf[1]]['fstype'] = $mount_buf[2];
- $mount_parm[$mount_buf[1]]['options'] =
isset($mount_buf[4]) ? $mount_buf[4] : '';
+ if (PSI_SHOW_MOUNT_OPTION)
$mount_parm[$mount_buf[1]]['options'] = isset($mount_buf[4]) ? $mount_buf[4] :
'';
}
}
foreach ($df as $df_line) {
- $df_buf1 = preg_split("/(\%\s)/", $df_line, 2);
- if (count($df_buf1) != 2) {
+ $df_buf1 = preg_split("/(\%\s)/", $df_line, 3);
+ if (count($df_buf1) < 2) {
continue;
}
-
preg_match("/(.*)(\s+)(([0-9]+)(\s+)([0-9]+)(\s+)([0-9]+)(\s+)([0-9]+)$)/",
$df_buf1[0], $df_buf2);
+ if
(preg_match("/(.*)(\s+)(([0-9]+)(\s+)([0-9]+)(\s+)([\-0-9]+)(\s+)([0-9]+)$)/",
$df_buf1[0], $df_buf2)) {
+ if (count($df_buf1) == 3) {
+ $df_buf = array($df_buf2[1], $df_buf2[4],
$df_buf2[6], $df_buf2[8], $df_buf2[10], $df_buf1[2]);
+ } else {
$df_buf = array($df_buf2[1], $df_buf2[4], $df_buf2[6],
$df_buf2[8], $df_buf2[10], $df_buf1[1]);
+ }
if (count($df_buf) == 6) {
$df_buf[5] = trim($df_buf[5]);
$dev = new DiskDevice();
@@ -131,11 +144,36 @@
} else {
$dev->setTotal($df_buf[1] * 1024);
$dev->setUsed($df_buf[2] * 1024);
+ if ($df_buf[3]>0) {
$dev->setFree($df_buf[3] * 1024);
}
- $dev->setMountPoint($df_buf[5]);
+ }
+ if (PSI_SHOW_MOUNT_POINT)
$dev->setMountPoint($df_buf[5]);
+
+ if (isset($mount_parm[$df_buf[5]])) {
$dev->setFsType($mount_parm[$df_buf[5]]['fstype']);
+ if (PSI_SHOW_MOUNT_OPTION) {
+ if (PSI_SHOW_MOUNT_CREDENTIALS) {
$dev->setOptions($mount_parm[$df_buf[5]]['options']);
+ } else {
+
$mpo=$mount_parm[$df_buf[5]]['options'];
+
+
$mpo=preg_replace('/(^guest,)|(^guest$)|(,guest$)/i', '', $mpo);
+ $mpo=preg_replace('/,guest,/i', ',',
$mpo);
+
+
$mpo=preg_replace('/(^user=[^,]*,)|(^user=[^,]*$)|(,user=[^,]*$)/i', '', $mpo);
+ $mpo=preg_replace('/,user=[^,]*,/i',
',', $mpo);
+
+
$mpo=preg_replace('/(^username=[^,]*,)|(^username=[^,]*$)|(,username=[^,]*$)/i',
'', $mpo);
+
$mpo=preg_replace('/,username=[^,]*,/i', ',', $mpo);
+
+
$mpo=preg_replace('/(^password=[^,]*,)|(^password=[^,]*$)|(,password=[^,]*$)/i',
'', $mpo);
+
$mpo=preg_replace('/,password=[^,]*,/i', ',', $mpo);
+
+ $dev->setOptions($mpo);
+ }
+ }
+ }
if (PSI_SHOW_INODES &&
isset($df_inodes[trim($df_buf[0])])) {
$dev->setPercentInodesUsed($df_inodes[trim($df_buf[0])]);
}
@@ -144,7 +182,8 @@
}
}
}
+ }
+
return $arrResult;
}
}
-?>
Modified:
branches/stavangerkommune/phpsysinfo/includes/error/class.Error.inc.php
===================================================================
--- branches/stavangerkommune/phpsysinfo/includes/error/class.Error.inc.php
2014-03-12 14:19:06 UTC (rev 11811)
+++ branches/stavangerkommune/phpsysinfo/includes/error/class.Error.inc.php
2014-03-13 14:55:26 UTC (rev 11812)
@@ -67,6 +67,7 @@
$c = __CLASS__;
self::$_instance = new $c;
}
+
return self::$_instance;
}
@@ -161,7 +162,7 @@
$dom->appendChild($root);
$xml = new SimpleXMLExtended(simplexml_import_dom($dom), 'UTF-8');
$generation = $xml->addChild('Generation');
- $generation->addAttribute('version', CommonFunctions::PSI_VERSION);
+ $generation->addAttribute('version', PSI_VERSION_STRING);
$generation->addAttribute('timestamp', time());
$xmlerr = $xml->addChild("Errors");
foreach ($this->_arrErrorList as $arrLine) {
@@ -191,6 +192,7 @@
$error = $xmlerr->addCData('Error', $arrLine['message']);
$error->addAttribute('Function', $arrLine['command']);
}
+
return $xmlerr->getSimpleXmlElement();
}
/**
@@ -244,6 +246,7 @@
}
$strBacktrace .= "\n";
}
+
return $strBacktrace;
}
/**
@@ -258,6 +261,7 @@
if (is_string($var)) {
$search = array("\x00", "\x0a", "\x0d", "\x1a", "\x09");
$replace = array('\0', '\n', '\r', '\Z', '\t');
+
return ('"'.str_replace($search, $replace, $var).'"');
} elseif (is_bool($var)) {
if ($var) {
@@ -273,10 +277,10 @@
$strComma = ', ';
}
$strResult .= ' )';
+
return ($strResult);
}
// anything else, just let php try to print it
return (var_export($var, true));
}
}
-?>
Modified:
branches/stavangerkommune/phpsysinfo/includes/interface/class.PSI_Interface_OS.inc.php
===================================================================
---
branches/stavangerkommune/phpsysinfo/includes/interface/class.PSI_Interface_OS.inc.php
2014-03-12 14:19:06 UTC (rev 11811)
+++
branches/stavangerkommune/phpsysinfo/includes/interface/class.PSI_Interface_OS.inc.php
2014-03-13 14:55:26 UTC (rev 11812)
@@ -32,20 +32,19 @@
*
* @return string
*/
- function getEncoding();
+ public function getEncoding();
/**
* build the os information
*
* @return void
*/
- function build();
+ public function build();
/**
* get the filled or unfilled (with default values) system object
*
* @return System
*/
- function getSys();
+ public function getSys();
}
-?>
Modified:
branches/stavangerkommune/phpsysinfo/includes/interface/class.PSI_Interface_Output.inc.php
===================================================================
---
branches/stavangerkommune/phpsysinfo/includes/interface/class.PSI_Interface_Output.inc.php
2014-03-12 14:19:06 UTC (rev 11811)
+++
branches/stavangerkommune/phpsysinfo/includes/interface/class.PSI_Interface_Output.inc.php
2014-03-13 14:55:26 UTC (rev 11812)
@@ -31,6 +31,5 @@
*
* @return void
*/
- function run();
+ public function run();
}
-?>
Modified:
branches/stavangerkommune/phpsysinfo/includes/interface/class.PSI_Interface_Plugin.inc.php
===================================================================
---
branches/stavangerkommune/phpsysinfo/includes/interface/class.PSI_Interface_Plugin.inc.php
2014-03-12 14:19:06 UTC (rev 11811)
+++
branches/stavangerkommune/phpsysinfo/includes/interface/class.PSI_Interface_Plugin.inc.php
2014-03-13 14:55:26 UTC (rev 11812)
@@ -32,13 +32,12 @@
*
* @return void
*/
- function execute();
+ public function execute();
/**
* build the xml
*
* @return SimpleXMLObject entire XML content for the plugin which than
can be appended to the main XML
*/
- function xml();
+ public function xml();
}
-?>
Modified:
branches/stavangerkommune/phpsysinfo/includes/interface/class.PSI_Interface_Sensor.inc.php
===================================================================
---
branches/stavangerkommune/phpsysinfo/includes/interface/class.PSI_Interface_Sensor.inc.php
2014-03-12 14:19:06 UTC (rev 11811)
+++
branches/stavangerkommune/phpsysinfo/includes/interface/class.PSI_Interface_Sensor.inc.php
2014-03-13 14:55:26 UTC (rev 11812)
@@ -32,13 +32,12 @@
*
* @return void
*/
- function build();
+ public function build();
/**
* get the filled or unfilled (with default values) MBInfo object
*
* @return MBInfo
*/
- function getMBInfo();
+ public function getMBInfo();
}
-?>
Modified:
branches/stavangerkommune/phpsysinfo/includes/interface/class.PSI_Interface_UPS.inc.php
===================================================================
---
branches/stavangerkommune/phpsysinfo/includes/interface/class.PSI_Interface_UPS.inc.php
2014-03-12 14:19:06 UTC (rev 11811)
+++
branches/stavangerkommune/phpsysinfo/includes/interface/class.PSI_Interface_UPS.inc.php
2014-03-13 14:55:26 UTC (rev 11812)
@@ -31,13 +31,12 @@
*
* @return void
*/
- function build();
+ public function build();
/**
* get the filled or unfilled (with default values) UPSInfo object
*
* @return UPSInfo
*/
- function getUPSInfo();
+ public function getUPSInfo();
}
-?>
Modified:
branches/stavangerkommune/phpsysinfo/includes/js/class.JavaScriptPacker.inc.php
===================================================================
---
branches/stavangerkommune/phpsysinfo/includes/js/class.JavaScriptPacker.inc.php
2014-03-12 14:19:06 UTC (rev 11811)
+++
branches/stavangerkommune/phpsysinfo/includes/js/class.JavaScriptPacker.inc.php
2014-03-13 14:55:26 UTC (rev 11812)
@@ -1,5 +1,5 @@
<?php
-/* 9 April 2008. version 1.1
+/* 25 October 2011. version 1.1-FF4
*
* This is the php version of the Dean Edwards JavaScript's Packer,
* Based on :
@@ -18,6 +18,7 @@
* ----------------------------------------------------------------------
* changelog:
* 1.1 : correct a bug, '\0' packed then unpacked becomes '\'.
+ * 1.1-FF4 : Firefox 4 fix, Copyright 2011, Mieczyslaw Nalewaj
* ----------------------------------------------------------------------
*
* examples of usage :
@@ -66,7 +67,8 @@
*/
-class JavaScriptPacker {
+class JavaScriptPacker
+{
// constants
const IGNORE = '$1';
@@ -88,12 +90,13 @@
$this->_script = $_script . "\n";
if (array_key_exists($_encoding, $this->LITERAL_ENCODING))
$_encoding = $this->LITERAL_ENCODING[$_encoding];
- $this->_encoding = min((int)$_encoding, 95);
+ $this->_encoding = min((int) $_encoding, 95);
$this->_fastDecode = $_fastDecode;
$this->_specialChars = $_specialChars;
}
- public function pack() {
+ public function pack()
+ {
$this->_addParser('_basicCompression');
if ($this->_specialChars)
$this->_addParser('_encodeSpecialChars');
@@ -105,21 +108,25 @@
}
// apply all parsing routines
- private function _pack($script) {
+ private function _pack($script)
+ {
for ($i = 0; isset($this->_parsers[$i]); $i++) {
$script =
call_user_func(array(&$this,$this->_parsers[$i]), $script);
}
+
return $script;
}
// keep a list of parsing functions, they'll be executed all at once
private $_parsers = array();
- private function _addParser($parser) {
+ private function _addParser($parser)
+ {
$this->_parsers[] = $parser;
}
// zero encoding - just removal of white space and comments
- private function _basicCompression($script) {
+ private function _basicCompression($script)
+ {
$parser = new ParseMaster();
// make safe
$parser->escapeChar = '\\';
@@ -148,7 +155,8 @@
return $parser->exec($script);
}
- private function _encodeSpecialChars($script) {
+ private function _encodeSpecialChars($script)
+ {
$parser = new ParseMaster();
// replace: $name -> n, $$name -> na
$parser->add('/((\\x24+)([a-zA-Z$_]+))(\\d*)/',
@@ -167,10 +175,12 @@
'data' => $encoded
)
);
+
return $parser->exec($script);
}
- private function _encodeKeywords($script) {
+ private function _encodeKeywords($script)
+ {
// escape high-ascii values already in the script (i.e. in
strings)
if ($this->_encoding > 62)
$script = $this->_escape95($script);
@@ -199,7 +209,8 @@
}
}
- private function _analyze($script, $regexp, $encode) {
+ private function _analyze($script, $regexp, $encode)
+ {
// analyse
// retreive all words in the script
$all = array();
@@ -266,6 +277,7 @@
$_encoded[$_sorted[$i]] = $values[$i];
} while (++$i < count($unsorted));
}
+
return array(
'sorted' => $_sorted,
'encoded' => $_encoded,
@@ -273,12 +285,14 @@
}
private $_count = array();
- private function _sortWords($match1, $match2) {
+ private function _sortWords($match1, $match2)
+ {
return $this->_count[$match2] - $this->_count[$match1];
}
// build the boot function used for loading and decoding
- private function _bootStrap($packed, $keywords) {
+ private function _bootStrap($packed, $keywords)
+ {
$ENCODE = $this->_safeRegExp('$encode\\($count\\)');
// $packed: the packed script
@@ -353,41 +367,48 @@
$params = implode(',', $params);
// the whole thing
- return 'eval(' . $unpack . '(' . $params . "))\n";
+ //Firefox 4 fix, old: return 'eval(' . $unpack . '(' . $params .
"))\n";
+ return "(typeof setTimeout=='function'?setTimeout:eval)(" . $unpack .
"(" . $params . "));\n";
}
private $buffer;
- private function _insertFastDecode($match) {
+ private function _insertFastDecode($match)
+ {
return '{' . $this->buffer . ';';
}
- private function _insertFastEncode($match) {
+ private function _insertFastEncode($match)
+ {
return '{$encode=' . $this->buffer . ';';
}
// mmm.. ..which one do i need ??
- private function _getEncoder($ascii) {
+ private function _getEncoder($ascii)
+ {
return $ascii > 10 ? $ascii > 36 ? $ascii > 62 ?
'_encode95' : '_encode62' : '_encode36' : '_encode10';
}
// zero encoding
// characters: 0123456789
- private function _encode10($charCode) {
+ private function _encode10($charCode)
+ {
return $charCode;
}
// inherent base36 support
// characters: 0123456789abcdefghijklmnopqrstuvwxyz
- private function _encode36($charCode) {
+ private function _encode36($charCode)
+ {
return base_convert($charCode, 10, 36);
}
// hitch a ride on base36 and add the upper case alpha characters
// characters:
0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
- private function _encode62($charCode) {
+ private function _encode62($charCode)
+ {
$res = '';
if ($charCode >= $this->_encoding) {
- $res = $this->_encode62((int)($charCode /
$this->_encoding));
+ $res = $this->_encode62((int) ($charCode / $this->_encoding));
}
$charCode = $charCode % $this->_encoding;
@@ -399,7 +420,8 @@
// use high-ascii values
// characters:
¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþ
- private function _encode95($charCode) {
+ private function _encode95($charCode)
+ {
$res = '';
if ($charCode >= $this->_encoding)
$res = $this->_encode95($charCode / $this->_encoding);
@@ -407,33 +429,38 @@
return $res . chr(($charCode % $this->_encoding) + 161);
}
- private function _safeRegExp($string) {
+ private function _safeRegExp($string)
+ {
return '/'.preg_replace('/\$/', '\\\$', $string).'/';
}
- private function _encodePrivate($charCode) {
+ private function _encodePrivate($charCode)
+ {
return "_" . $charCode;
}
// protect characters used by the parser
- private function _escape($script) {
+ private function _escape($script)
+ {
return preg_replace('/([\\\\\'])/', '\\\$1', $script);
}
// protect high-ascii characters already in the script
- private function _escape95($script) {
+ private function _escape95($script)
+ {
return preg_replace_callback(
'/[\\xa1-\\xff]/',
array(&$this, '_escape95Bis'),
$script
);
}
- private function _escape95Bis($match) {
- return '\x'.((string)dechex(ord($match)));
+ private function _escape95Bis($match)
+ {
+ return '\x'.((string) dechex(ord($match)));
}
-
- private function _getJSFunction($aName) {
+ private function _getJSFunction($aName)
+ {
if (defined('self::JSFUNCTION'.$aName))
return constant('self::JSFUNCTION'.$aName);
else
@@ -460,6 +487,7 @@
$packed = $packed.replace(new RegExp(\'\\\\b\' + $encode($count) +
\'\\\\b\', \'g\'), $keywords[$count]);
}
}
+
return $packed;
}';
/*
@@ -467,6 +495,7 @@
while ($count--)
if ($keywords[$count])
$packed = $packed.replace(new RegExp(\'\\\\b\' + $encode($count) +
\'\\\\b\', \'g\'), $keywords[$count]);
+
return $packed;
}';
*/
@@ -536,8 +565,8 @@
}
-
-class ParseMaster {
+class ParseMaster
+{
public $ignoreCase = false;
public $escapeChar = '';
@@ -555,10 +584,11 @@
private $QUOTE = '/\'/';
private $DELETED = '/\\x01[^\\x01]*\\x01/';//g
- public function add($expression, $replacement = '') {
+ public function add($expression, $replacement = '')
+ {
// count the number of sub-expressions
// - add one because each pattern is itself a sub-expression
- $length = 1 + preg_match_all($this->GROUPS,
$this->_internalEscape((string)$expression), $out);
+ $length = 1 + preg_match_all($this->GROUPS,
$this->_internalEscape((string) $expression), $out);
// treat only strings $replacement
if (is_string($replacement)) {
@@ -567,7 +597,7 @@
// a simple lookup? (e.g. "$2")
if (preg_match($this->INDEXED, $replacement)) {
// store the index (used for fast
retrieval of matched strings)
- $replacement =
(int)(substr($replacement, 1)) - 1;
+ $replacement = (int) (substr($replacement, 1)) - 1;
} else { // a complicated lookup (e.g. "Hello
$2 $1")
// build a function to do the lookup
$quote = preg_match($this->QUOTE,
$this->_internalEscape($replacement))
@@ -588,7 +618,8 @@
else $this->_add('/^$/', $replacement, $length);
}
- public function exec($string) {
+ public function exec($string)
+ {
// execute the global replacement
$this->_escaped = array();
@@ -614,7 +645,8 @@
return preg_replace($this->DELETED, '', $string);
}
- public function reset() {
+ public function reset()
+ {
// clear the patterns collection so that this object may be
re-used
$this->_patterns = array();
}
@@ -624,13 +656,15 @@
private $_patterns = array(); // patterns stored by index
// create and add a new pattern to the patterns collection
- private function _add() {
+ private function _add()
+ {
$arguments = func_get_args();
$this->_patterns[] = $arguments;
}
// this is the global replace function (it's quite complicated)
- private function _replacement($arguments) {
+ private function _replacement($arguments)
+ {
if (empty($arguments)) return '';
$i = 1; $j = 0;
@@ -653,6 +687,7 @@
$delete = ($this->escapeChar == '' ||
strpos($arguments[$i],
$this->escapeChar) === false)
? '' : "\x01" . $arguments[$i] . "\x01";
+
return $delete . $replacement;
// skip over references to sub-expressions
@@ -662,23 +697,28 @@
}
}
- private function _backReferences($match, $offset) {
+ private function _backReferences($match, $offset)
+ {
$replacement = $this->buffer['replacement'];
$quote = $this->buffer['quote'];
$i = $this->buffer['length'];
while ($i) {
$replacement = str_replace('$'.$i--, $match[$offset +
$i], $replacement);
}
+
return $replacement;
}
- private function _replace_name($match, $offset){
+ private function _replace_name($match, $offset)
+ {
$length = strlen($match[$offset + 2]);
$start = $length - max($length - strlen($match[$offset + 3]),
0);
+
return substr($match[$offset + 1], $start, $length) .
$match[$offset + 4];
}
- private function _replace_encoded($match, $offset) {
+ private function _replace_encoded($match, $offset)
+ {
return $this->buffer[$match[$offset]];
}
@@ -688,9 +728,11 @@
private $buffer;
// encode escaped characters
- private function _escape($string, $escapeChar) {
+ private function _escape($string, $escapeChar)
+ {
if ($escapeChar) {
$this->buffer = $escapeChar;
+
return preg_replace_callback(
'/\\' . $escapeChar . '(.)' .'/',
array(&$this, '_escapeBis'),
@@ -701,16 +743,20 @@
return $string;
}
}
- private function _escapeBis($match) {
+ private function _escapeBis($match)
+ {
$this->_escaped[] = $match[1];
+
return $this->buffer;
}
// decode escaped characters
- private function _unescape($string, $escapeChar) {
+ private function _unescape($string, $escapeChar)
+ {
if ($escapeChar) {
$regexp = '/'.'\\'.$escapeChar.'/';
$this->buffer = array('escapeChar'=> $escapeChar, 'i'
=> 0);
+
return preg_replace_callback
(
$regexp,
@@ -722,7 +768,8 @@
return $string;
}
}
- private function _unescapeBis() {
+ private function _unescapeBis()
+ {
if (isset($this->_escaped[$this->buffer['i']])
&& $this->_escaped[$this->buffer['i']] != '')
{
@@ -731,11 +778,12 @@
$temp = '';
}
$this->buffer['i']++;
+
return $this->buffer['escapeChar'] . $temp;
}
- private function _internalEscape($string) {
+ private function _internalEscape($string)
+ {
return preg_replace($this->ESCAPE, '', $string);
}
}
-?>
Modified:
branches/stavangerkommune/phpsysinfo/includes/os/class.BSDCommon.inc.php
===================================================================
--- branches/stavangerkommune/phpsysinfo/includes/os/class.BSDCommon.inc.php
2014-03-12 14:19:06 UTC (rev 11811)
+++ branches/stavangerkommune/phpsysinfo/includes/os/class.BSDCommon.inc.php
2014-03-13 14:55:26 UTC (rev 11812)
@@ -5,7 +5,7 @@
* PHP version 5
*
* @category PHP
- * @package PSI_OS
+ * @package PSI BSDCommon OS class
* @author Michael Cramer <address@hidden>
* @copyright 2009 phpSysInfo
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public
License
@@ -18,7 +18,7 @@
* no need to implement in every class the same methods
*
* @category PHP
- * @package PSI_OS
+ * @package PSI BSDCommon OS class
* @author Michael Cramer <address@hidden>
* @copyright 2009 phpSysInfo
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public
License
@@ -164,13 +164,14 @@
protected function readdmesg()
{
if (count($this->_dmesg) === 0) {
- if (PHP_OS != "Darwin") {
+ if (PSI_OS != "Darwin") {
if (CommonFunctions::rfts('/var/run/dmesg.boot', $buf)) {
- $parts = preg_split("/rebooting/", $buf, -1,
PREG_SPLIT_NO_EMPTY);
+ $parts = preg_split("/rebooting|Uptime/", $buf, -1,
PREG_SPLIT_NO_EMPTY);
$this->_dmesg = preg_split("/\n/", $parts[count($parts) -
1], -1, PREG_SPLIT_NO_EMPTY);
}
}
}
+
return $this->_dmesg;
}
@@ -215,10 +216,10 @@
protected function ip()
{
if (PSI_USE_VHOST === true) {
- $this->sys->setIp(gethostbyname($this->_hostname()));
+ $this->sys->setIp(gethostbyname($this->sys->getHostname()));
} else {
if (!($result = getenv('SERVER_ADDR'))) {
- $this->sys->setIp(gethostbyname($this->_hostname()));
+ $this->sys->setIp(gethostbyname($this->sys->getHostname()));
} else {
$this->sys->setIp($result);
}
@@ -289,14 +290,35 @@
{
$dev = new CpuDevice();
$dev->setModel($this->grabkey('hw.model'));
+ $notwas = true;
foreach ($this->readdmesg() as $line) {
+ if ($notwas) {
if (preg_match("/".$this->_CPURegExp1."/", $line, $ar_buf)) {
$dev->setCpuSpeed(round($ar_buf[2]));
+ $notwas = false;
+ }
+ } else {
+ if (preg_match("/ Origin| Features/", $line, $ar_buf)) {
+ if (preg_match("/ Features2[ ]*=.*<(.*)>/", $line,
$ar_buf)) {
+ $feats = preg_split("/,/",
strtolower(trim($ar_buf[1])), -1, PREG_SPLIT_NO_EMPTY);
+ foreach ($feats as $feat) {
+ if (($feat=="vmx") || ($feat=="svm")) {
+ $dev->setVirt($feat);
+ break 2;
+ }
+ }
break;
}
+ } else break;
}
+ }
+ $ncpu = $this->grabkey('hw.ncpu');
+ if ( is_null($ncpu) || (trim($ncpu) == "") || (!($ncpu >= 1)) )
+ $ncpu = 1;
+ for ($ncpu ; $ncpu > 0 ; $ncpu--) {
$this->sys->setCpus($dev);
}
+ }
/**
* SCSI devices
@@ -309,9 +331,19 @@
foreach ($this->readdmesg() as $line) {
if (preg_match("/".$this->_SCSIRegExp1."/", $line, $ar_buf)) {
$dev = new HWDevice();
- $dev->setName($ar_buf[1]);
+ $dev->setName($ar_buf[1].": ".$ar_buf[2]);
$this->sys->setScsiDevices($dev);
} elseif (preg_match("/".$this->_SCSIRegExp2."/", $line, $ar_buf))
{
+ /* duplication security */
+ $notwas = true;
+ foreach ($this->sys->getScsiDevices() as $finddev) {
+ if ($notwas && (strstr($finddev->getName(), ': ', true) ==
$ar_buf[1])) {
+ $finddev->setCapacity($ar_buf[2] * 2048 * 1.049);
+ $notwas = false;
+ break;
+ }
+ }
+ if ($notwas) {
$dev = new HWDevice();
$dev->setName($ar_buf[1]);
$dev->setCapacity($ar_buf[2] * 2048 * 1.049);
@@ -319,6 +351,12 @@
}
}
}
+ /* cleaning */
+ foreach ($this->sys->getScsiDevices() as $finddev) {
+ if (strstr($finddev->getName(), ': ', true))
+ $finddev->setName(substr(strstr($finddev->getName(),
': ', false),2));
+ }
+ }
/**
* PCI devices
@@ -328,7 +366,7 @@
*/
protected function pci()
{
- if (!(is_array($results = Parser::lspci()) || is_array($results =
Parser::pciconf()))) {
+ if (!is_array($results = Parser::lspci()) || !is_array($results =
Parser::pciconf())) {
foreach ($this->readdmesg() as $line) {
if (preg_match("/".$this->_PCIRegExp1."/", $line, $ar_buf)) {
$dev = new HWDevice();
@@ -341,7 +379,7 @@
}
}
}
- foreach ($results as $device) {
+ foreach ($results as $dev) {
$this->sys->setPciDevices($dev);
}
}
@@ -357,16 +395,41 @@
foreach ($this->readdmesg() as $line) {
if (preg_match('/^(ad[0-9]+): (.*)MB <(.*)> (.*) (.*)/', $line,
$ar_buf)) {
$dev = new HWDevice();
- $dev->setName($ar_buf[1]);
+ $dev->setName($ar_buf[1].": ".$ar_buf[3]);
$dev->setCapacity($ar_buf[2] * 1024);
$this->sys->setIdeDevices($dev);
} elseif (preg_match('/^(acd[0-9]+): (.*) <(.*)> (.*)/', $line,
$ar_buf)) {
$dev = new HWDevice();
+ $dev->setName($ar_buf[1].": ".$ar_buf[3]);
+ $this->sys->setIdeDevices($dev);
+ } elseif (preg_match('/^(ada[0-9]+): <(.*)> (.*)/', $line,
$ar_buf)) {
+ $dev = new HWDevice();
+ $dev->setName($ar_buf[1].": ".$ar_buf[2]);
+ $this->sys->setIdeDevices($dev);
+ } elseif (preg_match('/^(ada[0-9]+): (.*)MB \((.*)\)/', $line,
$ar_buf)) {
+ /* duplication security */
+ $notwas = true;
+ foreach ($this->sys->getIdeDevices() as $finddev) {
+ if ($notwas && (strstr($finddev->getName(), ': ', true) ==
$ar_buf[1])) {
+ $finddev->setCapacity($ar_buf[2] * 1024);
+ $notwas = false;
+ break;
+ }
+ }
+ if ($notwas) {
+ $dev = new HWDevice();
$dev->setName($ar_buf[1]);
+ $dev->setCapacity($ar_buf[2] * 1024);
$this->sys->setIdeDevices($dev);
}
}
}
+ /* cleaning */
+ foreach ($this->sys->getIdeDevices() as $finddev) {
+ if (strstr($finddev->getName(), ': ', true))
+ $finddev->setName(substr(strstr($finddev->getName(),
': ', false),2));
+ }
+ }
/**
* Physical memory information and Swap Space information
@@ -375,7 +438,7 @@
*/
protected function memory()
{
- if (PHP_OS == 'FreeBSD' || PHP_OS == 'OpenBSD') {
+ if (PSI_OS == 'FreeBSD' || PSI_OS == 'OpenBSD') {
// vmstat on fbsd 4.4 or greater outputs kbytes not hw.pagesize
// I should probably add some version checking here, but for now
// we only support fbsd 4.4
@@ -386,7 +449,7 @@
if (CommonFunctions::executeProgram('vmstat', '', $vmstat, PSI_DEBUG))
{
$lines = preg_split("/\n/", $vmstat, -1, PREG_SPLIT_NO_EMPTY);
$ar_buf = preg_split("/\s+/", trim($lines[2]), 19);
- if (PHP_OS == 'NetBSD' || PHP_OS == 'DragonFly') {
+ if (PSI_OS == 'NetBSD' || PSI_OS == 'DragonFly') {
$this->sys->setMemFree($ar_buf[4] * 1024);
} else {
$this->sys->setMemFree($ar_buf[4] * $pagesize);
@@ -394,11 +457,11 @@
$this->sys->setMemTotal($this->grabkey('hw.physmem'));
$this->sys->setMemUsed($this->sys->getMemTotal() -
$this->sys->getMemFree());
- if (((PHP_OS == 'OpenBSD' || PHP_OS == 'NetBSD') &&
CommonFunctions::executeProgram('swapctl', '-l -k', $swapstat, PSI_DEBUG)) ||
CommonFunctions::executeProgram('swapinfo', '-k', $swapstat, PSI_DEBUG)) {
+ if (((PSI_OS == 'OpenBSD' || PSI_OS == 'NetBSD') &&
CommonFunctions::executeProgram('swapctl', '-l -k', $swapstat, PSI_DEBUG)) ||
CommonFunctions::executeProgram('swapinfo', '-k', $swapstat, PSI_DEBUG)) {
$lines = preg_split("/\n/", $swapstat, -1,
PREG_SPLIT_NO_EMPTY);
foreach ($lines as $line) {
$ar_buf = preg_split("/\s+/", $line, 6);
- if ($ar_buf[0] != 'Total') {
+ if (($ar_buf[0] != 'Total') && ($ar_buf[0] != 'Device')) {
$dev = new DiskDevice();
$dev->setMountPoint($ar_buf[0]);
$dev->setName("SWAP");
@@ -414,6 +477,25 @@
}
/**
+ * USB devices
+ * get the ide device information out of dmesg
+ *
+ * @return void
+ */
+ protected function usb()
+ {
+ foreach ($this->readdmesg() as $line) {
+// if (preg_match('/^(ugen[0-9\.]+): <(.*)> (.*) (.*)/', $line,
$ar_buf)) {
+// $dev->setName($ar_buf[1].": ".$ar_buf[2]);
+ if (preg_match('/^(u[a-z]+[0-9]+): <([^,]*)(.*)> on
(usbus[0-9]+)/', $line, $ar_buf)) {
+ $dev = new HWDevice();
+ $dev->setName($ar_buf[2]);
+ $this->sys->setUSBDevices($dev);
+ }
+ }
+ }
+
+ /**
* filesystem information
*
* @return void
@@ -438,7 +520,6 @@
}
}
-
/**
* get the information
*
@@ -446,7 +527,7 @@
*
* @return Void
*/
- function build()
+ public function build()
{
$this->distro();
$this->memory();
@@ -460,6 +541,6 @@
$this->hostname();
$this->ip();
$this->scsi();
+ $this->usb();
}
}
-?>
Modified: branches/stavangerkommune/phpsysinfo/includes/os/class.Darwin.inc.php
===================================================================
--- branches/stavangerkommune/phpsysinfo/includes/os/class.Darwin.inc.php
2014-03-12 14:19:06 UTC (rev 11811)
+++ branches/stavangerkommune/phpsysinfo/includes/os/class.Darwin.inc.php
2014-03-13 14:55:26 UTC (rev 11812)
@@ -5,7 +5,7 @@
* PHP version 5
*
* @category PHP
- * @package PSI_OS
+ * @package PSI Darwin OS class
* @author Michael Cramer <address@hidden>
* @copyright 2009 phpSysInfo
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public
License
@@ -18,7 +18,7 @@
* information may be incomplete
*
* @category PHP
- * @package PSI_OS
+ * @package PSI Darwin OS class
* @author Michael Cramer <address@hidden>
* @copyright 2009 phpSysInfo
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public
License
@@ -30,14 +30,14 @@
/**
* define the regexp for log parser
*/
- public function __construct()
+ /* public function __construct()
{
parent::__construct();
- $this->error->addWarning("The Darwin version of phpSysInfo is work in
progress, some things currently don't work!");
+ $this->error->addWarning("The Darwin version of phpSysInfo is a work
in progress, some things currently don't work!");
$this->setCPURegExp1("CPU: (.*) \((.*)-MHz (.*)\)");
$this->setCPURegExp2("/(.*) ([0-9]+) ([0-9]+) ([0-9]+) ([0-9]+)/");
$this->setSCSIRegExp1("^(.*): <(.*)> .*SCSI.*device");
- }
+ } */
/**
* get a value from sysctl command
@@ -51,6 +51,7 @@
if (CommonFunctions::executeProgram('sysctl', $key, $s, PSI_DEBUG)) {
$s = preg_replace('/'.$key.': /', '', $s);
$s = preg_replace('/'.$key.' = /', '', $s);
+
return $s;
} else {
return '';
@@ -66,12 +67,23 @@
*/
private function _grabioreg($key)
{
- if (CommonFunctions::executeProgram('ioreg', '-cls "'.$key.'" | grep
"'.$key.'"', $s, PSI_DEBUG)) {
- $s = preg_replace('/\|/', '', $s);
- $s = preg_replace('/\+\-\o/', '', $s);
- $s = preg_replace('/[ ]+/', '', $s);
- $s = preg_replace('/<[^>]+>/', '', $s);
- return $s;
+ if (CommonFunctions::executeProgram('ioreg', '-c "'.$key.'"', $s,
PSI_DEBUG)) {
+ /* delete newlines */
+ $s = preg_replace("/\s+/", " ", $s);
+ /* new newlines */
+ $s = preg_replace("/[\|\t ]*\+\-\o/", "\n", $s);
+ /* combine duplicate whitespaces and some chars */
+ $s = preg_replace("/[\|\t ]+/", " ", $s);
+
+ $lines = preg_split("/\n/", $s, -1, PREG_SPLIT_NO_EMPTY);
+ $out = "";
+ foreach ($lines as $line) {
+ if (preg_match('/^([^<]*) <class '.$key.',/', $line)) {
+ $out .= $line."\n";
+ }
+ }
+
+ return $out;
} else {
return '';
}
@@ -86,9 +98,15 @@
private function _uptime()
{
if (CommonFunctions::executeProgram('sysctl', '-n kern.boottime', $a,
PSI_DEBUG)) {
+ $tmp = explode(" ", $a);
+ if ($tmp[0]=="{") { /* kern.boottime= { sec = 1096732600, usec =
885425 } Sat Oct 2 10:56:40 2004 */
+ $data = trim($tmp[3],",");
+ $this->sys->setUptime(time() - $data);
+ } else { /* kern.boottime= 1096732600 */
$this->sys->setUptime(time() - $a);
}
}
+ }
/**
* get CPU information
@@ -99,6 +117,8 @@
{
$dev = new CpuDevice();
if (CommonFunctions::executeProgram('hostinfo', '| grep "Processor
type"', $buf, PSI_DEBUG)) {
+ $dev->setModel(preg_replace('/Processor type: /', '', $buf));
+ $buf=$this->grabkey('hw.model');
if (CommonFunctions::rfts(APP_ROOT.'/data/ModelTranslation.txt',
$buffer)) {
$buffer = preg_split("/\n/", $buffer, -1, PREG_SPLIT_NO_EMPTY);
foreach ($buffer as $line) {
@@ -108,11 +128,37 @@
}
}
}
- $dev->setModel(preg_replace('/Processor type: /', '', $buf));
+ $buf=$this->grabkey('machdep.cpu.brand_string');
+ if ( !is_null($buf) && (trim($buf) != "") ) {
+ $dev->setModel(trim($buf));
+ }
+ $buf=$this->grabkey('machdep.cpu.features');
+ if ( !is_null($buf) && (trim($buf) != "") ) {
+ if (preg_match("/ VMX/",$buf)) {
+ $dev->setVirt("vmx");
+ } elseif (preg_match("/ SVM/",$buf)) {
+ $dev->setVirt("svm");
+ }
+ }
}
$dev->setCpuSpeed(round($this->grabkey('hw.cpufrequency') / 1000000));
$dev->setBusSpeed(round($this->grabkey('hw.busfrequency') / 1000000));
- $dev->setCache(round($this->grabkey('hw.l2cachesize')));
+ $bufn=$this->grabkey('hw.cpufrequency_min');
+ $bufx=$this->grabkey('hw.cpufrequency_max');
+ if ( !is_null($bufn) && (trim($bufn) != "") && !is_null($bufx) &&
(trim($bufx) != "") && ($bufn != $bufx)) {
+ $dev->setCpuSpeedMin(round($bufn / 1000000));
+ $dev->setCpuSpeedMax(round($bufx / 1000000));
+ }
+ $buf=$this->grabkey('hw.l2cachesize');
+ if ( !is_null($buf) && (trim($buf) != "") ) {
+ $dev->setCache(round($buf));
+ }
+ $ncpu = $this->grabkey('hw.ncpu');
+ if ( is_null($ncpu) || (trim($ncpu) == "") || (!($ncpu >= 1)) )
+ $ncpu = 1;
+ for ($ncpu ; $ncpu > 0 ; $ncpu--) {
+ $this->sys->setCpus($dev);
+ }
}
/**
@@ -125,10 +171,11 @@
$s = $this->_grabioreg('IOPCIDevice');
$lines = preg_split("/\n/", $s, -1, PREG_SPLIT_NO_EMPTY);
foreach ($lines as $line) {
- $ar_buf = preg_split("/\s+/", $line, 19);
$dev = new HWDevice();
- $dev->setName($ar_buf[0]);
- $this->sys->setIdeDevices($dev);
+ if (!preg_match('/"IOName" = "([^"]*)"/', $line, $ar_buf ))
+ $ar_buf = preg_split("/address@hidden/", $line, 19);
+ $dev->setName(trim($ar_buf[1]));
+ $this->sys->setPciDevices($dev);
}
}
@@ -142,14 +189,59 @@
$s = $this->_grabioreg('IOATABlockStorageDevice');
$lines = preg_split("/\n/", $s, -1, PREG_SPLIT_NO_EMPTY);
foreach ($lines as $line) {
- $ar_buf = preg_split("/\/\//", $line, 19);
- if (isset($ar_buf[1]) && $ar_buf[1] == 'class IOMedia' &&
preg_match('/Media/', $ar_buf[0])) {
$dev = new HWDevice();
- $dev->setName($ar_buf[0]);
+ if (!preg_match('/"Product Name"="([^"]*)"/', $line,
$ar_buf ))
+ $ar_buf = preg_split("/[\s]+/", $line, 19);
+ $dev->setName(trim($ar_buf[1]));
$this->sys->setIdeDevices($dev);
}
+
+ $s = $this->_grabioreg('IOAHCIBlockStorageDevice');
+ $lines = preg_split("/\n/", $s, -1, PREG_SPLIT_NO_EMPTY);
+ foreach ($lines as $line) {
+ $dev = new HWDevice();
+ if (!preg_match('/"Product Name"="([^"]*)"/', $line,
$ar_buf ))
+ $ar_buf = preg_split("/[\s]+/", $line, 19);
+ $dev->setName(trim($ar_buf[1]));
+ $this->sys->setIdeDevices($dev);
}
}
+
+ /**
+ * get the usb device information out of ioreg
+ *
+ * @return void
+ */
+ protected function usb()
+ {
+ $s = $this->_grabioreg('IOUSBDevice');
+ $lines = preg_split("/\n/", $s, -1, PREG_SPLIT_NO_EMPTY);
+ foreach ($lines as $line) {
+ $dev = new HWDevice();
+ if (!preg_match('/"USB Product Name"="([^"]*)"/', $line,
$ar_buf ))
+ $ar_buf = preg_split("/[\s]+/", $line, 19);
+ $dev->setName(trim($ar_buf[1]));
+ $this->sys->setUsbDevices($dev);
+ }
+ }
+
+ /**
+ * get the scsi device information out of ioreg
+ *
+ * @return void
+ */
+ protected function scsi()
+ {
+ $s = $this->_grabioreg('IOBlockStorageServices');
+ $lines = preg_split("/\n/", $s, -1, PREG_SPLIT_NO_EMPTY);
+ foreach ($lines as $line) {
+ $dev = new HWDevice();
+ if (!preg_match('/"Product Name"="([^"]*)"/', $line,
$ar_buf ))
+ $ar_buf = preg_split("/[\s]+/", $line, 19);
+ $dev->setName(trim($ar_buf[1]));
+ $this->sys->setScsiDevices($dev);
+ }
+ }
/**
* get memory and swap information
@@ -160,11 +252,33 @@
{
$s = $this->grabkey('hw.memsize');
if (CommonFunctions::executeProgram('vm_stat', '', $pstat, PSI_DEBUG))
{
+ // calculate free memory from page sizes (each page = 4MB)
+ if ( (preg_match('/^Pages free:\s+(\S+)/m', $pstat, $free_buf ))
+ && (preg_match('/^Pages speculative:\s+(\S+)/m', $pstat,
$spec_buf )) ) {
+
+ $this->sys->setMemFree(($free_buf[1]+$spec_buf[1]) * 4 * 1024);
+
+ $appMemory = 0;
+ if (preg_match('/^Pages wired down:\s+(\S+)/m', $pstat,
$wire_buf)) {
+ $appMemory += $wire_buf[1] * 4 * 1024;
+ }
+ if (preg_match('/^Pages active:\s+(\S+)/m', $pstat,
$active_buf)) {
+ $appMemory += $active_buf[1] * 4 * 1024;
+ }
+ $this->sys->setMemApplication($appMemory);
+
+ if (preg_match('/^Pages inactive:\s+(\S+)/m', $pstat,
$inactive_buf)) {
+ $this->sys->setMemCache($inactive_buf[1] * 4 * 1024);
+ }
+
+ $this->sys->setMemBuffer(0);
+ } else {
$lines = preg_split("/\n/", $pstat, -1, PREG_SPLIT_NO_EMPTY);
$ar_buf = preg_split("/\s+/", $lines[1], 19);
- // calculate free memory from page sizes (each page = 4MB)
+ $this->sys->setMemFree($ar_buf[2] * 4 * 1024);
+ }
+
$this->sys->setMemTotal($s);
- $this->sys->setMemFree($ar_buf[2] * 4 * 1024);
$this->sys->setMemUsed($this->sys->getMemTotal() -
$this->sys->getMemFree());
if (CommonFunctions::executeProgram('sysctl', 'vm.swapusage |
colrm 1 22', $swapBuff, PSI_DEBUG)) {
@@ -173,6 +287,7 @@
$swap3 = preg_split('/=/', $swap1[2]);
$dev = new DiskDevice();
$dev->setName('SWAP');
+ $dev->setMountPoint('SWAP');
$dev->setFsType('swap');
$dev->setTotal($swap1[0] * 1024 * 1024);
$dev->setUsed($swap2[1] * 1024 * 1024);
@@ -202,6 +317,19 @@
if (isset($ar_buf[10])) {
$dev->setDrops($ar_buf[10]);
}
+ if (defined('PSI_SHOW_NETWORK_INFOS') &&
(PSI_SHOW_NETWORK_INFOS) && (CommonFunctions::executeProgram('ifconfig',
$ar_buf[0].' 2>/dev/null', $bufr2, PSI_DEBUG))) {
+ $bufe2 = preg_split("/\n/", $bufr2, -1,
PREG_SPLIT_NO_EMPTY);
+ foreach ($bufe2 as $buf2) {
+ if (preg_match('/^\s+ether\s+(\S+)/i', $buf2,
$ar_buf2))
+
$dev->setInfo(($dev->getInfo()?$dev->getInfo().';':'').preg_replace('/:/', '-',
$ar_buf2[1]));
+ elseif
(preg_match('/^\s+inet\s+(\S+)\s+netmask/i', $buf2, $ar_buf2))
+
$dev->setInfo(($dev->getInfo()?$dev->getInfo().';':'').$ar_buf2[1]);
+ elseif
((preg_match('/^\s+inet6\s+([^\s%]+)\s+prefixlen/i', $buf2, $ar_buf2)
+ ||
preg_match('/^\s+inet6\s+([^\s%]+)%\S+\s+prefixlen/i', $buf2, $ar_buf2))
+ && !preg_match('/^fe80::/i',$ar_buf2[1]))
+
$dev->setInfo(($dev->getInfo()?$dev->getInfo().';':'').$ar_buf2[1]);
+ }
+ }
$this->sys->setNetDevices($dev);
}
}
@@ -223,7 +351,14 @@
foreach ($arrBuff as $line) {
$arrLine = preg_split("/:/", $line, -1, PREG_SPLIT_NO_EMPTY);
if (trim($arrLine[0]) === "System Version") {
- $this->sys->setDistribution(trim($arrLine[1]));
+ $distro = trim($arrLine[1]);
+
+ if (preg_match('/(^Mac OS)|(^OS X)/', $distro)) {
+ $this->sys->setDistributionIcon('Apple.png');
+ }
+
+ $this->sys->setDistribution($distro);
+
return;
}
}
@@ -237,11 +372,10 @@
*
* @return Void
*/
- function build()
+ public function build()
{
parent::build();
$this->_uptime();
$this->_network();
}
}
-?>
Modified:
branches/stavangerkommune/phpsysinfo/includes/os/class.DragonFly.inc.php
===================================================================
--- branches/stavangerkommune/phpsysinfo/includes/os/class.DragonFly.inc.php
2014-03-12 14:19:06 UTC (rev 11811)
+++ branches/stavangerkommune/phpsysinfo/includes/os/class.DragonFly.inc.php
2014-03-13 14:55:26 UTC (rev 11812)
@@ -5,7 +5,7 @@
* PHP version 5
*
* @category PHP
- * @package PSI_OS
+ * @package PSI DragonFly OS class
* @author Michael Cramer <address@hidden>
* @copyright 2009 phpSysInfo
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public
License
@@ -17,7 +17,7 @@
* get all the required information from DragonFly system
*
* @category PHP
- * @package PSI_OS
+ * @package PSI DragonFly OS class
* @author Michael Cramer <address@hidden>
* @copyright 2009 phpSysInfo
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public
License
@@ -114,7 +114,7 @@
*
* @return Void
*/
- function build()
+ public function build()
{
parent::build();
$this->_distroicon();
@@ -122,4 +122,3 @@
$this->_uptime();
}
}
-?>
Modified: branches/stavangerkommune/phpsysinfo/includes/os/class.FreeBSD.inc.php
===================================================================
--- branches/stavangerkommune/phpsysinfo/includes/os/class.FreeBSD.inc.php
2014-03-12 14:19:06 UTC (rev 11811)
+++ branches/stavangerkommune/phpsysinfo/includes/os/class.FreeBSD.inc.php
2014-03-13 14:55:26 UTC (rev 11812)
@@ -5,7 +5,7 @@
* PHP version 5
*
* @category PHP
- * @package PSI_OS
+ * @package PSI FreeBSD OS class
* @author Michael Cramer <address@hidden>
* @copyright 2009 phpSysInfo
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public
License
@@ -17,7 +17,7 @@
* get all the required information from FreeBSD system
*
* @category PHP
- * @package PSI_OS
+ * @package PSI FreeBSD OS class
* @author Michael Cramer <address@hidden>
* @copyright 2009 phpSysInfo
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public
License
@@ -49,7 +49,7 @@
private function _uptime()
{
$s = preg_split('/ /', $this->grabkey('kern.boottime'));
- $a = preg_replace('/{ /', '', $s[3]);
+ $a = preg_replace('/,/', '', $s[3]);
$this->sys->setUptime(time() - $a);
}
@@ -60,29 +60,59 @@
*/
private function _network()
{
- if (CommonFunctions::executeProgram('netstat', '-nibd | grep Link',
$netstat, PSI_DEBUG)) {
+ $dev = NULL;
+ if (CommonFunctions::executeProgram('netstat', '-nibd', $netstat,
PSI_DEBUG)) {
$lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);
foreach ($lines as $line) {
$ar_buf = preg_split("/\s+/", $line);
if (! empty($ar_buf[0])) {
+ if (preg_match('/^<Link/i',$ar_buf[2])) {
$dev = new NetDevice();
$dev->setName($ar_buf[0]);
- if (strlen($ar_buf[3]) < 15) {
+ if (strlen($ar_buf[3]) < 17) { /* no Address */
+ if (isset($ar_buf[11])) { /* Idrop column exist*/
+ $dev->setTxBytes($ar_buf[9]);
+ $dev->setRxBytes($ar_buf[6]);
+ $dev->setErrors($ar_buf[4] + $ar_buf[8]);
+ $dev->setDrops($ar_buf[11] + $ar_buf[5]);
+ } else {
$dev->setTxBytes($ar_buf[8]);
$dev->setRxBytes($ar_buf[5]);
- $dev->setDrops($ar_buf[10]);
$dev->setErrors($ar_buf[4] + $ar_buf[7]);
+ $dev->setDrops($ar_buf[10]);
+ }
+ } else {
+ if (isset($ar_buf[12])) { /* Idrop column exist*/
+ $dev->setTxBytes($ar_buf[10]);
+ $dev->setRxBytes($ar_buf[7]);
+ $dev->setErrors($ar_buf[5] + $ar_buf[9]);
+ $dev->setDrops($ar_buf[12] + $ar_buf[6]);
} else {
$dev->setTxBytes($ar_buf[9]);
$dev->setRxBytes($ar_buf[6]);
$dev->setErrors($ar_buf[5] + $ar_buf[8]);
$dev->setDrops($ar_buf[11]);
}
+ }
+ if (defined('PSI_SHOW_NETWORK_INFOS') &&
(PSI_SHOW_NETWORK_INFOS) && (CommonFunctions::executeProgram('ifconfig',
$ar_buf[0].' 2>/dev/null', $bufr2, PSI_DEBUG))) {
+ $bufe2 = preg_split("/\n/", $bufr2, -1,
PREG_SPLIT_NO_EMPTY);
+ foreach ($bufe2 as $buf2) {
+ if (preg_match('/^\s+ether\s+(\S+)/i', $buf2,
$ar_buf2))
+
$dev->setInfo(($dev->getInfo()?$dev->getInfo().';':'').preg_replace('/:/', '-',
$ar_buf2[1]));
+ elseif
(preg_match('/^\s+inet\s+(\S+)\s+netmask/i', $buf2, $ar_buf2))
+
$dev->setInfo(($dev->getInfo()?$dev->getInfo().';':'').$ar_buf2[1]);
+ elseif
((preg_match('/^\s+inet6\s+([^\s%]+)\s+prefixlen/i', $buf2, $ar_buf2)
+ ||
preg_match('/^\s+inet6\s+([^\s%]+)%\S+\s+prefixlen/i', $buf2, $ar_buf2))
+ && !preg_match('/^fe80::/i',$ar_buf2[1]))
+
$dev->setInfo(($dev->getInfo()?$dev->getInfo().';':'').$ar_buf2[1]);
+ }
+ }
$this->sys->setNetDevices($dev);
}
}
}
}
+ }
/**
* get icon name
@@ -103,11 +133,10 @@
{
$pagesize = $this->grabkey("hw.pagesize");
$this->sys->setMemCache($this->grabkey("vm.stats.vm.v_cache_count") *
$pagesize);
-
$this->sys->setMemApplication($this->grabkey("vm.stats.vm.v_active_count") *
$pagesize);
- $this->sys->setMemBuffer($this->sys->getMemTotal() -
$this->sys->getMemApplication() - $this->sys->getMemCache());
+
$this->sys->setMemApplication(($this->grabkey("vm.stats.vm.v_active_count") +
$this->grabkey("vm.stats.vm.v_wire_count")) * $pagesize);
+ $this->sys->setMemBuffer($this->sys->getMemUsed() -
$this->sys->getMemApplication() - $this->sys->getMemCache());
}
-
/**
* get the information
*
@@ -115,7 +144,7 @@
*
* @return Void
*/
- function build()
+ public function build()
{
parent::build();
$this->_memoryadditional();
@@ -124,4 +153,3 @@
$this->_uptime();
}
}
-?>
Modified: branches/stavangerkommune/phpsysinfo/includes/os/class.HPUX.inc.php
===================================================================
--- branches/stavangerkommune/phpsysinfo/includes/os/class.HPUX.inc.php
2014-03-12 14:19:06 UTC (rev 11811)
+++ branches/stavangerkommune/phpsysinfo/includes/os/class.HPUX.inc.php
2014-03-13 14:55:26 UTC (rev 11812)
@@ -5,7 +5,7 @@
* PHP version 5
*
* @category PHP
- * @package PSI_OS
+ * @package PSI HPUX OS class
* @author Michael Cramer <address@hidden>
* @copyright 2009 phpSysInfo
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public
License
@@ -17,7 +17,7 @@
* get all the required information from HP-UX system
*
* @category PHP
- * @package PSI_OS
+ * @package PSI HPUX OS class
* @author Michael Cramer <address@hidden>
* @copyright 2009 phpSysInfo
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public
License
@@ -50,10 +50,10 @@
private function _ip()
{
if (PSI_USE_VHOST === true) {
- $this->sys->setIp(gethostbyname($this->_hostname()));
+ $this->sys->setIp(gethostbyname($this->sys->getHostname()));
} else {
if (!($result = getenv('SERVER_ADDR'))) {
- $this->sys->setIp(gethostbyname($this->_hostname()));
+ $this->sys->setIp(gethostbyname($this->sys->getHostname()));
} else {
$this->sys->setIp($result);
}
@@ -373,9 +373,9 @@
private function _distro()
{
$this->sys->setDistribution('HP-UX');
+ $this->sys->setDistributionIcon('HPUX.png');
}
-
/**
* get the information
*
@@ -383,11 +383,11 @@
*
* @return Void
*/
- function build()
+ public function build()
{
$this->_distro();
- $this->_ip();
$this->_hostname();
+ $this->_ip();
$this->_kernel();
$this->_uptime();
$this->_users();
@@ -402,4 +402,3 @@
$this->_filesystems();
}
}
-?>
Modified: branches/stavangerkommune/phpsysinfo/includes/os/class.Linux.inc.php
===================================================================
--- branches/stavangerkommune/phpsysinfo/includes/os/class.Linux.inc.php
2014-03-12 14:19:06 UTC (rev 11811)
+++ branches/stavangerkommune/phpsysinfo/includes/os/class.Linux.inc.php
2014-03-13 14:55:26 UTC (rev 11812)
@@ -5,7 +5,7 @@
* PHP version 5
*
* @category PHP
- * @package PSI_OS
+ * @package PSI Linux OS class
* @author Michael Cramer <address@hidden>
* @copyright 2009 phpSysInfo
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public
License
@@ -17,7 +17,7 @@
* get all the required information from Linux system
*
* @category PHP
- * @package PSI_OS
+ * @package PSI Linux OS class
* @author Michael Cramer <address@hidden>
* @copyright 2009 phpSysInfo
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public
License
@@ -33,12 +33,13 @@
{
parent::__construct();
}
+
/**
* Hostname
*
* @return void
*/
- private function _hostname()
+ protected function _hostname()
{
if (PSI_USE_VHOST === true) {
$this->sys->setHostname(getenv('SERVER_NAME'));
@@ -52,23 +53,25 @@
}
}
}
+
/**
* IP
*
* @return void
*/
- private function _ip()
+ protected function _ip()
{
if (PSI_USE_VHOST === true) {
- $this->sys->setIp(gethostbyname($this->_hostname()));
+ $this->sys->setIp(gethostbyname($this->sys->getHostname()));
} else {
- if (!($result = $_SERVER['SERVER_ADDR'])) {
- $this->sys->setIp(gethostbyname($this->_hostname()));
+ if (!isset($_SERVER['SERVER_ADDR']) || !($result =
$_SERVER['SERVER_ADDR'])) {
+ $this->sys->setIp(gethostbyname($this->sys->getHostname()));
} else {
$this->sys->setIp($result);
}
}
}
+
/**
* Kernel Version
*
@@ -76,14 +79,15 @@
*/
private function _kernel()
{
- if (CommonFunctions::executeProgram('uname', '-r', $strBuf,
PSI_DEBUG)) {
+ if (CommonFunctions::executeProgram($uname="uptrack-uname", '-r',
$strBuf, false) || // show effective kernel if ksplice uptrack is installed
+ CommonFunctions::executeProgram($uname="uname", '-r', $strBuf,
PSI_DEBUG)) {
$result = trim($strBuf);
- if (CommonFunctions::executeProgram('uname', '-v', $strBuf,
PSI_DEBUG)) {
+ if (CommonFunctions::executeProgram($uname, '-v', $strBuf,
PSI_DEBUG)) {
if (preg_match('/SMP/', $strBuf)) {
$result .= ' (SMP)';
}
}
- if (CommonFunctions::executeProgram('uname', '-m', $strBuf,
PSI_DEBUG)) {
+ if (CommonFunctions::executeProgram($uname, '-m', $strBuf,
PSI_DEBUG)) {
$result .= ' '.trim($strBuf);
}
$this->sys->setKernel($result);
@@ -99,18 +103,20 @@
}
}
}
+
/**
* UpTime
* time the system is running
*
* @return void
*/
- private function _uptime()
+ protected function _uptime()
{
CommonFunctions::rfts('/proc/uptime', $buf, 1);
$ar_buf = preg_split('/ /', $buf);
$this->sys->setUptime(trim($ar_buf[0]));
}
+
/**
* Number of Users
*
@@ -118,18 +124,21 @@
*/
private function _users()
{
- if (CommonFunctions::executeProgram('who', '-q', $strBuf, PSI_DEBUG)) {
- $arrWho = preg_split('/=/', $strBuf);
- $this->sys->setUsers($arrWho[1]);
+ if (CommonFunctions::executeProgram('who', '', $strBuf, PSI_DEBUG)) {
+ if (strlen(trim($strBuf)) > 0) {
+ $lines = preg_split('/\n/', $strBuf);
+ $this->sys->setUsers(count($lines));
}
}
+ }
+
/**
* Processor Load
* optionally create a loadbar
*
* @return void
*/
- private function _loadavg()
+ protected function _loadavg()
{
if (CommonFunctions::rfts('/proc/loadavg', $buf)) {
$result = preg_split("/\s/", $buf, 4);
@@ -141,6 +150,7 @@
$this->sys->setLoadPercent($this->_parseProcStat('cpu'));
}
}
+
/**
* fill the load for a individual cpu, through parsing /proc/stat for the
specified cpu
*
@@ -148,7 +158,7 @@
*
* @return Integer
*/
- private function _parseProcStat($cpuline)
+ protected function _parseProcStat($cpuline)
{
$load = 0;
$load2 = 0;
@@ -170,7 +180,9 @@
}
}
// we need a second value, wait 1 second befor getting (< 1 second no
good value will occour)
+ if (PSI_LOAD_BAR) {
sleep(1);
+ }
if (CommonFunctions::rfts('/proc/stat', $buf)) {
$lines = preg_split("/\n/", $buf, -1, PREG_SPLIT_NO_EMPTY);
foreach ($lines as $line) {
@@ -189,35 +201,51 @@
if ($total > 0 && $total2 > 0 && $load > 0 && $load2 > 0 && $total2 !=
$total && $load2 != $load) {
return (100 * ($load2 - $load)) / ($total2 - $total);
}
+
return 0;
}
+
/**
* CPU information
* All of the tags here are highly architecture dependant.
*
* @return void
*/
- private function _cpuinfo()
+ protected function _cpuinfo()
{
if (CommonFunctions::rfts('/proc/cpuinfo', $bufr)) {
$processors = preg_split('/\s?\n\s?\n/', trim($bufr));
+ $procname = null;
foreach ($processors as $processor) {
+ $proc = null;
+ $arch = null;
$dev = new CpuDevice();
$details = preg_split("/\n/", $processor, -1,
PREG_SPLIT_NO_EMPTY);
foreach ($details as $detail) {
- $arrBuff = preg_split('/\s+:\s+/', trim($detail));
+ $arrBuff = preg_split('/\s*:\s*/', trim($detail));
if (count($arrBuff) == 2) {
switch (strtolower($arrBuff[0])) {
case 'processor':
-
$dev->setLoad($this->_parseProcStat('cpu'.trim($arrBuff[1])));
+ $proc = trim($arrBuff[1]);
+ if (is_numeric($proc)) {
+ if (strlen($procname)>0) {
+ $dev->setModel($procname);
+ }
+ } else {
+ $procname = $proc;
+ $dev->setModel($procname);
+ }
break;
case 'model name':
+ case 'cpu model':
case 'cpu':
$dev->setModel($arrBuff[1]);
break;
case 'cpu mhz':
case 'clock':
+ if ($arrBuff[1] > 0) { //openSUSE fix
$dev->setCpuSpeed($arrBuff[1]);
+ }
break;
case 'cycle frequency [hz]':
$dev->setCpuSpeed($arrBuff[1] / 1000000);
@@ -233,6 +261,26 @@
case 'cpu0bogo':
$dev->setBogomips($arrBuff[1]);
break;
+ case 'flags':
+ if (preg_match("/ vmx/",$arrBuff[1])) {
+ $dev->setVirt("vmx");
+ } elseif (preg_match("/ svm/",$arrBuff[1])) {
+ $dev->setVirt("svm");
+ } elseif (preg_match("/ hypervisor/",$arrBuff[1]))
{
+ $dev->setVirt("hypervisor");
+ }
+ break;
+ case 'i size':
+ case 'd size':
+ if ($dev->getCache() === null) {
+ $dev->setCache($arrBuff[1] * 1024);
+ } else {
+ $dev->setCache($dev->getCache() + ($arrBuff[1]
* 1024));
+ }
+ break;
+ case 'cpu architecture':
+ $arch = trim($arrBuff[1]);
+ break;
}
}
}
@@ -249,36 +297,44 @@
// sparc64 specific code ends
// XScale detection code
- if ($dev->getModel() === "") {
- foreach ($details as $detail) {
- $arrBuff = preg_split('/\s*:\s*/', trim($buf), 2);
- if (count($arrBuff) == 2) {
- switch (strtolower($arrBuff[0])) {
- case 'Processor':
- $dev->setModel($arrBuff[1]);
- break;
- case 'BogoMIPS':
- $dev->setCpuSpeed($arrBuff[1]); //BogoMIPS are
not BogoMIPS on this CPU, it's the speed, no BogoMIPS available
- break;
- case 'I size':
- case 'D size':
- if ($dev->getCache() === null) {
- $dev->setCache($arrBuff[1] * 1024);
- } else {
- $dev->setCache($dev->getCache() +
($arrBuff[1] * 1024));
+ if (($arch === "5TE") && ($dev->getBogomips() != null)) {
+ $dev->setCpuSpeed($dev->getBogomips()); //BogoMIPS are not
BogoMIPS on this CPU, it's the speed
+ $dev->setBogomips(null); // no BogoMIPS available, unset
previously set BogoMIPS
}
- break;
+
+ if ($proc != null) {
+ if (!is_numeric($proc)) {
+ $proc = 0;
+ }
+ // variable speed processors specific code follows
+ if
(CommonFunctions::rfts('/sys/devices/system/cpu/cpu'.$proc.'/cpufreq/cpuinfo_cur_freq',
$buf, 1, 4096, false)) {
+ $dev->setCpuSpeed($buf / 1000);
+ } elseif
(CommonFunctions::rfts('/sys/devices/system/cpu/cpu'.$proc.'/cpufreq/scaling_cur_freq',
$buf, 1, 4096, false)) {
+ $dev->setCpuSpeed($buf / 1000);
}
+ if
(CommonFunctions::rfts('/sys/devices/system/cpu/cpu'.$proc.'/cpufreq/cpuinfo_max_freq',
$buf, 1, 4096, false)) {
+ $dev->setCpuSpeedMax($buf / 1000);
}
+ if
(CommonFunctions::rfts('/sys/devices/system/cpu/cpu'.$proc.'/cpufreq/cpuinfo_min_freq',
$buf, 1, 4096, false)) {
+ $dev->setCpuSpeedMin($buf / 1000);
}
+ // variable speed processors specific code ends
+ if (PSI_LOAD_BAR) {
+ $dev->setLoad($this->_parseProcStat('cpu'.$proc));
}
+
if
(CommonFunctions::rfts('/proc/acpi/thermal_zone/THRM/temperature', $buf, 1,
4096, false)) {
$dev->setTemp(substr($buf, 25, 2));
}
+ if ($dev->getModel() === "") {
+ $dev->setModel("unknown");
+ }
$this->sys->setCpus($dev);
}
}
}
+ }
+
/**
* PCI devices
*
@@ -312,6 +368,7 @@
}
}
}
+
/**
* IDE devices
*
@@ -338,6 +395,7 @@
}
}
}
+
/**
* SCSI devices
*
@@ -365,6 +423,7 @@
}
}
}
+
/**
* USB devices
*
@@ -406,15 +465,16 @@
}
}
}
+
/**
* Network devices
* includes also rx/tx bytes
*
* @return void
*/
- private function _network()
+ protected function _network()
{
- if (CommonFunctions::rfts('/proc/net/dev', $bufr)) {
+ if (CommonFunctions::rfts('/proc/net/dev', $bufr, 0, 4096, PSI_DEBUG))
{
$bufe = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
foreach ($bufe as $buf) {
if (preg_match('/:/', $buf)) {
@@ -426,20 +486,107 @@
$dev->setTxBytes($stats[8]);
$dev->setErrors($stats[2] + $stats[10]);
$dev->setDrops($stats[3] + $stats[11]);
+ if (defined('PSI_SHOW_NETWORK_INFOS') &&
(PSI_SHOW_NETWORK_INFOS) && (CommonFunctions::executeProgram('ifconfig',
trim($dev_name).' 2>/dev/null', $bufr2, PSI_DEBUG))) {
+ $bufe2 = preg_split("/\n/", $bufr2, -1,
PREG_SPLIT_NO_EMPTY);
+ foreach ($bufe2 as $buf2) {
+// if
(preg_match('/^'.trim($dev_name).'\s+Link\sencap:Ethernet\s+HWaddr\s(\S+)/i',
$buf2, $ar_buf2)
+ if
(preg_match('/\s+encap:Ethernet\s+HWaddr\s(\S+)/i', $buf2, $ar_buf2)
+ ||
preg_match('/^\s+ether\s+(\S+)\s+txqueuelen/i', $buf2, $ar_buf2))
+
$dev->setInfo(($dev->getInfo()?$dev->getInfo().';':'').preg_replace('/:/', '-',
$ar_buf2[1]));
+ elseif
(preg_match('/^\s+inet\saddr:(\S+)\s+P-t-P:(\S+)/i', $buf2, $ar_buf2)
+ ||
preg_match('/^\s+inet\s+(\S+)\s+netmask.+destination\s+(\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]);
+ }
+ } elseif
(preg_match('/^\s+inet\saddr:(\S+)/i', $buf2, $ar_buf2)
+ ||
preg_match('/^\s+inet\s+(\S+)\s+netmask/i', $buf2, $ar_buf2)
+ ||
preg_match('/^'.trim($dev_name).':\s+ip\s+(\S+)\s+mask/i', $buf2, $ar_buf2)
+ ||
preg_match('/^\s+inet6\saddr:\s([^\/]+)(.+)\s+Scope:[GH]/i', $buf2, $ar_buf2)
+ ||
preg_match('/^\s+inet6\s+(\S+)\s+prefixlen(.+)((<global>)|(<host>))/i', $buf2,
$ar_buf2))
+
$dev->setInfo(($dev->getInfo()?$dev->getInfo().';':'').$ar_buf2[1]);
+ }
+ }
$this->sys->setNetDevices($dev);
}
}
+ } elseif (CommonFunctions::executeProgram('ifconfig', '', $bufr,
PSI_DEBUG)) {
+ $lines = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
+ $notwas = true;
+ foreach ($lines as $line) {
+ if (preg_match("/^([^\s:]+)/", $line, $ar_buf)) {
+ if (!$notwas) {
+ $dev->setErrors($errors);
+ $dev->setDrops($drops);
+ $this->sys->setNetDevices($dev);
+ }
+ $errors = 0;
+ $drops = 0;
+ $dev = new NetDevice();
+ $dev->setName($ar_buf[1]);
+ $notwas = false;
+ if (defined('PSI_SHOW_NETWORK_INFOS') &&
(PSI_SHOW_NETWORK_INFOS)) {
+ if
(preg_match('/^'.$ar_buf[1].'\s+Link\sencap:Ethernet\s+HWaddr\s(\S+)/i', $line,
$ar_buf2))
+
$dev->setInfo(($dev->getInfo()?$dev->getInfo().';':'').preg_replace('/:/', '-',
$ar_buf2[1]));
+ elseif
(preg_match('/^'.$ar_buf[1].':\s+ip\s+(\S+)\s+mask/i', $line, $ar_buf2))
+
$dev->setInfo(($dev->getInfo()?$dev->getInfo().';':'').$ar_buf2[1]);
+ }
+ } else {
+ if (!$notwas) {
+ if (preg_match('/\sRX bytes:(\d+)\s/i', $line,
$ar_buf2)) {
+ $dev->setRxBytes($ar_buf2[1]);
}
+ if (preg_match('/\sTX bytes:(\d+)\s/i', $line,
$ar_buf2)) {
+ $dev->setTxBytes($ar_buf2[1]);
}
+
+ if (preg_match('/\sRX
packets:\d+\serrors:(\d+)\sdropped:(\d+)/i', $line, $ar_buf2)) {
+ $errors +=$ar_buf2[1];
+ $drops +=$ar_buf2[2];
+ } elseif (preg_match('/\sTX
packets:\d+\serrors:(\d+)\sdropped:(\d+)/i', $line, $ar_buf2)) {
+ $errors +=$ar_buf2[1];
+ $drops +=$ar_buf2[2];
+ }
+
+ if (defined('PSI_SHOW_NETWORK_INFOS') &&
(PSI_SHOW_NETWORK_INFOS)) {
+ if
(preg_match('/\s+encap:Ethernet\s+HWaddr\s(\S+)/i', $line, $ar_buf2)
+ ||
preg_match('/^\s+ether\s+(\S+)\s+txqueuelen/i', $line, $ar_buf2))
+
$dev->setInfo(($dev->getInfo()?$dev->getInfo().';':'').preg_replace('/:/', '-',
$ar_buf2[1]));
+ elseif
(preg_match('/^\s+inet\saddr:(\S+)\s+P-t-P:(\S+)/i', $line, $ar_buf2)
+ ||
preg_match('/^\s+inet\s+(\S+)\s+netmask.+destination\s+(\S+)/i', $line,
$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]);
+ }
+ } elseif
(preg_match('/^\s+inet\saddr:(\S+)/i', $line, $ar_buf2)
+ ||
preg_match('/^\s+inet\s+(\S+)\s+netmask/i', $line, $ar_buf2)
+ ||
preg_match('/^\s+inet6\saddr:\s([^\/]+)(.+)\s+Scope:[GH]/i', $line, $ar_buf2)
+ ||
preg_match('/^\s+inet6\s+(\S+)\s+prefixlen(.+)((<global>)|(<host>))/i', $line,
$ar_buf2))
+
$dev->setInfo(($dev->getInfo()?$dev->getInfo().';':'').$ar_buf2[1]);
+
+ }
+ }
+ }
+ }
+ if (!$notwas) {
+ $dev->setErrors($errors);
+ $dev->setDrops($drops);
+ $this->sys->setNetDevices($dev);
+ }
+ }
+ }
+
/**
* Physical memory information and Swap Space information
*
* @return void
*/
- private function _memory()
+ protected function _memory()
{
- if (CommonFunctions::rfts('/proc/meminfo', $bufr)) {
- $bufe = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
+ if (CommonFunctions::rfts('/proc/meminfo', $mbuf)) {
+ $bufe = preg_split("/\n/", $mbuf, -1, PREG_SPLIT_NO_EMPTY);
foreach ($bufe as $buf) {
if (preg_match('/^MemTotal:\s+(.*)\s*kB/i', $buf, $ar_buf)) {
$this->sys->setMemTotal($ar_buf[1] * 1024);
@@ -456,8 +603,8 @@
if ($this->sys->getMemCache() !== null &&
$this->sys->getMemBuffer() !== null) {
$this->sys->setMemApplication($this->sys->getMemUsed() -
$this->sys->getMemCache() - $this->sys->getMemBuffer());
}
- if (CommonFunctions::rfts('/proc/swaps', $bufr)) {
- $swaps = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
+ if (CommonFunctions::rfts('/proc/swaps', $sbuf, 0, 4096, false)) {
+ $swaps = preg_split("/\n/", $sbuf, -1, PREG_SPLIT_NO_EMPTY);
unset($swaps[0]);
foreach ($swaps as $swap) {
$ar_buf = preg_split('/\s+/', $swap, 5);
@@ -472,6 +619,7 @@
}
}
}
+
/**
* filesystem information
*
@@ -479,11 +627,12 @@
*/
private function _filesystems()
{
- $arrResult = Parser::df("-P");
+ $arrResult = Parser::df("-P 2>/dev/null");
foreach ($arrResult as $dev) {
$this->sys->setDiskDevices($dev);
}
}
+
/**
* Distribution
*
@@ -491,51 +640,243 @@
*/
private function _distro()
{
+ $this->sys->setDistribution("Linux");
$list = @parse_ini_file(APP_ROOT."/data/distros.ini", true);
if (!$list) {
return;
}
- // We have the '2> /dev/null' because Ubuntu gives an error on this
command which causes the distro to be unknown
- if (CommonFunctions::executeProgram('lsb_release', '-a 2> /dev/null',
$distro_info, PSI_DEBUG)) {
+ // We have the '2>/dev/null' because Ubuntu gives an error on this
command which causes the distro to be unknown
+ if (CommonFunctions::executeProgram('lsb_release', '-a 2>/dev/null',
$distro_info, PSI_DEBUG) && (strlen(trim($distro_info)) > 0)) {
$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['Distributor ID']) &&
isset($list[$distro['Distributor ID']]['Image'])) {
- $this->sys->setDistributionIcon($list[$distro['Distributor
ID']]['Image']);
+ 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[trim($info_tmp[0])] = trim($info_tmp[1]);
}
- if (isset($distro['Description'])) {
+ }
+ if (!isset($distro['Distributor ID']) &&
!isset($distro['Description'])) { // Systems like StartOS
+ if ( isset($distro_tmp[0]) && !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']) && ($distro['Description']
!= "n/a")) {
$this->sys->setDistribution($distro['Description']);
+ } elseif (isset($distro['Distributor ID']) &&
($distro['Distributor ID'] != "n/a")) {
+ $this->sys->setDistribution($distro['Distributor ID']);
+ if (isset($distro['Release']) && ($distro['Release'] !=
"n/a")) {
+
$this->sys->setDistribution($this->sys->getDistribution()."
".$distro['Release']);
+ }
+ if (isset($distro['Codename']) && ($distro['Codename'] !=
"n/a")) {
+
$this->sys->setDistribution($this->sys->getDistribution()."
(".$distro['Codename'].")");
+ }
}
+ if (isset($distro['Distributor ID']) && ($distro['Distributor
ID'] != "n/a") && isset($list[$distro['Distributor ID']]['Image'])) {
+ $this->sys->setDistributionIcon($list[$distro['Distributor
ID']]['Image']);
+ }
}
} else {
- // Fall back in case 'lsb_release' does not exist ;)
+ /* 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 but exist
/etc/lsb-release
+ 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'])) {
+
$this->sys->setDistribution(trim($list[trim($id_buf[1])]['Name']));
+ } else {
+ $this->sys->setDistribution(trim($id_buf[1]));
+ }
+ if (preg_match('/^DISTRIB_RELEASE="?([^"\n]+)"?/m', $buf,
$vers_buf)) {
+
$this->sys->setDistribution($this->sys->getDistribution()."
".trim($vers_buf[1]));
+ }
+ if (preg_match('/^DISTRIB_CODENAME="?([^"\n]+)"?/m', $buf,
$vers_buf)) {
+
$this->sys->setDistribution($this->sys->getDistribution()."
(".trim($vers_buf[1]).")");
+ }
+ }
+ if (isset($list[trim($id_buf[1])]['Image'])) {
+
$this->sys->setDistributionIcon($list[trim($id_buf[1])]['Image']);
+ }
+ } else { // otherwise find files specific for distribution
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);
- if (isset($distribution["Image"])) {
-
$this->sys->setDistributionIcon($distribution["Image"]);
- }
- if (isset($distribution["Name"])) {
@@ Diff output truncated at 153600 characters. @@
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [11812] bkbooking: stavanger phpsysinfo 1st,
Kjell Arne Espedal <=