示例#1
0
 protected static function initialize($force = false)
 {
     if (self::$initialized && !$force) {
         return;
     }
     $ini = eZINI::instance('sysinfo.ini');
     foreach ($ini->variable('ModuleSettings', 'GroupsList') as $groupName => $class) {
         /// @todo check that interface is implemented
         self::$view_groups[$groupName] = call_user_func(array($class, 'groupList'));
     }
     self::$initialized = true;
 }
 /**
  */
 public function modify($tpl, $operatorName, $operatorParameters, $rootNamespace, $currentNamespace, &$operatorValue, $namedParameters)
 {
     switch ($operatorName) {
         case 'installedphpcache':
             if (isset($GLOBALS['_PHPA'])) {
                 $operatorValue = 'phpaccelerator';
             } else {
                 if (extension_loaded("Turck MMCache")) {
                     $operatorValue = 'mmcache';
                 } else {
                     if (extension_loaded("eAccelerator")) {
                         $operatorValue = 'eaccelerator';
                     } else {
                         if (extension_loaded("apc")) {
                             $operatorValue = 'apc';
                         } else {
                             if (extension_loaded("Zend Performance Suite")) {
                                 $operatorValue = 'performancesuite';
                             } else {
                                 if (extension_loaded("xcache")) {
                                     $operatorValue = 'xcache';
                                 } else {
                                     if (extension_loaded("wincache")) {
                                         $operatorValue = 'wincache';
                                     } else {
                                         $operatorValue = '';
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
             break;
         case 'sysinfomoduleviews':
             $operatorValue = ezSysinfoModule::groupList();
             break;
     }
 }
示例#3
0
        eZDebug::writeWarning("Sysinfo view uses an unsupported response type: {$response_type}");
}
// fetch template to render results
$Result = array();
$Result['content'] = $tpl->fetch("design:sysinfo/{$view}.tpl");
// for requests which 'come from cluster', remove pagelayout, as they will be shown inside an iframe
if ($isClusterSlaveRequest) {
    /// @todo rewrite links
    // remove pagelayout
    $Result['pagelayout'] = 'design:clusterview_pagelayout.tpl';
    // shall we remove debug info as well?
} else {
    // build nav menu & left-hand menu
    $Result['left_menu'] = 'design:parts/sysinfo/menu.tpl';
    $url1stlevel = array(array('url' => 'sysinfo/index', 'text' => sysInfoTools::ezpI18ntr('SysInfo', 'System information')));
    if ($view == 'index') {
        $url1stlevel[0]['url'] = false;
        $url2ndlevel = array();
    } else {
        $url2ndlevel = array(array('url' => false, 'text' => sysInfoTools::ezpI18ntr('SysInfo', ezSysinfoModule::viewName($view))));
    }
    if ($extra_path != '') {
        if (ezSysinfoModule::viewActive($view)) {
            $url2ndlevel[0]['url'] = "sysinfo/{$view}";
        }
        $url3rdlevel = array(array('url' => false, 'text' => $extra_path));
    } else {
        $url3rdlevel = array();
    }
    $Result['path'] = array_merge($url1stlevel, $url2ndlevel, $url3rdlevel);
}
示例#4
0
                $mdate = gmdate('D, d M Y H:i:s', filemtime($logfile)) . ' GMT';
                eZExecution::cleanExit();
            }
            // *** parse rotated log files, if found ***
            for ($i = eZdebug::maxLogrotateFiles(); $i > 0; $i--) {
                $archivelog = $logfile . ".{$i}";
                if (file_exists($archivelog)) {
                    $data = array_merge($data, ezLogsGrapher::splitLog($archivelog));
                    //var_dump( $archivelog );
                }
            }
            // *** Parse log file ***
            $data = array_reverse(array_merge($data, ezLogsGrapher::splitLog($logfile)));
            $mdate = gmdate('D, d M Y H:i:s', filemtime($logfile)) . ' GMT';
            header("Last-Modified: {$mdate}");
        }
        break;
    }
}
if ($Params['viewmode'] == 'raw') {
    // if we're here it's because desired file was not found
    // @todo return a 404 error?
    //       It can be either a valid filename but no log yet, or bad filename...
}
// *** output ***
$tpl->setVariable('log', $data);
$tpl->setVariable('logfile', $Params['logfile']);
$tpl->setVariable('errormsg', $errormsg);
$tpl->setVariable('title', ezSysinfoModule::viewTitle('logview') . ': ' . $Params['logfile']);
// washed in tpl for safety
$extra_path = $logname;
示例#5
0
<?php

$tpl->setVariable('groups', ezSysinfoModule::groupList());
示例#6
0
<?php

// an improved setup/info module
$Module = array('name' => 'System Information', 'variable_params' => false);
$ViewList = ezSysinfoModule::viewList();
$FunctionList = array();