From d9f0fe13e584285881a9fe59f32771e963722944 Mon Sep 17 00:00:00 2001 From: quericy Date: Sun, 19 Feb 2017 21:11:34 +0800 Subject: [PATCH 1/4] database config get from env; --- application/config/database.php | 53 +++++++++++---------------------- 1 file changed, 18 insertions(+), 35 deletions(-) diff --git a/application/config/database.php b/application/config/database.php index 60997c4..53d6bbe 100644 --- a/application/config/database.php +++ b/application/config/database.php @@ -1,4 +1,4 @@ - Date: Sun, 19 Feb 2017 21:19:03 +0800 Subject: [PATCH 2/4] add port in config; --- application/config/database.php | 1 + 1 file changed, 1 insertion(+) diff --git a/application/config/database.php b/application/config/database.php index 53d6bbe..da9c7ed 100644 --- a/application/config/database.php +++ b/application/config/database.php @@ -49,6 +49,7 @@ $active_group = 'default'; $active_record = TRUE; //数据库切换 $db['default']['hostname'] = getenv('DB_HOST') ?: 'localhost'; +$db['default']['port'] = getenv('DB_PORT') ?: '3306'; $db['default']['username'] = getenv('DB_USER') ?: 'root'; $db['default']['password'] = getenv('DB_PASS') ?: 'root'; $db['default']['database'] = getenv('DB_DATABASE') ?: 'teaching_interactive'; -- Gitee From 712a46c1fe3c07b9ce5bf28faa3a2114997d8cf2 Mon Sep 17 00:00:00 2001 From: quericy Date: Sun, 19 Feb 2017 21:26:13 +0800 Subject: [PATCH 3/4] fix preg function error in CI2 after PHP5.5; --- system/core/Security.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/system/core/Security.php b/system/core/Security.php index efa2df9..04beca5 100644 --- a/system/core/Security.php +++ b/system/core/Security.php @@ -508,9 +508,14 @@ class CI_Security { return $str; } - $str = html_entity_decode($str, ENT_COMPAT, $charset); - $str = preg_replace('~&#x(0*[0-9a-f]{2,5})~ei', 'chr(hexdec("\\1"))', $str); - return preg_replace('~&#([0-9]{2,4})~e', 'chr(\\1)', $str); + if(version_compare(PHP_VERSION,5.5,'>=')){ + $str = preg_replace_callback('~&#x(0*[0-9a-f]{2,5})~i', function(){return chr(hexdec('\\1'));}, $str, -1, $matches); + $str = preg_replace_callback('~&#([0-9]{2,4})~', function(){return chr('\\1');}, $str, -1, $matches1); + }else{ + $str = preg_replace('~&#x(0*[0-9a-f]{2,5})~ei', 'chr(hexdec("\\1"))', $str, -1, $matches); + $str = preg_replace('~&#([0-9]{2,4})~e', 'chr(\\1)', $str, -1, $matches1); + } + return $str; } // -------------------------------------------------------------------- -- Gitee From dbd54a9496c411e59696a032eb82ad6714c674fb Mon Sep 17 00:00:00 2001 From: quericy Date: Sun, 19 Feb 2017 21:33:49 +0800 Subject: [PATCH 4/4] UPDATE README --- README.md | 62 +++++++++++++++++++++++++++---------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index dd2a666..fc10563 100644 --- a/README.md +++ b/README.md @@ -1,31 +1,31 @@ -#Teaching interactive web platform -#教学互动平台 - -* 本系统的主要目标是实现网上互动教学功能,在总体上采用B/S架构(Browser/Server),教师通过浏览器在该平台发布课程资料和作业等信息,数据资料经处理后存储在云端,学生注册后可提交作业,在线浏览教师发布的资料,以及在线交流学习心得,和教师答疑互动。 -* 本系统的主要特色是针对移动设备的响应式布局,使得该平台不再局限在PC上,教师和学生使用随身携带的平板或手机登录网站,都可以获得较好的用户体验。因而大大提高了教学平台的便携能力,进一步提升该平台的互动的及时性。 -* 本项目为本人的个人毕设项目: - -> * 本项目采用 [GNU GPL v3](http://opensource.org/licenses/GPL-3.0)许可证授权,欢迎大家在这个基础上进行改进并分享。 -> * GNU GPL v3许可证:[https://www.gnu.org/licenses/gpl-3.0.txt](https://www.gnu.org/licenses/gpl-3.0.txt) - ---- -### 本项目演示地址: -* [GitChina演示平台](http://teachtest.oschina.mopaas.com/) - ---- -### 本项目源码: - -* [GitHub](https://github.com/quericy/Teaching-interactive-web-platform) -* [GitChina](https://git.oschina.net/quericy/Teaching-interactive-web-platform) - ---- -###数据库说明: - -* 数据库位于项目的application/config/目录下,请导入teaching_interactive.sql到mysql数据库中,并配置database.php对应的数据库信息 -* 后台教师登录初始用户名密码均为admin - ---- -欢迎交流与探讨: - -* Blog: [quericy.me](http://quericy.me) -* GitHub: [https://github.com/quericy](https://github.com/quericy) +#Teaching interactive web platform +#教学互动平台 + +* 本系统的主要目标是实现网上互动教学功能,在总体上采用B/S架构(Browser/Server),教师通过浏览器在该平台发布课程资料和作业等信息,数据资料经处理后存储在云端,学生注册后可提交作业,在线浏览教师发布的资料,以及在线交流学习心得,和教师答疑互动。 +* 本系统的主要特色是针对移动设备的响应式布局,使得该平台不再局限在PC上,教师和学生使用随身携带的平板或手机登录网站,都可以获得较好的用户体验。因而大大提高了教学平台的便携能力,进一步提升该平台的互动的及时性。 +* 本项目为本人的个人毕设项目: + +> * 本项目采用 [GNU GPL v3](http://opensource.org/licenses/GPL-3.0)许可证授权,欢迎大家在这个基础上进行改进并分享。 +> * GNU GPL v3许可证:[https://www.gnu.org/licenses/gpl-3.0.txt](https://www.gnu.org/licenses/gpl-3.0.txt) + +--- +### 本项目演示地址: +* [GitChina演示平台](http://teachtest.butterfly.mopaasapp.com/) + +--- +### 本项目源码: + +* [GitHub](https://github.com/quericy/Teaching-interactive-web-platform) +* [GitChina](https://git.oschina.net/quericy/Teaching-interactive-web-platform) + +--- +###数据库说明: + +* 数据库位于项目的application/config/目录下,请导入teaching_interactive.sql到mysql数据库中,并配置database.php对应的数据库信息 +* 后台教师登录初始用户名密码均为admin + +--- +欢迎交流与探讨: + +* Blog: [quericy.me](https://quericy.me) +* GitHub: [https://github.com/quericy](https://github.com/quericy) -- Gitee