示例#1
0
 * @license For full copyright and license information view LICENSE file distributed with this source code.
 * @version 2014.07.0
 * @package kernel
 */
$module = $Params['Module'];
$mode = $Params['Mode'];
if ($mode and $mode === 'php') {
    phpinfo();
    eZExecution::cleanExit();
}
$http = eZHTTPTool::instance();
$ini = eZINI::instance();
$tpl = eZTemplate::factory();
$db = eZDB::instance();
try {
    $info = ezcSystemInfo::getInstance();
} catch (ezcSystemInfoReaderCantScanOSException $e) {
    $info = null;
    eZDebug::writeNotice("Could not read system information, returned: '" . $e->getMessage() . "'", 'system/info');
}
if ($info instanceof ezcSystemInfo) {
    // Workaround until ezcTemplate is used, as properties can not be accessed directly in ezp templates.
    $systemInfo = array('cpu_type' => $info->cpuType, 'cpu_speed' => $info->cpuSpeed, 'cpu_count' => $info->cpuCount, 'memory_size' => $info->memorySize);
    if ($info->phpAccelerator !== null) {
        $phpAcceleratorInfo = array('name' => $info->phpAccelerator->name, 'url' => $info->phpAccelerator->url, 'enabled' => $info->phpAccelerator->isEnabled, 'version_integer' => $info->phpAccelerator->versionInt, 'version_string' => $info->phpAccelerator->versionString);
    } else {
        $phpAcceleratorInfo = array();
    }
} else {
    $systemInfo = array('cpu_type' => '', 'cpu_speed' => '', 'cpu_count' => '', 'memory_size' => '');
    $phpAcceleratorInfo = array();
示例#2
0
 public function testGetInvalidProperty()
 {
     $info = ezcSystemInfo::getInstance();
     try {
         $info->no_such_property;
         $this->fail('Expected exception was not thrown');
     } catch (ezcBasePropertyNotFoundException $e) {
         $expected = "No such property name 'no_such_property'.";
         $this->assertEquals($expected, $e->getMessage());
     }
 }