setting.php 2.9 KB

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