通达OA V12版,引入thinkphp5.1框架
- 如下过程引入
- 如下问题,按上述问题解决
- htmlentities(): charset `cp936' not supported, assuming utf-8
- 内容绝对原创,希望对您有帮助。您的打赏,是让我持续更新的==牛奶和面包==
如下过程引入
- 在D:/MYOA/webroot目录下,通过composer安装thinkphp5.1框架。
- 在tp框架下,找到文件:thinkphp\library\think下的Error.php。
- 方案1:截断异常输出
代码如下
```php
var_dump($e->getMessage());
exit;
方案二:找到文件:thinkphp\tpl\think_exception.tpl,找到如下位置
代码如下
var_dump($message);
die();
- 修改application/controller/index/index.php
<?php
namespace app\index\controller;
use think\facade\Session;
use think\facade\Cache;class Index
{public function index(){echo '<pre>';$data=Session::get();var_dump($data);}public function hello($name = 'ThinkPHP5'){return 'hello,' . $name;}
}
# 配置session
找到文件:\config\session.php
```php
<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------// +----------------------------------------------------------------------
// | 会话设置
// +----------------------------------------------------------------------return ['id' => '',// SESSION_ID的提交变量,解决flash上传跨域'var_session_id' => '',// SESSION 前缀'prefix' => '','session_name'=>'PHPREDIS_SESSION:',// 驱动方式 支持redis memcache memcached'type' => 'redis',// 是否自动开启 SESSION'auto_start' => true,// 服务器地址'host' => '127.0.0.1', // 本地环境先开启redis服务端 redis-service.exe'port' => 6399,//'weight' => 100,'timeout'=>30,'password'=>'pPhKNahLz0Oe9S5','select'=>3
];