No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Common.php 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | Yzncms [ 御宅男工作室 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2018 http://yzncms.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
  8. // +----------------------------------------------------------------------
  9. // | Author: 御宅男 <530765310@qq.com>
  10. // +----------------------------------------------------------------------
  11. // +----------------------------------------------------------------------
  12. // | 初始化配置
  13. // +----------------------------------------------------------------------
  14. namespace app\common\behavior;
  15. use think\facade\Config;
  16. use think\facade\Env;
  17. /**
  18. * 初始化配置信息行为
  19. * 将系统配置信息合并到本地配置
  20. * @package app\common\behavior
  21. */
  22. class Common
  23. {
  24. /**
  25. * 执行行为 run方法是Behavior唯一的接口
  26. * @access public
  27. * @param mixed $params 行为参数
  28. * @return void
  29. */
  30. public function run($params)
  31. {
  32. if (Config::get('app_debug')) {
  33. // 如果是开发模式那么将异常模板修改成官方的
  34. Config::set('exception_tmpl', Env::get('think_path') . 'tpl/think_exception.tpl');
  35. }
  36. }
  37. }