default.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <?php
  2. # 集成项目的大部分配置,此为默认设置。环境不同,以下的配置也有可能不同,可以根据项目名建立配置文件
  3. # 数据库配置
  4. $config['database'] = array
  5. (
  6. # 默认数据库配置
  7. 'default' => array
  8. (
  9. 'type' => 'pdo',
  10. 'pdo_type' => 'mysql',//pgsql
  11. 'host' => array
  12. (
  13. 'read' => 'web-mysql:3306',
  14. 'update' => 'web-mysql:3306',
  15. //'read' => '192.168.1.203:3307',
  16. //'update' => '192.168.1.203:3307',
  17. ),
  18. 'database' => 'dever',
  19. 'username' => 'root',
  20. 'password' => '123456',
  21. 'charset' => 'utf8',
  22. ),
  23. );
  24. $local = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : 'localhost';
  25. # 本地可用这个
  26. $host = 'http://'.$local . '/';
  27. # 定义assets的域名
  28. $assets = DEVER_APP_HOST . 'assets/';
  29. $project_host = $host . '' . DEVER_PROJECT . '/';
  30. $package_host = $project_host . 'dever/package/';
  31. # 定义data域名
  32. $data_host = $project_host . 'data/';
  33. if (DEVER_APP_NAME == 'manage') {
  34. $assets = $package_host . 'manage/assets/';
  35. }
  36. # host 设置
  37. $config['host'] = array
  38. (
  39. # 跟域名
  40. 'base' => DEVER_APP_HOST,
  41. # cookie 域名
  42. 'cookie' => '',
  43. # assets网络路径,会自动将assets替换为assets/模板
  44. 'assets' => $assets,
  45. # 当前的assets路径
  46. 'css' => $assets . 'css/',
  47. 'js' => $assets . 'js/',
  48. 'img' => $assets . 'img/',
  49. 'images' => $assets . 'images/',
  50. 'lib' => $assets . 'lib/',
  51. # script组件路径
  52. 'script' => $package_host . 'script/assets/',
  53. # 上传系统的上传路径的域名(不带action)
  54. 'upload'=> $project_host . 'upload/?save',
  55. # 上传系统的资源访问地址
  56. 'uploadRes' => $data_host . 'upload/',
  57. );
  58. return $config;