Skip to content

Commit

Permalink
更新
Browse files Browse the repository at this point in the history
  • Loading branch information
RunsTp committed Apr 20, 2018
1 parent dfd5e8b commit da9a475
Show file tree
Hide file tree
Showing 158 changed files with 5,616 additions and 5,502 deletions.
40 changes: 31 additions & 9 deletions application/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
// $Id$

return [
'app_debug' => true,
//加密串
'salt' => 'HvIwIZFovS7oO5CAFVX52omS6Yj5NW9e',
//备份数据地址
'back_path' => APP_PATH .'../back/',

// 默认模块名
'default_module' => 'live',
// 默认控制器名
Expand All @@ -28,9 +34,6 @@
'log' => [
'type' => 'test',
],

'app_debug' => true,

// +----------------------------------------------------------------------
// | 缓存设置
// +----------------------------------------------------------------------
Expand All @@ -44,11 +47,30 @@
// 缓存有效期 0表示永久缓存
'expire' => 0,
],
// +----------------------------------------------------------------------
// | 模板设置
// +----------------------------------------------------------------------

//加密串
'salt' => 'HvIwIZFovS7oO5CAFVX52omS6Yj5NW9e',

//备份数据地址
'back_path' => APP_PATH .'../back/'

'template' => [
// 默认模板渲染规则 1 解析为小写+下划线 2 全部转换小写
'auto_rule' => 2,
// 模板引擎类型 支持 php think 支持扩展
'type' => 'Think',
// 视图基础目录,配置目录为所有模块的视图起始目录
'view_base' => '',
// 当前模板的视图目录 留空为自动获取
'view_path' => '',
// 模板后缀
'view_suffix' => 'html',
// 模板文件名分隔符
'view_depr' => DS,
// 模板引擎普通标签开始标记
'tpl_begin' => '{',
// 模板引擎普通标签结束标记
'tpl_end' => '}',
// 标签库标签开始标记
'taglib_begin' => '{',
// 标签库标签结束标记
'taglib_end' => '}',
],
];
70 changes: 60 additions & 10 deletions composer.lock
100755 → 100644

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions thinkphp/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

ThinkPHP 目前使用 Git 来控制程序版本,如果你想为 ThinkPHP 贡献源代码,请先大致了解 Git 的使用方法。我们目前把项目托管在 GitHub 上,任何 GitHub 用户都可以向我们贡献代码。

参与的方式很简单,`fork`一份 ThinkPHP 的代码到你的仓库中,修改后提交,并向我们发起`pull request`申请,我们会及时对代码进行审查并处理你的申请。审查通过后,你的代码将被`merge`进我们的仓库中,这样你就会自动出现在贡献者名单里了,非常方便。
参与的方式很简单,`fork`一份 ThinkPHP 的代码到你的仓库中,修改后提交,并向我们发起`pull request`申请,我们会及时对代码进行审查并处理你的申请并。审查通过后,你的代码将被`merge`进我们的仓库中,这样你就会自动出现在贡献者名单里了,非常方便。

我们希望你贡献的代码符合:

Expand Down Expand Up @@ -60,7 +60,7 @@ GitHub 提供了 Issue 功能,该功能可以用于:
6. 变基(衍合 `rebase`)你的分支到上游 master 分支;
7. `push` 你的本地仓库到 GitHub;
8. 提交 `pull request`
9. 等待 CI 验证(若不通过则重复 5~7,不需要重新提交 `pull request`GitHub 会自动更新你的 `pull request`);
9. 等待 CI 验证(若不通过则重复 5~7,GitHub 会自动更新你的 `pull request`);
10. 等待管理员处理,并及时 `rebase` 你的分支到上游 master 分支(若上游 master 分支有修改)。

*若有必要,可以 `git push -f` 强行推送 rebase 后的分支到自己的 `fork`*
Expand Down
2 changes: 1 addition & 1 deletion thinkphp/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

