<?php
namespace application\admin\controller;
class index extends auth {
public function index() {
$this->display('index');
}
public function public_home() {
$this->assign('software_info', $this->software_information());
$this->assign('system_info', $this->system_information());
$this->display('public_home');
}
public function system_information() {
$systeminfo['WEB服务器'] = $_SERVER['SERVER_SOFTWARE'];
$systeminfo['PHP版本'] = PHP_VERSION;
$systeminfo['MySQL版本'] = db('')->version();
$systeminfo['TICKY程序版本'] = TICKY_VERSION;
$systeminfo['服务器操作系统'] = php_uname('s');
$systeminfo['REGISTER_GLOBALS'] = ini_get('register_globals') ? '<span style="color:red;">ON</span>' : 'OFF';
$systeminfo['MAGIC_QUOTES_GPC'] = MAGIC_QUOTES_GPC ? '<span style="color:red;">ON</span>' : 'OFF';
$systeminfo['最大上传限制'] = ini_get('file_uploads') ? ini_get('upload_max_filesize') : 'Disabled'; $systeminfo['最大执行时间'] = ini_get('max_execution_time') . '秒'; $systeminfo['服务器域名'] = $_SERVER['HTTP_HOST']; $systeminfo['服务器端口'] = $_SERVER['SERVER_PORT']; $systeminfo['脚本运行占用最大内存'] = get_cfg_var('memory_limit') ? get_cfg_var('memory_limit') : '---';
$html = '<table class="table table-condensed table-hover table-striped tablesorter table-fixed table-selectable">
<thead>
<tr>
<th colspan="2" scope="col">系统信息</th>
</tr>
</thead>
<tbody>';
foreach ($systeminfo as $x => $x_value) {
$html = $html . "<tr><td style='text-align: left;width: 300px;'>" . $x . "</td><td style='text-align: left;'>" . $x_value . "</td></tr>";
}
$html = $html . '</tbody></table>';
return $html;
}
public function software_information() {
$systeminfo['Ticky程序版本'] = TICKY_VERSION . ' [<a href="https://luomingui.cnblogs.com/" target="_blank">查看最新版本</a>]';
$systeminfo['授权类型'] = '<span id="yzmlicense">未授权(<a href="https://luomingui.cnblogs.com/" target="_blank" style="color:red">点击购买</a>)</span>';
if (!is_file(RUNTIME_PATH . 'install.lock')) {
$systeminfo['安全提示'] = '程序安装锁(/runtime/install.lock)未存在! <span class="c-red">可能会导致程序重装,请检查!</span>';
}
$systeminfo['系统开发'] = "罗敏贵";
$systeminfo['官方网站'] = "luomingui.cnblogs.com";
$html = '<table class="table table-condensed table-hover table-striped tablesorter table-fixed table-selectable">
<thead>
<tr>
<th colspan="2" scope="col">软件信息</th>
</tr>
</thead>
<tbody>';
foreach ($systeminfo as $x => $x_value) {
$html = $html . "<tr><td style='text-align: left;width: 300px;'>" . $x . "</td><td style='text-align: left;'>" . $x_value . "</td></tr>";
}
$html = $html . '</tbody></table>';
return $html;
}
}