Skip to content

Commit

Permalink
入口文件添加PHP版本检查
Browse files Browse the repository at this point in the history
  • Loading branch information
caiweiming committed Feb 11, 2017
1 parent 67198e0 commit 67643d0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
6 changes: 6 additions & 0 deletions admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
// | 作者: 蔡伟明 <[email protected]>
// +----------------------------------------------------------------------

// [ PHP版本检查 ]
header("Content-type: text/html; charset=utf-8");
if (version_compare(PHP_VERSION, '5.5', '<')) {
die('PHP版本过低,最少需要PHP5.5,请升级PHP版本!');
}

// [ 应用入口文件 ]

// 定义应用目录
Expand Down
2 changes: 1 addition & 1 deletion application/admin/controller/Attachment.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ private function saveFile($dir = '', $from = '', $module = '')
{
// 附件大小限制
$size_limit = $dir == 'images' ? config('upload_image_size') : config('upload_file_size');
$size_limit = $size_limit * 1024 * 1024;
$size_limit = $size_limit * 1024;
// 附件类型限制
$ext_limit = $dir == 'images' ? config('upload_image_ext') : config('upload_file_ext');
$ext_limit = $ext_limit != '' ? parse_attr($ext_limit) : '';
Expand Down
6 changes: 6 additions & 0 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
// | 作者: 蔡伟明 <[email protected]>
// +----------------------------------------------------------------------

// [ PHP版本检查 ]
header("Content-type: text/html; charset=utf-8");
if (version_compare(PHP_VERSION, '5.5', '<')) {
die('PHP版本过低,最少需要PHP5.5,请升级PHP版本!');
}

// [ 应用入口文件 ]

// 定义应用目录
Expand Down

0 comments on commit 67643d0

Please sign in to comment.