ThinkPHP遵循Apache2开源协议发布,并提供免费使用。
版权所有Copyright © 2006-2017 by ThinkPHP (http://thinkphp.cn)
版权所有Copyright © 2006-2016 by ThinkPHP (http://thinkphp.cn)
All rights reserved。
ThinkPHP® 商标和著作权所有者为上海顶想信息科技有限公司。

Expand Down
4 changes: 2 additions & 2 deletions thinkphp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ www WEB部署目录(或者子目录)
## 命名规范

ThinkPHP5的命名规范遵循`PSR-2`规范以及`PSR-4`自动加载规范
ThinkPHP5的命名规范遵循PSR-2规范以及PSR-4自动加载规范

## 参与开发
注册并登录 Github 帐号, fork 本项目并进行改动。
Expand All @@ -105,7 +105,7 @@ ThinkPHP遵循Apache2开源协议发布,并提供免费使用。

本项目包含的第三方源码和二进制文件之版权信息另行标注。

版权所有Copyright © 2006-2018 by ThinkPHP (http://thinkphp.cn)
版权所有Copyright © 2006-2016 by ThinkPHP (http://thinkphp.cn)

All rights reserved。

Expand Down
6 changes: 2 additions & 4 deletions thinkphp/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <[email protected]>
// +----------------------------------------------------------------------

define('THINK_VERSION', '5.0.16');
define('THINK_VERSION', '5.0.7');
define('THINK_START_TIME', microtime(true));
define('THINK_START_MEM', memory_get_usage());
define('EXT', '.php');
Expand Down Expand Up @@ -40,10 +40,8 @@
// 加载环境变量配置文件
if (is_file(ROOT_PATH . '.env')) {
$env = parse_ini_file(ROOT_PATH . '.env', true);

foreach ($env as $key => $val) {
$name = ENV_PREFIX . strtoupper($key);

if (is_array($val)) {
foreach ($val as $k => $v) {
$item = $name . '_' . strtoupper($k);
Expand Down
20 changes: 4 additions & 16 deletions thinkphp/convention.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
// +----------------------------------------------------------------------
// | 应用设置
// +----------------------------------------------------------------------
// 默认Host地址
'app_host' => '',

// 应用命名空间
'app_namespace' => 'app',
// 应用调试模式
'app_debug' => false,
'app_debug' => true,
// 应用Trace
'app_trace' => false,
// 应用模式状态
Expand Down Expand Up @@ -74,8 +75,6 @@
'pathinfo_fetch' => ['ORIG_PATH_INFO', 'REDIRECT_PATH_INFO', 'REDIRECT_URL'],
// pathinfo分隔符
'pathinfo_depr' => '/',
// HTTPS代理标识
'https_agent_name' => '',
// URL伪静态后缀
'url_html_suffix' => 'html',
// URL普通方式参数 用于自动生成
Expand Down Expand Up @@ -116,8 +115,6 @@
// +----------------------------------------------------------------------

'template' => [
// 默认模板渲染规则 1 解析为小写+下划线 2 全部转换小写
'auto_rule' => 1,
// 模板引擎类型 支持 php think 支持扩展
'type' => 'Think',
// 视图基础目录,配置目录为所有模块的视图起始目录
Expand Down Expand Up @@ -157,8 +154,6 @@
'show_error_msg' => false,
// 异常处理handle类 留空使用 \think\exception\Handle
'exception_handle' => '',
// 是否记录trace信息到日志
'record_trace' => false,

// +----------------------------------------------------------------------
// | 日志设置
Expand Down Expand Up @@ -288,11 +283,4 @@
'list_rows' => 15,
],

//控制台配置
'console' => [
'name' => 'Think Console',
'version' => '0.1',
'user' => null,
],

];
23 changes: 10 additions & 13 deletions thinkphp/helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
Expand Down Expand Up @@ -127,7 +127,7 @@ function input($key = '', $default = null, $filter = '')
if ($pos = strpos($key, '.')) {
// 指定参数来源
list($method, $key) = explode('.', $key, 2);
if (!in_array($method, ['get', 'post', 'put', 'patch', 'delete', 'route', 'param', 'request', 'session', 'cookie', 'server', 'env', 'path', 'file'])) {
if (!in_array($method, ['get', 'post', 'put', 'patch', 'delete', 'param', 'request', 'session', 'cookie', 'server', 'env', 'path', 'file'])) {
$key = $method . '.' . $key;
$method = 'param';
}
Expand Down Expand Up @@ -192,7 +192,7 @@ function validate($name = '', $layer = 'validate', $appendSuffix = false)
* @param bool $force 是否强制重新连接
* @return \think\db\Query
*/
function db($name = '', $config = [], $force = false)
function db($name = '', $config = [], $force = true)
{
return Db::connect($config, $force)->name($name);
}
Expand Down Expand Up @@ -354,25 +354,22 @@ function cache($name, $value = '', $options = null, $tag = null)
{
if (is_array($options)) {
// 缓存操作的同时初始化
$cache = Cache::connect($options);
Cache::connect($options);
} elseif (is_array($name)) {
// 缓存初始化
return Cache::connect($name);
} else {
$cache = Cache::init();
}

if (is_null($name)) {
return $cache->clear($value);
return Cache::clear($value);
} elseif ('' === $value) {
// 获取缓存
return 0 === strpos($name, '?') ? $cache->has(substr($name, 1)) : $cache->get($name);
return 0 === strpos($name, '?') ? Cache::has(substr($name, 1)) : Cache::get($name);
} elseif (is_null($value)) {
// 删除缓存
return $cache->rm($name);
return Cache::rm($name);
} elseif (0 === strpos($name, '?') && '' !== $value) {
$expire = is_numeric($options) ? $options : null;
return $cache->remember(substr($name, 1), $value, $expire);
return Cache::remember(substr($name, 1), $value, $expire);
} else {
// 缓存数据
if (is_array($options)) {
Expand All @@ -381,9 +378,9 @@ function cache($name, $value = '', $options = null, $tag = null)
$expire = is_numeric($options) ? $options : null; //默认快捷缓存设置过期时间
}
if (is_null($tag)) {
return $cache->set($name, $value, $expire);
return Cache::set($name, $value, $expire);
} else {
return $cache->tag($tag)->set($name, $value, $expire);
return Cache::tag($tag)->set($name, $value, $expire);
}
}
}
Expand Down
Loading

0 comments on commit da9a475

Please sign in to comment.