setting.php 3.2 KB

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