Ejemplo n.º 1
0
 private function getValues($key, $branch = false)
 {
     $result = array();
     if (check_phpversion("5.0.0")) {
         $this->xmlobject = new \SimpleXMLElement($this->_xml);
         if ($branch != true) {
             $values = @$this->xmlobject->xpath("/" . $key);
             foreach ((array) $values as $value) {
                 return $value;
             }
         } else {
             $i = 0;
             $branches = $this->xmlobject->xpath("/" . $key);
             foreach ($branches as $value) {
                 $subbranches = $value->children();
                 foreach ($subbranches as $subvalue) {
                     $attributes = $subvalue->attributes();
                     foreach ($attributes as $attributeName => $attributeValue) {
                         $attribName = trim((string) $attributeName);
                         $attribVal = trim((string) $attributeValue);
                         $result[$i][$attribName] = $attribVal;
                     }
                     $i++;
                 }
             }
             return $result;
         }
     }
 }
Ejemplo n.º 2
0
 if ($webmail_enable && $webmail_path && !is_writeable("{$bazar_dir}/{$webmail_path}")) {
     $echo .= "<b><font color=red>ERROR</font></b> Check <b>\$webmail_path</b> - it is not writeable (check permissions - chmod 777)<br>";
 }
 if ($fix_tmp_dir && !is_writeable($fix_tmp_dir)) {
     $echo .= "<b><font color=red>ERROR</font></b> Check <b>\$fix_tmp_dir</b> - it is not writeable (check permissions - chmod 777)<br>";
 }
 if ($fix_tmp_dir && !is_dir($fix_tmp_dir)) {
     $echo .= "<b><font color=red>ERROR</font></b> Check <b>\$fix_tmp_dir</b> - it is not a directory<br>";
 }
 if ($convertpath == "GDLIB" && !function_exists("imagegd")) {
     $echo .= "<b><font color=red>ERROR</font></b> GD Library is not installed<br>";
 }
 if ($convertpath && $convertpath != "GDLIB" && $convertpath != "AUTO" && !is_file($convertpath)) {
     $echo .= "<b><font color=red>ERROR</font></b> Convertpath <b>\$convertpath</b> is not a file or executeable<br>";
 }
 if (!check_phpversion("4.1.0")) {
     $echo2 .= "<b><font color=orange>WARNING</font></b> Too old PHP #{$Id}\$<b>" . phpversion() . "</b>, some functions may not work - Please update PHP (min. 4.1.0)<br>";
 }
 if (!check_optversion("2.1.0")) {
     $echo .= "<b><font color=red>ERROR</font></b> ZEND Optimizer to old #{$Id}{$or} not installed - Please install min. ZEND Optimizer 2.1.0<br>";
 }
 if ($convertpath == "GDLIB" && function_exists("imagegd") && !function_exists("imagegd2")) {
     echo "<b><font color=orange>WARNING</font></b> GD Library 2 is not installed - Please update (suggested > 2.0.1), or set \$convertpath=\"AUTO\"<br>";
 }
 if (!$echo) {
     $echo = "All Checks Passed <b><font color=green>OK</font></b><br>";
 }
 echo $echo;
 echo "<br><br><table width=\"400\" border=\"1\" align=center><tr><td><center><br>";
 echo "<form method=\"POST\" action=\"{$_SERVER['PHP_SELF']}\"><input type=\"hidden\" name=\"action\" value=\"del\"><input type=\"submit\" onclick=\"return jsconfirm()\" value=\"INSTALL TABLES Version 2.0.x\n!!! this DELETE OLD TABLES if any !!!\"></form><hr>";
 echo "<hr>";
Ejemplo n.º 3
0
$phpinfo = ob_get_clean();
$test->addSection('Apache');
if (php_sapi_name() == 'apache2handler') {
    // Check Apache
    $requiredApacheModules = array('mod_env', 'mod_php', 'mod_expires', 'mod_deflate', 'mod_mime', 'mod_dir', 'mod_rewrite', 'mod_authz_host', 'mod_authz_user');
    $test->addResult('Apache', check_keepalive($phpinfo));
    foreach ($requiredApacheModules as $apacheModule) {
        $test->addResult('Apache', check_apachemodule($phpinfo, $apacheModule));
    }
} else {
    $message = new Magecheck_Test_ResultMessage("PHP is not running as an Apache module so it cannot detect which modules are enabled.");
    $test->addResult('Apache', $message);
}
// Check PHP
$test->addSection('PHP');
$test->addResult('PHP', check_phpversion());
check_phprequiredextensions($test);
$test->addSection('PHP Sessions');
$test->addResult('PHP Sessions', check_phpini('session.gc_probability', 1));
if (ini_get('session.gc_probability') == 0) {
    $message = new Magecheck_Test_ResultMessage("Beware if using Ubuntu and files for sessions that Magento stores sessions\n    in it's own directory. Without garbage collection enabled these files will never be cleaned up and can eventually\n    fill up the disk");
    $message->setAlertLevel('alert-error');
    $test->addResult('PHP Sessions', $message);
}
$test->addResult('PHP Sessions', check_phpini('session.gc_divisor', 100));
$test->addResult('PHP Sessions', check_phpini('session.gc_maxlifetime', 1440));
// Check APC
$test->addSection('PHP APC');
$test->addResult('PHP APC', check_phpapc());
if (check_phpextension('apc')) {
    $test->addResult('PHP APC', check_phpini('apc.shm_size', 256));