Example #1
0
 public function main()
 {
     //获取系统信息
     $array = array();
     $serverinfo = PHP_OS . ' / PHP v' . PHP_VERSION;
     $serverinfo .= @ini_get('safe_mode') ? ' Safe Mode' : NULL;
     $fileupload = @ini_get('file_uploads') ? ini_get('upload_max_filesize') : '<font color="red">不支持上传</font>';
     $dbsize = $dbsize ? RealSize($dbsize) : '未知大小';
     $magic_quote_gpc = get_magic_quotes_gpc() ? 'On' : 'Off';
     $array['serverinfo'] = $serverinfo;
     $array['fileupload'] = $fileupload;
     $array['magic_quote_gpc'] = $magic_quote_gpc;
     $this->assign($array);
     $this->display("Public:main");
 }
 public function main()
 {
     $Article = D('Article');
     $Member = D('Member');
     $Job = D('Job');
     $Feedback = D('Feedback');
     $ArticleC = $Article->count();
     $MemberC = $Member->count();
     $JobC = $Job->count();
     $FeedbackC = $Feedback->count();
     $this->assign(array('ArticleC' => $ArticleC, 'MemberC' => $MemberC, 'JobC' => $JobC, 'FeedbackC' => $FeedbackC));
     //获取系统信息
     $config = new model();
     $array = array();
     $serverinfo = PHP_OS . ' / PHP v' . PHP_VERSION;
     $serverinfo .= @ini_get('safe_mode') ? ' Safe Mode' : NULL;
     $dbversion = $config->query("SELECT VERSION()");
     $fileupload = @ini_get('file_uploads') ? ini_get('upload_max_filesize') : '<font color="red">不支持上传</font>';
     $dbsize = 0;
     $tablepre = C('DB_PREFIX');
     $query = $tables = $config->query("SHOW TABLE STATUS LIKE '{$tablepre}%'");
     //dump($query);
     foreach ($tables as $table) {
         $dbsize += $table['Data_length'] + $table['Index_length'];
     }
     $dbsize = $dbsize ? RealSize($dbsize) : '未知大小';
     $dbversion = $config->query("SELECT VERSION()");
     $magic_quote_gpc = get_magic_quotes_gpc() ? 'On' : 'Off';
     $array['serverinfo'] = $serverinfo;
     $array['dbversion'] = $dbversion;
     $array['fileupload'] = $fileupload;
     $array['dbsize'] = $dbsize;
     $array['dbversion'] = $dbversion[0]['VERSION()'];
     $array['magic_quote_gpc'] = $magic_quote_gpc;
     $this->assign($array);
     $this->display("Public:main");
 }