setting.php 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. # sql优化,暂时无用
  27. 'opt' => true,
  28. //'default' => array($env['db'], $env['db1'], 'type' => 'Pdo'),//读写分离
  29. 'default' => $env['db'],
  30. 'log' => $env['log'],
  31. # 分区设置
  32. 'partition' => array
  33. (
  34. # 当前数据库是否支持自动建库,不支持改成false,则database不会自动建库,而是类似table按照表拆分
  35. 'create' => true,
  36. # 类型:database 按照库拆分(分库) table 按照表拆分(分表) field 按照字段拆分(分区) where 按照条件拆分(分条件) Dever::session('database', 1)可以设置值
  37. 'database' => 'date("Y")',
  38. 'table' => 'date("Ym")',
  39. # 字段类型分几种:range范围、list列表、hash哈希、key分区
  40. 'field' => array
  41. (
  42. 'type' => 'range',
  43. 'field' => 'cdate',
  44. 'value' => 'date("Y-m-d 23:60:60")'//date("Y-m-d 23:60:60", strtotime("-1 day"))'
  45. ),
  46. /*
  47. 'field' => array
  48. (
  49. 'type' => 'list',
  50. 'field' => 'type',
  51. 'value' => array('1', '2', '3'),//3个值3个分区,然后也可以用Dever::call("manage/admin.test")来返回数组
  52. ),
  53. 'field' => array
  54. (
  55. 'type' => 'hash',
  56. 'field' => 'id',
  57. 'value' => '5'//5个分区
  58. ),
  59. 'field' => array
  60. (
  61. 'type' => 'key',
  62. 'field' => 'id',
  63. 'value' => '5'
  64. ),*/
  65. # where类型,一般在表中设置array('id' => 1),
  66. //'where' => 'Dever::call("manage/admin.test")'
  67. ),
  68. ),
  69. # 定义模板
  70. 'template' => array
  71. (
  72. 'name' => 'pc',//模板配置,如果有手机版,直接配置:'pc,mobile'
  73. 'replace' => array
  74. (
  75. '../' => '{$host}',
  76. ),
  77. ),
  78. # 定义redis
  79. 'redis' => array('host' => 'server-redis', 'port' => '6379', 'password' => 'dm_redis_123', 'expire' => 2147483647),
  80. # 根据api增加缓存
  81. /*
  82. 'cache' => array
  83. (
  84. 'set/home.test' => 3000,
  85. ),*/
  86. );