内核更新
This commit is contained in:
@@ -144,6 +144,7 @@ class Base extends \think\Controller{
|
|||||||
defined('IS_POST') or define('IS_POST', $this->request->isPost());
|
defined('IS_POST') or define('IS_POST', $this->request->isPost());
|
||||||
defined('IS_GET') or define('IS_GET', $this->request->isGet());
|
defined('IS_GET') or define('IS_GET', $this->request->isGet());
|
||||||
$this->url = $this->request->module() . '/' . $this->request->controller() . '/' . $this->request->action();
|
$this->url = $this->request->module() . '/' . $this->request->controller() . '/' . $this->request->action();
|
||||||
|
$this->assign('request',$this->request);
|
||||||
$this->assign('param',$this->param);
|
$this->assign('param',$this->param);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -81,6 +81,8 @@ return [
|
|||||||
'url_param_type' => 0,
|
'url_param_type' => 0,
|
||||||
// 是否开启路由
|
// 是否开启路由
|
||||||
'url_route_on' => true,
|
'url_route_on' => true,
|
||||||
|
// 路由配置文件(支持配置多个)
|
||||||
|
'route_config_file' => ['route'],
|
||||||
// 是否强制使用路由
|
// 是否强制使用路由
|
||||||
'url_route_must' => false,
|
'url_route_must' => false,
|
||||||
// 域名部署
|
// 域名部署
|
||||||
|
|||||||
@@ -483,13 +483,19 @@ class App
|
|||||||
if (is_array($rules)) {
|
if (is_array($rules)) {
|
||||||
Route::rules($rules);
|
Route::rules($rules);
|
||||||
}
|
}
|
||||||
} elseif (is_file(CONF_PATH . 'route' . CONF_EXT)) {
|
} else {
|
||||||
|
$files = $config['route_config_file'];
|
||||||
|
foreach ($files as $file) {
|
||||||
|
if (is_file(CONF_PATH . $file . CONF_EXT)) {
|
||||||
// 导入路由配置
|
// 导入路由配置
|
||||||
$rules = include CONF_PATH . 'route' . CONF_EXT;
|
$rules = include CONF_PATH . $file . CONF_EXT;
|
||||||
if (is_array($rules)) {
|
if (is_array($rules)) {
|
||||||
Route::import($rules);
|
Route::import($rules);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 路由检测(根据路由定义返回不同的URL调度)
|
// 路由检测(根据路由定义返回不同的URL调度)
|
||||||
$result = Route::check($request, $path, $depr, $config['url_domain_deploy']);
|
$result = Route::check($request, $path, $depr, $config['url_domain_deploy']);
|
||||||
$must = !is_null(self::$routeMust) ? self::$routeMust : $config['url_route_must'];
|
$must = !is_null(self::$routeMust) ? self::$routeMust : $config['url_route_must'];
|
||||||
|
|||||||
@@ -783,10 +783,9 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
|
|||||||
/**
|
/**
|
||||||
* 删除当前的记录
|
* 删除当前的记录
|
||||||
* @access public
|
* @access public
|
||||||
* @param bool $force 是否强制删除
|
|
||||||
* @return integer
|
* @return integer
|
||||||
*/
|
*/
|
||||||
public function delete($force = false)
|
public function delete()
|
||||||
{
|
{
|
||||||
if (false === $this->trigger('before_delete', $this)) {
|
if (false === $this->trigger('before_delete', $this)) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -107,8 +107,6 @@ abstract class Connection
|
|||||||
'sql_explain' => false,
|
'sql_explain' => false,
|
||||||
// Builder类
|
// Builder类
|
||||||
'builder' => '',
|
'builder' => '',
|
||||||
// 软删除字段
|
|
||||||
'soft_delete_field' => '',
|
|
||||||
];
|
];
|
||||||
|
|
||||||
// PDO连接参数
|
// PDO连接参数
|
||||||
|
|||||||
@@ -39,9 +39,7 @@ class Think
|
|||||||
if (empty($this->config['view_path'])) {
|
if (empty($this->config['view_path'])) {
|
||||||
$this->config['view_path'] = App::$modulePath . 'view' . DS;
|
$this->config['view_path'] = App::$modulePath . 'view' . DS;
|
||||||
}
|
}
|
||||||
if (App::$debug) {
|
|
||||||
$this->config['tpl_cache'] = false;
|
|
||||||
}
|
|
||||||
$this->template = new Template($this->config);
|
$this->template = new Template($this->config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user