config.php 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <?php
  2. defined('BASEPATH') OR exit('No direct script access allowed');
  3. //因为报错会暴漏这里的路径 所以写成了这样的 如果有问题 会恢复的
  4. if(isset($_SERVER['HTTP_HOST'])){
  5. $config['base_url'] = 'http://'.$_SERVER['HTTP_HOST'].'/'; //CodeIgniter根URL
  6. }else{
  7. $config['base_url'] = '/'; //CodeIgniter根URL
  8. }
  9. $config['index_page'] = ''; //默认的索引文件 index.php
  10. $config['uri_protocol'] = 'REQUEST_URI'; //RUL链接 PATH_INFO
  11. $config['url_suffix'] = '.html'; //设置所有URL后缀
  12. $config['language'] = 'english';//使用的语言
  13. $config['charset'] = 'UTF-8';
  14. $config['enable_hooks'] = FALSE;//是否启用钩子功能
  15. $config['subclass_prefix'] = 'Lin_';//扩展类的前缀
  16. $config['composer_autoload'] = FALSE; //自动加载Composer
  17. $config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-\='; //允许的链接字符
  18. $config['allow_get_array'] = TRUE; //是否启用$_GET array
  19. /*
  20. |--------------------------------------------------------------------------
  21. |设置查询的字符串
  22. |--------------------------------------------------------------------------
  23. |
  24. */
  25. $config['enable_query_strings'] = FALSE;
  26. $config['controller_trigger'] = 'c';
  27. $config['function_trigger'] = 'm';
  28. $config['directory_trigger'] = 'd';
  29. /*
  30. |--------------------------------------------------------------------------
  31. | 错误记录
  32. |--------------------------------------------------------------------------
  33. | 0 = 禁用
  34. | 1 = 错误信息(包括PHP错误)
  35. | 2 = 调试消息
  36. | 3 = 信息消息
  37. | 4 = 所有的消息
  38. */
  39. $config['log_threshold'] = 1;
  40. $config['log_path'] = FCPATH.'data/log/'; //记录日志的路径
  41. $config['log_file_extension'] = '';//日志的扩展名,空为.php
  42. $config['log_file_permissions'] = 0644;//日志的权限
  43. $config['log_date_format'] = 'Y-m-d H:i:s';//日志日期名称格式
  44. $config['error_views_path'] = 'data/errors/'; //提示错误的路径
  45. $config['cache_path'] = ''; //缓存目录路径
  46. $config['cache_query_string'] = FALSE;//是否启用缓存
  47. $config['encryption_key'] = 'Kay89757SC';//设置加密密匙
  48. /*
  49. |--------------------------------------------------------------------------
  50. | Session
  51. |--------------------------------------------------------------------------
  52. */
  53. $config['sess_driver'] = 'files'; //使用于 files, database, redis, memcached
  54. $config['sess_cookie_name'] = 'star_session'; //名称
  55. $config['sess_expiration'] = 8640000; //时间
  56. $config['sess_save_path'] = FCPATH.'/tmp/'; //保存路径 只可绝对路径
  57. $config['sess_match_ip'] = FALSE; //是否匹配IP判断
  58. $config['sess_time_to_update'] = 8660000; //多久后生成新的ID
  59. $config['sess_regenerate_destroy'] = TRUE; //是否删除旧ID
  60. /*
  61. |--------------------------------------------------------------------------
  62. | Cookie
  63. |--------------------------------------------------------------------------
  64. */
  65. $config['cookie_prefix'] = '_STAR'; //设置Cookie前缀
  66. $config['cookie_domain'] = ''; //设置范围
  67. $config['cookie_path'] = '/';
  68. $config['cookie_secure'] = FALSE; //只在HTTPS里存在
  69. $config['cookie_httponly'] = FALSE;//只可以通过HTTP里存在
  70. $config['standardize_newlines'] = FALSE;//是否规范换行,不推荐使用
  71. $config['global_xss_filtering'] = FALSE; //XSS过滤,不推荐使用
  72. /*
  73. |--------------------------------------------------------------------------
  74. | 跨站请求伪造
  75. |--------------------------------------------------------------------------
  76. */
  77. $config['csrf_protection'] = FALSE; //是否开启
  78. $config['csrf_token_name'] = 'csrf_test_name'; //令牌名称
  79. $config['csrf_cookie_name'] = 'csrf_cookie_name'; //cookie名称
  80. $config['csrf_expire'] = 7200; //令牌过期时间
  81. $config['csrf_regenerate'] = TRUE; //每次重新生成令牌
  82. $config['csrf_exclude_uris'] = array();//忽略CSRF检查的URI数组
  83. $config['compress_output'] = FALSE;//启用输出Gzip压缩
  84. $config['time_reference'] = 'local';//时间时区
  85. $config['rewrite_short_tags'] = FALSE; //重写PHP短标签
  86. $config['proxy_ips'] = ''; //反向代理IP