* Mon May 12 2025 Brian Read <brianr@koozali.org> 11.0.0-1.sme
- Adding SM2 panel [SME: 13004] - Upgrade to phpsysinfo 3.4.4 - Add code to delete inline styles and add css to make it look better. - version saved / built uses the static version, which means no drops downs and choices.
This commit is contained in:
@@ -1,32 +0,0 @@
|
||||
#!/bin/sh -x
|
||||
|
||||
if [ $# -ne 1 ]
|
||||
then
|
||||
echo "Usage : ./tools/MakeRelease <version>"
|
||||
exit
|
||||
fi
|
||||
|
||||
sed -i "s/PSI_VERSION = '.*'/PSI_VERSION = '$1'/g" includes/class.CommonFunctions.inc.php
|
||||
ARCHIVE_NAME="phpsysinfo-$1.tar.gz"
|
||||
|
||||
#copy to temp dir
|
||||
rm -rf /tmp/phpsysinfo
|
||||
mkdir /tmp/phpsysinfo
|
||||
cp -R . /tmp/phpsysinfo
|
||||
cd /tmp/phpsysinfo
|
||||
|
||||
# remove the svn directories
|
||||
find . -type d -name .svn -exec rm -fr {} \;
|
||||
#or find . -iname ".svn" -print0 | xargs -0 rm -r
|
||||
|
||||
#remove some dirs
|
||||
rm -rf tools sample
|
||||
|
||||
#remove phpsysinfo.ini
|
||||
rm -rf phpsysinfo.ini .cvsignore .project
|
||||
|
||||
#create archive
|
||||
cd ..
|
||||
tar -czf $ARCHIVE_NAME phpsysinfo
|
||||
|
||||
md5sum $ARCHIVE_NAME
|
@@ -1,4 +1,5 @@
|
||||
check.sh - Script for checking *.php files and reformat them
|
||||
MakeRelease.sh - Cleanup the code a bit for a release
|
||||
phpsysinfo.ini - Configuration file for generating documentation with phpDocumentor
|
||||
lint.bat - run php lint on every php file to check for syntax (windows util)
|
||||
checkdistro.php - Tests detection of distribution
|
||||
distrotest.php - Generates a txt file for distribution testing
|
||||
cputest.php - Displays anonymized /proc/cpuinfo
|
||||
phptest.php - Displays information about PHP
|
||||
checkpng.php - Tests the display of distribution logos
|
||||
|
@@ -1,43 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<profiles version="1">
|
||||
<profile kind="" name="phpSysInfo" version="1">
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.insert_new_line_before_if_statement" value="insert"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.indent_statements_compare_to_block" value="true"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.preserve_extra_carriage_returns2" value=""/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.indent_statements_compare_to_body" value="true"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.insert_new_line_in_empty_type_declaration" value="a,span,i,b,em,strong,h1,h2,h3,h4,h5,h6,title,option"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.insert_space_between_empty_parens_in_enum_constant" value=""/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.insert_new_line_before_finally_in_try_statement" value="insert"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.keep_empty_array_initializer_on_one_line" value="true"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="false"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.preserve_extra_carriage_returns" value="true"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.insert_new_line_in_empty_enum_declaration" value="doctype,br,link,meta"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.compact_else_if" value="false"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.brace_position_for_method_declaration" value="end_of_line"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.preserveWhitespaceinCDATA" value="true"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.format_guardian_clause_on_one_line" value="false"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.insert_new_line_before_catch_in_try_statement" value="insert"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.tabulation.size" value="4"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.insert_space_after_and_in_type_parameter" value=""/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.brace_position_for_switch" value="end_of_line"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.keep_else_statement_on_same_line" value="false"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.insert_new_line_before_while_in_do_statement" value="insert"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.indent_switchstatements_compare_to_cases" value="true"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.blank_lines_before_method" value="1"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.insert_new_line_before_return_statement" value="insert"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.tabulation.char" value=" "/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.indent_breaks_compare_to_cases" value="true"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.brace_position_for_array_initializer" value="end_of_line"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.brace_position_for_block" value="end_of_line"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.blank_lines_before_imports" value="5"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.insert_space_after_closing_brace_in_block" value="true"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.brace_position_for_block_in_case" value="end_of_line"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.keep_imple_if_on_one_line" value="false"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.insert_new_line_before_else_in_if_statement" value="insert"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.keep_then_statement_on_same_line" value="false"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.indent_switchstatements_compare_to_switch" value="false"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.alignment_for_multiple_fields" value="1"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.wraptags2" value=""/>
|
||||
</profile>
|
||||
</profiles>
|
@@ -1,90 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<profiles version="1">
|
||||
<profile kind="" name="phpSysInfo" version="1">
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.insert_new_line_before_if_statement" value="insert"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.number_of_empty_lines_to_preserve" value="2"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.indent_body_declarations_compare_to_type_header" value="true"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.indent_statements_compare_to_body" value="true"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.insert_space_between_empty_parens_in_enum_constant" value=""/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.insert_new_line_in_empty_method_body" value="insert"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.keep_empty_array_initializer_on_one_line" value="true"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.brace_position_for_type_declaration" value="next_line"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.preserve_extra_carriage_returns" value="true"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.lineSplit" value="80"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.put_empty_statement_on_new_line" value="true"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.insert_space_before_opening_brace_in_switch" value="insert"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.brace_position_for_method_declaration" value="next_line"/>
|
||||
<setting id="FORMATTER_BLANK_LINES_BEFORE_CLASSDECL" value="0"/>
|
||||
<setting id="FORMATTER_INSERT_SPACE_BEFORE_OBJECT_OPERATOR" value="not-insert"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.preserveWhitespaceinCDATA" value="true"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.format_guardian_clause_on_one_line" value="false"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.insert_new_line_before_catch_in_try_statement" value="not-insert"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.blank_lines_before_field" value="0"/>
|
||||
<setting id="FORMATTER_INSERT_SPACE_AFTER_CLOSING_PAREN_IN_TYPE_CAST" value="insert"/>
|
||||
<setting id="FORMATTER_INDENT_INLINE_PHP_BLOCK" value="false"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.insert_space_after_semicolon_in_for" value="insert"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.insert_space_after_binary_operator" value="insert"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.insert_space_before_colon_in_conditional" value="insert"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.keep_else_statement_on_same_line" value="false"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.insert_new_line_before_while_in_do_statement" value="not-insert"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.indent_switchstatements_compare_to_cases" value="true"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.insert_new_line_before_return_statement" value="insert"/>
|
||||
<setting id="FORMATTER_BLANK_LINES_BEFORE_CONSTANT" value="0"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.indent_breaks_compare_to_cases" value="true"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.brace_position_for_array_initializer" value="end_of_line"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.blank_lines_before_imports" value="5"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.insert_space_after_closing_brace_in_block" value="insert"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.insert_space_before_assignment_operator" value="insert"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.insert_space_before_colon_in_for" value="insert"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.insert_space_after_comma_in_superinterfaces" value="insert"/>
|
||||
<setting id="FORMATTER_INSERT_SPACE_BEFORE_CONCAT" value="not-insert"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.alignment_for_multiple_fields" value="1"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.insert_space_before_question_in_conditional" value="insert"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.continuation_indentation" value="1"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.indent_statements_compare_to_block" value="true"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.preserve_extra_carriage_returns2" value=""/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.insert_space_before_binary_operator" value="insert"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.insert_space_before_opening_paren_in_switch" value="insert"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.insert_new_line_in_empty_type_declaration" value="a,span,i,b,em,strong,h1,h2,h3,h4,h5,h6,title,option"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.insert_space_after_question_in_conditional" value="insert"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.insert_new_line_before_finally_in_try_statement" value="not-insert"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.continuation_indentation_for_array_initializer" value="2"/>
|
||||
<setting id="FORMATTER_INSERT_SPACE_AFTER_CONCAT" value="not-insert"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.insert_space_before_opening_brace_in_block" value="insert"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="false"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.insert_space_after_comma_in_for_increments" value="insert"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.insert_new_line_in_empty_enum_declaration" value="doctype,br,link,meta"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.compact_else_if" value="true"/>
|
||||
<setting id="FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_MULTIPLE_CONSTANT_DECLARATIONS" value="insert"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.insert_space_after_comma_in_for_inits" value="insert"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.insert_new_line_in_empty_block" value="insert"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.tabulation.size" value="4"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.insert_space_after_and_in_type_parameter" value=""/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.insert_space_after_colon_in_conditional" value="insert"/>
|
||||
<setting id="FORMATTER_INSERT_SPACE_AFTER_OBJECT_OPERATOR" value="not-insert"/>
|
||||
<setting id="FORMATTER_INSERT_NEW_LINE_IN_EMPTY_CLASS_BODY" value="insert"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.insert_space_after_colon_in_for" value="insert"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.brace_position_for_switch" value="end_of_line"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.blank_lines_before_method" value="0"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.insert_space_after_comma_in_array_initializer" value="insert"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.tabulation.char" value=" "/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.brace_position_for_block" value="end_of_line"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.brace_position_for_block_in_case" value="end_of_line"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.keep_imple_if_on_one_line" value="false"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.insert_space_before_opening_paren_in_for" value="insert"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.insert_space_before_opening_paren_in_while" value="insert"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.insert_new_line_before_else_in_if_statement" value="not-insert"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.keep_then_statement_on_same_line" value="false"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.indent_switchstatements_compare_to_switch" value="false"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.wraptags2" value=""/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.insert_space_after_assignment_operator" value="insert"/>
|
||||
<setting id="com.aptana.ide.editors.codeassist.formatter.insert_space_before_opening_paren_in_if" value="insert"/>
|
||||
</profile>
|
||||
</profiles>
|
@@ -1,15 +0,0 @@
|
||||
#!/bin/bash
|
||||
FILES=`find ../ \( \( -iwholename '*tool*' -o -iwholename '*lang*' \) -prune -o -iname '*.php' \) -a -type f`
|
||||
|
||||
for entry in ${FILES}; do
|
||||
php -l ${entry}
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
exit;
|
||||
fi
|
||||
done
|
||||
|
||||
for entry in ${FILES}; do
|
||||
echo "running phpcs --standard=PEAR on ${entry}"
|
||||
phpcs --standard=PEAR ${entry}
|
||||
done
|
@@ -1,46 +1,32 @@
|
||||
<?php
|
||||
echo "<!DOCTYPE html>";
|
||||
echo "<head>";
|
||||
echo "<meta charset=\"UTF-8\">";
|
||||
echo "<title> </title>";
|
||||
echo "</head>";
|
||||
echo "<body>";
|
||||
if (PHP_OS != 'Linux') {
|
||||
echo "Test works only on Linux";
|
||||
echo "</body>";
|
||||
die();
|
||||
}
|
||||
|
||||
define('APP_ROOT', dirname(__FILE__).'/..');
|
||||
require_once APP_ROOT.'/includes/interface/class.PSI_Interface_OS.inc.php';
|
||||
require_once APP_ROOT.'/includes/os/class.OS.inc.php';
|
||||
require_once APP_ROOT.'/includes/to/class.System.inc.php';
|
||||
require_once APP_ROOT.'/includes/os/class.Linux.inc.php';
|
||||
define('PSI_USE_VHOST', false);
|
||||
define('PSI_APP_ROOT', dirname(__FILE__).'/..');
|
||||
define('PSI_DEBUG', false);
|
||||
define('PSI_LOAD_BAR', false);
|
||||
require_once PSI_APP_ROOT.'/includes/interface/class.PSI_Interface_OS.inc.php';
|
||||
require_once PSI_APP_ROOT.'/includes/os/class.OS.inc.php';
|
||||
require_once PSI_APP_ROOT.'/includes/to/class.System.inc.php';
|
||||
require_once PSI_APP_ROOT.'/includes/os/class.Linux.inc.php';
|
||||
|
||||
$log_file = "";
|
||||
$lsb = true; //enable detection lsb_release -a
|
||||
$lsbfile = true; //enable detection /etc/lsb-release
|
||||
$files = true; //enable detection files
|
||||
$osfile = true; //enable detection /etc/os-release
|
||||
$other = true; //enable other detection
|
||||
|
||||
class Error
|
||||
class PSI_Error
|
||||
{
|
||||
public static function singleton()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
class Parser
|
||||
{
|
||||
public static function lspci()
|
||||
{
|
||||
return array();
|
||||
}
|
||||
public static function df()
|
||||
{
|
||||
return array();
|
||||
}
|
||||
}
|
||||
|
||||
class CommonFunctions
|
||||
{
|
||||
private static function _parse_log_file($string)
|
||||
@@ -48,6 +34,7 @@ class CommonFunctions
|
||||
global $log_file;
|
||||
if (file_exists($log_file)) {
|
||||
$contents = @file_get_contents($log_file);
|
||||
$contents = preg_replace("/\r\n/", "\n", $contents);
|
||||
if ($contents && preg_match("/^\-\-\-\-\-\-\-\-\-\-".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)) {
|
||||
@@ -68,9 +55,20 @@ class CommonFunctions
|
||||
|
||||
public static function rfts($strFileName, &$strRet, $intLines = 0, $intBytes = 4096, $booErrorRep = true)
|
||||
{
|
||||
global $lsb;
|
||||
global $lsbfile;
|
||||
if ($lsb || $lsbfile || ($strFileName != "/etc/lsb-release")) {
|
||||
global $files;
|
||||
global $osfile;
|
||||
global $other;
|
||||
if ($strFileName=="/etc/lsb-release") {
|
||||
$test = $lsbfile;
|
||||
} elseif ($strFileName=="/etc/os-release") {
|
||||
$test = $osfile;
|
||||
} elseif (($strFileName=="/etc/DISTRO_SPECS") || ($strFileName=="/etc/distro-release")|| ($strFileName=="/etc/system-release") || ($strFileName=="/etc/debian_version") || ($strFileName=="/etc/slackware-version") || ($strFileName=="/etc/config/uLinux.conf")) {
|
||||
$test = $other;
|
||||
} else {
|
||||
$test = $files;
|
||||
}
|
||||
if ($test) {
|
||||
$strRet=self::_parse_log_file($strFileName);
|
||||
if ($strRet && ($intLines == 1) && (strpos($strRet, "\n") !== false)) {
|
||||
$strRet=trim(substr($strRet, 0, strpos($strRet, "\n")));
|
||||
@@ -82,127 +80,116 @@ class CommonFunctions
|
||||
}
|
||||
}
|
||||
|
||||
public static function executeProgram($strProgramname, $strArgs, &$strBuffer, $booErrorRep = true)
|
||||
public static function executeProgram($strProgramname, $strArgs, &$strBuffer, $booErrorRep = true, $timeout = 30)
|
||||
{
|
||||
global $lsb;
|
||||
global $files;
|
||||
$strBuffer = '';
|
||||
if ($strProgramname=='lsb_release') {
|
||||
return $lsb && ($strBuffer = self::_parse_log_file('lsb_release -a'));
|
||||
} else {
|
||||
return $strBuffer = self::_parse_log_file($strProgramname);
|
||||
return $files && ($strBuffer = self::_parse_log_file($strProgramname));
|
||||
}
|
||||
}
|
||||
|
||||
public static function fileexists($strFileName)
|
||||
{
|
||||
global $log_file;
|
||||
global $lsb;
|
||||
global $lsbfile;
|
||||
if (file_exists($log_file)
|
||||
&& ($lsb || $lsbfile || ($strFileName != "/etc/lsb-release"))
|
||||
&& ($contents = @file_get_contents($log_file))
|
||||
&& preg_match("/^\-\-\-\-\-\-\-\-\-\-".preg_quote($strFileName, '/')."\-\-\-\-\-\-\-\-\-\-\n/m", $contents)) {
|
||||
return true;
|
||||
global $files;
|
||||
global $osfile;
|
||||
global $other;
|
||||
global $log_file;
|
||||
if ($strFileName=="/etc/lsb-release") {
|
||||
$test = $lsbfile;
|
||||
} elseif ($strFileName=="/etc/os-release") {
|
||||
$test = $osfile;
|
||||
} elseif (($strFileName=="/etc/DISTRO_SPECS") || ($strFileName=="/etc/distro-release") || ($strFileName=="/etc/system-release") || ($strFileName=="/etc/debian_version") || ($strFileName=="/etc/slackware-version") || ($strFileName=="/etc/config/uLinux.conf")) {
|
||||
$test = $other;
|
||||
} else {
|
||||
$test = $files;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static function gdc()
|
||||
{
|
||||
return array();
|
||||
return $test && file_exists($log_file) && ($contents = @file_get_contents($log_file)) && preg_match("/^\-\-\-\-\-\-\-\-\-\-".preg_quote($strFileName, '/')."\-\-\-\-\-\-\-\-\-\-\r?\n/m", $contents);
|
||||
}
|
||||
}
|
||||
|
||||
$system = new Linux();
|
||||
if ($handle = opendir(APP_ROOT.'/sample/distrotest')) {
|
||||
echo "<table cellpadding=\"2\" border=\"1\" CELLSPACING=\"0\"";
|
||||
echo "<tr>";
|
||||
echo "<td>Distrotest sample</td>";
|
||||
echo "<td>Distro Name</td>";
|
||||
echo "<td>Distro Icon</td>";
|
||||
echo "<td>Distro Name (no lsb_release)</td>";
|
||||
echo "<td>Distro Icon (no lsb_release)</td>";
|
||||
echo "<td>Distro Name (no lsb_release and no /etc/lsb-release)</td>";
|
||||
echo "<td>Distro Icon (no lsb_release and no /etc/lsb-release)</td>";
|
||||
echo "</tr>";
|
||||
while (false !== ($entry = readdir($handle))) {
|
||||
if (($entry!=".")&&($entry!="..")) {
|
||||
if ($shandle = opendir(APP_ROOT."/sample/distrotest/$entry")) {
|
||||
while (false !== ($sentry = readdir($shandle))) {
|
||||
if (($sentry!=".")&&($sentry!="..")) {
|
||||
$log_file=APP_ROOT.'/sample/distrotest/'.$entry.'/'.$sentry;
|
||||
class _Linux extends Linux
|
||||
{
|
||||
public function build()
|
||||
{
|
||||
parent::_distro();
|
||||
}
|
||||
}
|
||||
|
||||
function echodist($entry, $system, $_lsb, $_lsbfile, $_files, $_osfile, $_other)
|
||||
{
|
||||
global $lsb;
|
||||
global $lsbfile;
|
||||
global $files;
|
||||
global $osfile;
|
||||
global $other;
|
||||
|
||||
$lsb = $_lsb;
|
||||
$lsbfile = $_lsbfile;
|
||||
$files = $_files;
|
||||
$osfile = $_osfile;
|
||||
$other = $_other;
|
||||
|
||||
$sys = $system->getSys();
|
||||
$distro=$sys->getDistribution();
|
||||
$icon=$sys->getDistributionIcon();
|
||||
if ($icon == '') $icon="unknown.png";
|
||||
echo "<td>";
|
||||
|
||||
if ($icon != $entry.'.png')
|
||||
echo "<span style='color:red'>";
|
||||
else
|
||||
echo "<span>";
|
||||
if ($distro !== 'Linux') {
|
||||
echo "<img src=\"../gfx/images/".$icon."\" title=\"".$icon."\" height=\"16\" width=\"16\"/>";
|
||||
echo $distro;
|
||||
}
|
||||
echo "</span></td>";
|
||||
$sys->setDistributionIcon("");
|
||||
}
|
||||
|
||||
$system = new _Linux('none');
|
||||
$dirs = scandir(PSI_APP_ROOT.'/sample/distrotest');
|
||||
if (($dirs !== false) && (count($dirs) > 0)) {
|
||||
$dirs = array_diff($dirs, array('.', '..'));
|
||||
if (($dirs !== false) && (count($dirs) > 0)) {
|
||||
natcasesort($dirs);
|
||||
echo "<table cellpadding=\"2\" border=\"1\" CELLSPACING=\"0\">";
|
||||
echo "<tr>";
|
||||
echo "<td>Distrotest sample</td>";
|
||||
echo "<td>Distro Name</td>";
|
||||
echo "<td>Distro Name (lsb_release only)</td>";
|
||||
echo "<td>Distro Name (/etc/lsb-release only)</td>";
|
||||
echo "<td>Distro Name (files only)</td>";
|
||||
echo "<td>Distro Name (os-release only)</td>";
|
||||
echo "<td>Distro Name (other only)</td>";
|
||||
echo "</tr>";
|
||||
foreach ($dirs as $entry) {
|
||||
$files = scandir(PSI_APP_ROOT."/sample/distrotest/$entry");
|
||||
if (($files !== false) && (count($files) > 0)) {
|
||||
$files = array_diff($files, array('.', '..'));
|
||||
if (($files !== false) && (count($files) > 0)) {
|
||||
natcasesort($files);
|
||||
foreach ($files as $sentry) {
|
||||
$log_file=PSI_APP_ROOT.'/sample/distrotest/'.$entry.'/'.$sentry;
|
||||
echo "<tr>";
|
||||
echo "<td>".$entry.'/'.$sentry."</td>";
|
||||
|
||||
$lsb = true;
|
||||
$lsbfile = true;
|
||||
$sys=$system->getSys();
|
||||
$distro=$sys->getDistribution();
|
||||
$icon=$sys->getDistributionIcon();
|
||||
if ($icon == '') $icon="unknown.png";
|
||||
if ($icon != $entry.'.png')
|
||||
echo "<td style='color:red'>";
|
||||
else
|
||||
echo "<td>";
|
||||
echo $distro."</td>";
|
||||
if ($icon != $entry.'.png')
|
||||
echo "<td style='color:red'>";
|
||||
else
|
||||
echo "<td>";
|
||||
echo "<img src=\"../gfx/images/".$icon."\" height=\"16\" width=\"16\">";
|
||||
echo $icon."</td>";
|
||||
$sys->setDistribution("");
|
||||
$sys->setDistributionIcon("");
|
||||
|
||||
$lsb = false;
|
||||
$lsbfile = true;
|
||||
$sys=$system->getSys();
|
||||
$distro=$sys->getDistribution();
|
||||
$icon=$sys->getDistributionIcon();
|
||||
if ($icon == '') $icon="unknown.png";
|
||||
if ($icon != $entry.'.png')
|
||||
echo "<td style='color:red'>";
|
||||
else
|
||||
echo "<td>";
|
||||
echo $distro."</td>";
|
||||
if ($icon != $entry.'.png')
|
||||
echo "<td style='color:red'>";
|
||||
else
|
||||
echo "<td>";
|
||||
echo "<img src=\"../gfx/images/".$icon."\" height=\"16\" width=\"16\">";
|
||||
echo $icon."</td>";
|
||||
$sys->setDistribution("");
|
||||
$sys->setDistributionIcon("");
|
||||
|
||||
$lsb = false;
|
||||
$lsbfile = false;
|
||||
$sys=$system->getSys();
|
||||
$distro=$sys->getDistribution();
|
||||
$icon=$sys->getDistributionIcon();
|
||||
if ($icon == '') $icon="unknown.png";
|
||||
if ($icon != $entry.'.png')
|
||||
echo "<td style='color:red'>";
|
||||
else
|
||||
echo "<td>";
|
||||
echo $distro."</td>";
|
||||
if ($icon != $entry.'.png')
|
||||
echo "<td style='color:red'>";
|
||||
else
|
||||
echo "<td>";
|
||||
echo "<img src=\"../gfx/images/".$icon."\" height=\"16\" width=\"16\">";
|
||||
echo $icon."</td>";
|
||||
$sys->setDistribution("");
|
||||
$sys->setDistributionIcon("");
|
||||
|
||||
echodist($entry, $system, true, true, true, true, true);
|
||||
echodist($entry, $system, true, false, false, false, false);
|
||||
echodist($entry, $system, false, true, false, false, false);
|
||||
echodist($entry, $system, false, false, true, false, false);
|
||||
echodist($entry, $system, false, false, false, true, false);
|
||||
echodist($entry, $system, false, false, false, false, true);
|
||||
echo "</tr>";
|
||||
}
|
||||
}
|
||||
closedir($shandle);
|
||||
}
|
||||
}
|
||||
echo "</table>";
|
||||
}
|
||||
echo "</table>";
|
||||
closedir($handle);
|
||||
}
|
||||
echo "</body>";
|
||||
|
79
root/opt/phpsysinfo/tools/checkpng.php
Normal file
79
root/opt/phpsysinfo/tools/checkpng.php
Normal file
@@ -0,0 +1,79 @@
|
||||
<?php
|
||||
echo "<!DOCTYPE html>";
|
||||
echo "<head>";
|
||||
echo "<meta charset=\"UTF-8\">";
|
||||
echo "<title> </title>";
|
||||
echo "<!--[if lte IE 6]>";
|
||||
echo " <script type=\"text/JavaScript\" src=\"../js/jQuery/jquery.js\"></script>";
|
||||
echo " <script type=\"text/JavaScript\" src=\"../js/jQuery/jquery.ifixpng.js\"></script>";
|
||||
echo " <script type=\"text/JavaScript\">";
|
||||
echo " function PNGload(png) {";
|
||||
echo " if (typeof(png.ifixpng)==='function') {";
|
||||
echo " png.ifixpng('../gfx/blank.gif');";
|
||||
echo " }";
|
||||
echo " }";
|
||||
echo "</script>";
|
||||
echo "<![endif]-->";
|
||||
echo "</head>";
|
||||
echo "<body>";
|
||||
|
||||
$pngtable = glob('{../gfx/images/*.png,../plugins/*/gfx/*.png}', GLOB_BRACE);
|
||||
if (is_array($pngtable) && (($total = count($pngtable)) > 0)) {
|
||||
echo "<table cellpadding=\"2\" border=\"1\" CELLSPACING=\"0\">";
|
||||
echo "<tr>";
|
||||
echo "<td>PNG name</td>";
|
||||
echo "<td>16x16</td>";
|
||||
echo "<td>32x32</td>";
|
||||
echo "<td style=\"background-color:#ccc\">16x16</td>";
|
||||
echo "<td style=\"background-color:#ccc\">32x32</td>";
|
||||
echo "<td style=\"background-color:#272b30\">16x16</td>";
|
||||
echo "<td style=\"background-color:#272b30\">32x32</td>";
|
||||
echo "</tr>";
|
||||
for ($i = 0; $i < $total; $i++) {
|
||||
echo "<tr>";
|
||||
echo "<td>".$pngtable[$i]."</td>";
|
||||
echo "<!--[if lte IE 6]>";
|
||||
echo "<td>";
|
||||
echo "<img src=\"".$pngtable[$i]."\" height=\"16\" width=\"16\" onload='PNGload($(this));'/>";
|
||||
echo "</td>";
|
||||
echo "<td>";
|
||||
echo "<img src=\"".$pngtable[$i]."\" height=\"32\" width=\"32\" onload='PNGload($(this));'/>";
|
||||
echo "</td>";
|
||||
echo "<td style=\"background-color:#ccc\">";
|
||||
echo "<img src=\"".$pngtable[$i]."\" height=\"16\" width=\"16\" onload='PNGload($(this));'/>";
|
||||
echo "</td>";
|
||||
echo "<td style=\"background-color:#ccc\">";
|
||||
echo "<img src=\"".$pngtable[$i]."\" height=\"32\" width=\"32\" onload='PNGload($(this));'/>";
|
||||
echo "</td>";
|
||||
echo "<td style=\"background-color:#272b30\">";
|
||||
echo "<img src=\"".$pngtable[$i]."\" height=\"16\" width=\"16\" onload='PNGload($(this));'/>";
|
||||
echo "</td>";
|
||||
echo "<td style=\"background-color:#272b30\">";
|
||||
echo "<img src=\"".$pngtable[$i]."\" height=\"32\" width=\"32\" onload='PNGload($(this));'/>";
|
||||
echo "</td>";
|
||||
echo "<![endif]-->";
|
||||
echo "<!--[if gt IE 6]><!-->";
|
||||
echo "<td>";
|
||||
echo "<img src=\"".$pngtable[$i]."\" height=\"16\" width=\"16\"/>";
|
||||
echo "</td>";
|
||||
echo "<td>";
|
||||
echo "<img src=\"".$pngtable[$i]."\" height=\"32\" width=\"32\"/>";
|
||||
echo "</td>";
|
||||
echo "<td style=\"background-color:#ccc\">";
|
||||
echo "<img src=\"".$pngtable[$i]."\" height=\"16\" width=\"16\"/>";
|
||||
echo "</td>";
|
||||
echo "<td style=\"background-color:#ccc\">";
|
||||
echo "<img src=\"".$pngtable[$i]."\" height=\"32\" width=\"32\"/>";
|
||||
echo "</td>";
|
||||
echo "<td style=\"background-color:#272b30\">";
|
||||
echo "<img src=\"".$pngtable[$i]."\" height=\"16\" width=\"16\"/>";
|
||||
echo "</td>";
|
||||
echo "<td style=\"background-color:#272b30\">";
|
||||
echo "<img src=\"".$pngtable[$i]."\" height=\"32\" width=\"32\"/>";
|
||||
echo "</td>";
|
||||
echo "<!--<![endif]-->";
|
||||
echo "</tr>";
|
||||
}
|
||||
echo "</table>";
|
||||
}
|
||||
echo "</body>";
|
12
root/opt/phpsysinfo/tools/cputest.php
Normal file
12
root/opt/phpsysinfo/tools/cputest.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
header('Content-Type: text/plain');
|
||||
$filename = '/proc/cpuinfo';
|
||||
$contents=file_get_contents($filename);
|
||||
echo "----------".$filename."----------\n";
|
||||
if (strlen($contents)>0) {
|
||||
if (substr($contents, -1)!="\n") {
|
||||
$contents.="\n";
|
||||
}
|
||||
$contents = preg_replace('/^(\s*serial\s*:\s*)(\S+)/im', '$1xxxxxxxxxxxxxxxx', $contents);
|
||||
echo $contents;
|
||||
}
|
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
header("Content-Type: text/plain");
|
||||
header('Content-Type: text/plain');
|
||||
$filemaskarray=array("/etc/*-release",
|
||||
"/etc/*_release",
|
||||
"/etc/*-version",
|
||||
@@ -10,6 +10,7 @@ $filemaskarray=array("/etc/*-release",
|
||||
"/etc/eisfair-system",
|
||||
"/usr/share/doc/tc/release.txt",
|
||||
"/etc/synoinfo.conf",
|
||||
"/etc/config/uLinux.conf",
|
||||
"/etc/salix-update-notifier.conf",
|
||||
"/etc/solydxk/info",
|
||||
"/etc/vortexbox/vortexbox-version",
|
||||
@@ -34,11 +35,14 @@ if (is_resource($fp)) {
|
||||
}
|
||||
|
||||
foreach ($filemaskarray as $filemask) {
|
||||
foreach (glob($filemask) as $filename) {
|
||||
echo "----------".$filename."----------\n";
|
||||
echo $contents=file_get_contents($filename);
|
||||
if ((strlen($contents)>0)&&(substr($contents, -1)!="\n")) {
|
||||
echo "\n";
|
||||
$filenames = glob($filemask);
|
||||
if (is_array($filenames)) foreach ($filenames as $filename) {
|
||||
if (!is_dir($filename)) {
|
||||
echo "----------".$filename."----------\n";
|
||||
echo $contents=file_get_contents($filename);
|
||||
if ((strlen($contents)>0)&&(substr($contents, -1)!="\n")) {
|
||||
echo "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,10 +0,0 @@
|
||||
@echo off
|
||||
echo.
|
||||
echo Starting SVN Stat + PHP Lint
|
||||
echo ============================
|
||||
svn stat |findstr /I /R "\.php$ \.phtml$" >lint.txt
|
||||
for /F "tokens=2 delims= " %%i in (lint.txt) do q:\php53\php.exe -l %%i |findstr /I /B /V "No syntax errors"
|
||||
del lint.txt
|
||||
echo.
|
||||
echo ============================
|
||||
echo Finished SVN Stat + PHP Lint
|
72
root/opt/phpsysinfo/tools/phptest.php
Normal file
72
root/opt/phpsysinfo/tools/phptest.php
Normal file
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
function echoinfo($extension) {
|
||||
echo " ".$extension;
|
||||
switch(strtolower($extension)) {
|
||||
case 'json':
|
||||
echo " - reqired for bootstrap and xml json mode";
|
||||
break;
|
||||
case 'simplexml':
|
||||
case 'pcre':
|
||||
case 'dom':
|
||||
case 'xml':
|
||||
// echo " - reqired";
|
||||
break;
|
||||
case 'com_dotnet':
|
||||
echo " - reqired on WINNT systems";
|
||||
break;
|
||||
case 'snmp':
|
||||
echo " - reqired for snmppinfo plugin and snmpups";
|
||||
break;
|
||||
case 'pfsense':
|
||||
echo " - loaded on pfSense system";
|
||||
break;
|
||||
case 'mbstring':
|
||||
echo " - reqired on non UTF-8 and non CP437 systems";
|
||||
break;
|
||||
case 'xsl':
|
||||
echo " - reqired for static mode";
|
||||
}
|
||||
echo "\n";
|
||||
}
|
||||
|
||||
header('Content-Type: text/plain');
|
||||
|
||||
echo "SERVER SOFTWARE: ".$_SERVER["SERVER_SOFTWARE"]."\n";
|
||||
echo "PHP VERSION: ".PHP_VERSION;
|
||||
if (version_compare("5.1.3", PHP_VERSION, ">")) {
|
||||
echo " - PHP 5.1.3 or greater is required!!!";
|
||||
}
|
||||
echo "\n";
|
||||
|
||||
echo "PHP EXTENSIONS:\n";
|
||||
$arrReq = array('simplexml', 'pcre', 'xml', 'dom', 'mbstring', 'com_dotnet', 'json', 'xsl', 'snmp', 'pfsense');
|
||||
$extensions = get_loaded_extensions();
|
||||
$extarray = array();
|
||||
foreach ($extensions as $extension) {
|
||||
$extarray[strtolower($extension)] = $extension;
|
||||
}
|
||||
|
||||
$first = true;
|
||||
foreach ($arrReq as $extension) if (isset($extarray[$extension])) {
|
||||
if ($first) {
|
||||
echo " requred loaded:\n";
|
||||
$first = false;
|
||||
}
|
||||
echoinfo($extarray[$extension]);
|
||||
}
|
||||
$first = true;
|
||||
foreach ($arrReq as $extension) if (!isset($extarray[$extension])) {
|
||||
if ($first) {
|
||||
echo " requred not loaded:\n";
|
||||
$first = false;
|
||||
}
|
||||
echoinfo($extension);
|
||||
}
|
||||
$first = true;
|
||||
foreach ($extarray as $extlower=>$extension) if (!in_array($extlower, $arrReq, true)) {
|
||||
if ($first) {
|
||||
echo " others loaded:\n";
|
||||
$first = false;
|
||||
}
|
||||
echoinfo($extension);
|
||||
}
|
BIN
root/opt/phpsysinfo/tools/speedfan/SpeedFanGet_bin.zip
Normal file
BIN
root/opt/phpsysinfo/tools/speedfan/SpeedFanGet_bin.zip
Normal file
Binary file not shown.
BIN
root/opt/phpsysinfo/tools/speedfan/SpeedFanGet_src.zip
Normal file
BIN
root/opt/phpsysinfo/tools/speedfan/SpeedFanGet_src.zip
Normal file
Binary file not shown.
Reference in New Issue
Block a user