初始化项目

This commit is contained in:
2016-06-21 17:12:08 +08:00
commit 7ea154d684
903 changed files with 226100 additions and 0 deletions

View File

@@ -0,0 +1,77 @@
<?php
// +----------------------------------------------------------------------
// | OneThink [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013 http://www.onethink.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: yangweijie <yangweijiester@gmail.com> <code-tech.diandian.com>
// +----------------------------------------------------------------------
namespace addons\systeminfo;
use app\common\controller\Addons;
/**
* 系统环境信息插件
* @author thinkphp
*/
class Systeminfo extends Addons{
public $info = array(
'name'=>'Systeminfo',
'title'=>'系统环境信息',
'description'=>'用于显示一些服务器的信息',
'status'=>1,
'author'=>'molong',
'version'=>'0.1'
);
public function install(){
return true;
}
public function uninstall(){
return true;
}
//实现的AdminIndex钩子方法
public function AdminIndex($param){
$config = $this->getConfig();
if(false){//extension_loaded('curl')
$url = 'http://www.tensent.cn/index.php?m=home&c=version&a=check_version';
$params = array(
'version' => ONETHINK_VERSION,
'domain' => $_SERVER['HTTP_HOST'],
'auth' => sha1(config('DATA_AUTH_KEY')),
);
$vars = http_build_query($params);
$opts = array(
CURLOPT_TIMEOUT => 5,
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_URL => $url,
CURLOPT_POST => 1,
CURLOPT_POSTFIELDS => $vars,
CURLOPT_USERAGENT => $_SERVER['HTTP_USER_AGENT'],
);
/* 初始化并执行curl请求 */
$ch = curl_init();
curl_setopt_array($ch, $opts);
$data = curl_exec($ch);
$error = curl_error($ch);
curl_close($ch);
}
if(!empty($data) && strlen($data)<400 ){
$config['new_version'] = $data;
}
$this->assign('addons_config', $config);
if($config['display']){
$this->template('widget');
}
}
}

View File

@@ -0,0 +1,35 @@
<?php
// +----------------------------------------------------------------------
// | OneThink [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013 http://www.onethink.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: yangweijie <yangweijiester@gmail.com> <code-tech.diandian.com>
// +----------------------------------------------------------------------
return array(
'title'=>array(//配置在表单中的键名 ,这个会是config[title]
'title'=>'显示标题:',//表单的文字
'type'=>'text', //表单的类型text、textarea、checkbox、radio、select等
'value'=>'系统信息', //表单的默认值
),
'width'=>array(
'title'=>'显示宽度:',
'type'=>'select',
'options'=>array(
'3'=>'3格',
'4'=>'4格',
'6'=>'6格'
),
'value'=>'6'
),
'display'=>array(
'title'=>'是否显示:',
'type'=>'radio',
'options'=>array(
'1'=>'显示',
'0'=>'不显示'
),
'value'=>'1'
)
);

View File

@@ -0,0 +1,38 @@
<div class="col-lg-{$addons_config.width}">
<div class="main-box clearfix">
<header class="main-box-header clearfix">
<h2>{$addons_config.title}</h2>
</header>
<div class="main-box-body clearfix">
<table class="table">
<tr>
<th>核心版本</th>
<td>SentCMS v{$Think.SENTCMS_VERSION}</td>
</tr>
<tr>
<th>服务器操作系统</th>
<td>{$Think.const.PHP_OS}</td>
</tr>
<tr>
<th>运行环境</th>
<td>{$_SERVER['SERVER_SOFTWARE']}</td>
</tr>
<tr>
<th>MYSQL版本</th>
{php}$system_info_mysql = \think\Db::query("select version() as v;");{/php}
<td>{$system_info_mysql.0.v}</td>
</tr>
<tr>
<th>上传限制</th>
<td>{:ini_get('upload_max_filesize')}</td>
</tr>
<tr>
<th>系统版权所有</th>
<td>
<a href="http://www.tensent.cn/" target="_blank">南昌腾速科技有限公司</a>
</td>
</tr>
</table>
</div>
</div>
</div>