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