/web/acc/phpsysinfo/tools/MakeRelease.sh |
---|
0,0 → 1,32 |
#!/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 |
Property changes: |
Added: svn:eol-style |
+native |
\ No newline at end of property |
Added: svn:executable |
+* |
\ No newline at end of property |
/web/acc/phpsysinfo/tools/README |
---|
0,0 → 1,4 |
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) |
/web/acc/phpsysinfo/tools/check.sh |
---|
0,0 → 1,15 |
#!/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 |
Property changes: |
Added: svn:eol-style |
+native |
\ No newline at end of property |
Added: svn:executable |
+* |
\ No newline at end of property |
/web/acc/phpsysinfo/tools/checkdistro.php |
---|
0,0 → 1,219 |
<?php |
echo "<!DOCTYPE html>"; |
echo "<head>"; |
echo "<meta charset=\"UTF-8\">"; |
echo "<title> </title>"; |
echo "</head>"; |
echo "<body>"; |
define('PSI_APP_ROOT', dirname(__FILE__).'/..'); |
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'; |
define('PSI_USE_VHOST', false); |
define('PSI_DEBUG', false); |
define('PSI_LOAD_BAR', false); |
$log_file = ""; |
$lsb = true; //enable detection lsb_release -a |
$lsbfile = true; //enable detection /etc/lsb-release |
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) |
{ |
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)) { |
$startIndex = $matches[0][1]+1; |
if (preg_match("/^\-\-\-\-\-\-\-\-\-\-/m", $contents, $matches, PREG_OFFSET_CAPTURE, $startIndex)) { |
$stopIndex = $matches[0][1]; |
return substr($contents, $startIndex, $stopIndex-$startIndex); |
} else { |
return substr($contents, $startIndex); |
} |
} |
} |
} |
return false; |
} |
public static function rfts($strFileName, &$strRet, $intLines = 0, $intBytes = 4096, $booErrorRep = true) |
{ |
global $lsb; |
global $lsbfile; |
if ($lsb || $lsbfile || ($strFileName != "/etc/lsb-release")) { |
$strRet=self::_parse_log_file($strFileName); |
if ($strRet && ($intLines == 1) && (strpos($strRet, "\n") !== false)) { |
$strRet=trim(substr($strRet, 0, strpos($strRet, "\n"))); |
} |
return $strRet; |
} else { |
return false; |
} |
} |
public static function executeProgram($strProgramname, $strArgs, &$strBuffer, $booErrorRep = true, $timeout = 30) |
{ |
global $lsb; |
$strBuffer = ''; |
if ($strProgramname=='lsb_release') { |
return $lsb && ($strBuffer = self::_parse_log_file('lsb_release -a')); |
} else { |
return $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, '/')."\-\-\-\-\-\-\-\-\-\-\r?\n/m", $contents)) { |
return true; |
} |
return false; |
} |
public static function readenv($strElem, &$strBuffer) |
{ |
return false; |
} |
public static function gdc() |
{ |
return array(); |
} |
} |
class _Linux extends Linux |
{ |
public function build() |
{ |
parent::_distro(); |
} |
} |
$system = new _Linux(); |
if ($handle = opendir(PSI_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(PSI_APP_ROOT."/sample/distrotest/$entry")) { |
while (false !== ($sentry = readdir($shandle))) { |
if (($sentry!=".")&&($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(""); |
echo "</tr>"; |
} |
} |
closedir($shandle); |
} |
} |
} |
echo "</table>"; |
closedir($handle); |
} |
echo "</body>"; |
/web/acc/phpsysinfo/tools/checkpng.php |
---|
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>"; |
/web/acc/phpsysinfo/tools/cputest.php |
---|
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; |
} |
/web/acc/phpsysinfo/tools/distrotest.php |
---|
0,0 → 1,46 |
<?php |
header("Content-Type: text/plain"); |
$filemaskarray=array("/etc/*-release", |
"/etc/*_release", |
"/etc/*-version", |
"/etc/*_version", |
"/etc/version", |
"/etc/release", |
"/etc/DISTRO_SPECS", |
"/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", |
"/etc/GoboLinuxVersion", |
"/etc/VERSION"); |
$fp = popen("lsb_release -a 2>/dev/null", "r"); |
if (is_resource($fp)) { |
$contents=""; |
$start=true; |
while (!feof($fp)) { |
$contents=fgets($fp, 4096); |
if ($start && (strlen($contents)>0)) { |
echo "----------lsb_release -a----------\n"; |
$start=false; |
} |
echo $contents; |
} |
if ((strlen($contents)>0)&&(substr($contents, -1)!="\n")) { |
echo "\n"; |
} |
pclose($fp); |
} |
foreach ($filemaskarray as $filemask) { |
$filenames = glob($filemask); |
if (is_array($filenames)) foreach ($filenames as $filename) { |
echo "----------".$filename."----------\n"; |
echo $contents=file_get_contents($filename); |
if ((strlen($contents)>0)&&(substr($contents, -1)!="\n")) { |
echo "\n"; |
} |
} |
} |
/web/acc/phpsysinfo/tools/lint.bat |
---|
0,0 → 1,10 |
@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 |
/web/acc/phpsysinfo/tools/phpsysinfo.ini |
---|
0,0 → 1,12 |
pear=on |
filename=Q:\Documents\Aptana Studio\workspace\phpsysinfo-dev\plugins\quotas\class.quotas.inc.php,Q:\Documents\Aptana Studio\workspace\phpsysinfo-dev\xml.php,Q:\Documents\Aptana Studio\workspace\phpsysinfo-dev\config.php,Q:\Documents\Aptana Studio\workspace\phpsysinfo-dev\plugins\ps\class.ps.inc.php,Q:\Documents\Aptana Studio\workspace\phpsysinfo-dev\index.php,Q:\Documents\Aptana Studio\workspace\phpsysinfo-dev\plugins\psstatus\class.psstatus.inc.php,Q:\Documents\Aptana Studio\workspace\phpsysinfo-dev\plugins\mdstatus\class.mdstatus.inc.php,Q:\Documents\Aptana Studio\workspace\phpsysinfo-dev\js.php |
output=HTML:Smarty:PHP |
defaultpackagename=__default__ |
parseprivate=on |
hidden=off |
directory=Q:\Documents\Aptana Studio\workspace\phpsysinfo-dev\includes\plugin,Q:\Documents\Aptana Studio\workspace\phpsysinfo-dev\includes\mb,Q:\Documents\Aptana Studio\workspace\phpsysinfo-dev\includes\ups,Q:\Documents\Aptana Studio\workspace\phpsysinfo-dev\includes\interface,Q:\Documents\Aptana Studio\workspace\phpsysinfo-dev\includes\output,Q:\Documents\Aptana Studio\workspace\phpsysinfo-dev\language,Q:\Documents\Aptana Studio\workspace\phpsysinfo-dev\includes\xml,Q:\Documents\Aptana Studio\workspace\phpsysinfo-dev\includes\error,Q:\Documents\Aptana Studio\workspace\phpsysinfo-dev\includes\os |
target=Q:\Documents\Aptana Studio\workspace\phpsysinfo-dev\phpDoc |
defaultcategoryname=__default__ |
title=phpSysInfo API Documentation |
sourcecode=on |
javadocdesc=off |