setting.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <?php
  2. return array
  3. (
  4. # 项目通信token
  5. 'token' => DEVER_PROJECT,
  6. # 语言包 暂时无用
  7. 'lang' => 'zh-cn',
  8. 'lang_pack' => array('zh-cn' => '简体中文', 'en' => '英文'),
  9. # 路由解析设置
  10. 'route' => false,
  11. /*
  12. 'route' => array
  13. (
  14. 'test' => 'home',
  15. 'v(.*?)_(.*?)' => 'src/home.test?type=$1&id=$2',
  16. ),*/
  17. # 日志设置
  18. 'log' => array('type' => 'file', 'host' => 'host', 'port' => 'port'),
  19. # 调试的shell名
  20. 'shell' => 'debug',
  21. # 定义session
  22. //'session' => array('host' => '', 'port' => '', 'path' => '', 'cookie' => ''),
  23. # 定义数据库
  24. 'database' => array
  25. (
  26. # 是否自动建表 默认为true
  27. 'create' => true,
  28. # sql优化,暂时无用
  29. 'opt' => true,
  30. //'default' => array($env['db'], $env['db1'], 'type' => 'Pdo'),//读写分离
  31. 'default' => $env['db'],
  32. 'log' => $env['log'],
  33. # 分区设置
  34. 'partition' => array
  35. (
  36. # 当前数据库是否支持自动建库,不支持改成false,则database不会自动建库,而是类似table按照表拆分
  37. 'create' => true,
  38. # 类型:database 按照库拆分(分库) table 按照表拆分(分表) field 按照字段拆分(分区) where 按照条件拆分(分条件) Dever::session('database', 1)可以设置值
  39. 'database' => 'date("Y")',
  40. 'table' => 'date("Ym")',
  41. # 字段类型分几种:range范围、list列表、hash哈希、key分区
  42. 'field' => array
  43. (
  44. 'type' => 'range',
  45. 'field' => 'cdate',
  46. 'value' => 'date("Y-m-d 23:60:60")'//date("Y-m-d 23:60:60", strtotime("-1 day"))'
  47. ),
  48. /*
  49. 'field' => array
  50. (
  51. 'type' => 'list',
  52. 'field' => 'type',
  53. 'value' => array('1', '2', '3'),//3个值3个分区,然后也可以用Dever::call("manage/admin.test")来返回数组
  54. ),
  55. 'field' => array
  56. (
  57. 'type' => 'hash',
  58. 'field' => 'id',
  59. 'value' => '5'//5个分区
  60. ),
  61. 'field' => array
  62. (
  63. 'type' => 'key',
  64. 'field' => 'id',
  65. 'value' => '5'
  66. ),*/
  67. # where类型,一般在表中设置array('id' => 1),
  68. //'where' => 'Dever::call("manage/admin.test")'
  69. ),
  70. ),
  71. # 定义模板
  72. 'template' => array
  73. (
  74. 'name' => 'pc',//模板配置,如果有手机版,直接配置:'pc,mobile'
  75. 'replace' => array
  76. (
  77. '../' => '{$host}',
  78. ),
  79. ),
  80. # 定义redis
  81. 'redis' => array('host' => 'server-redis', 'port' => '6379', 'password' => 'dm_redis_123', 'expire' => 2147483647),
  82. # 根据api增加缓存
  83. /*
  84. 'cache' => array
  85. (
  86. 'set/home.test' => 3000,
  87. ),*/
  88. );