<?php
// +----------------------------------------------------------------------
// | 奇乐自媒体内容管理系统 免费版 2019
// +----------------------------------------------------------------------
// | 官方网址：http://www.qilecms.com
// +----------------------------------------------------------------------
// | 官方论坛：http://bbs.qilecms.com
// +----------------------------------------------------------------------
// | Author:奇乐网络
// +----------------------------------------------------------------------
// | 版权说明：本产品为免费版，使用请保留底部版权
// +----------------------------------------------------------------------
namespace app\admin\controller;
use think\Db;
use think\Controller;
use think\facade\App;
class Index extends Base
{
    public function index()
    {

      return $this->fetch();
    }

    public function main()
    {  

      $sysinfo = [
            'thinkphp_version'=>App::version(),
            'os' => $this->request->server("SERVER_SOFTWARE"), //获取服务器标识的字串
            'php_version' => PHP_VERSION, //获取PHP服务器版本
            'time' => date("Y-m-d H:i:s", time()), //获取服务器时间
            'pc' => $this->request->server("'SERVER_NAME"), //当前主机名
            'osname' => php_uname(), //获取系统类型及版本号
            'language' => $this->request->server("'HTTP_ACCEPT_LANGUAGE"), //获取服务器语言
            'port' => $this->request->server("'SERVER_PORT"), //获取服务器Web端口
            'max_upload' => ini_get("file_uploads") ? ini_get("upload_max_filesize") : "Disabled", //最大上传
            'max_ex_time' => ini_get("max_execution_time")."秒", //脚本最大执行时间
            'mysql_version' => $this->mysql_version(),
            
        ];
      $this->assign('sysinfo',$sysinfo);
      return $this->fetch();
    }
    public function mysql_version(){
       $res = Db::query("SELECT VERSION() as mysql_version");

       return $res[0]['mysql_version'];
    }

}
