123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- <?php
- # 验证dc是否存在,一般在share目录下
- $dc = array();
- $dc_file = '/share/dc/config.php';
- if (is_file($dc_file)) {
- $dc = include($dc_file);
- }
- if (isset($dc['data'])) {
- $config['base']['data'] = $dc['data'];
- }
- $create = false;
- if (isset($dc['mysql']['create'])) {
- $create = $dc['mysql']['create'];
- }
- $ip = isset($dc['host']) ? $dc['host'] : '192.168.33.10';
- $local = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : $ip;
- # 数据库配置
- $config['database'] = array
- (
- 'create' => $create,
- # 默认数据库配置
- 'default' => array
- (
- 'type' => 'pdo',
- 'host' => array
- (
- 'read' => isset($dc['mysql']) ? $dc['mysql']['host'] : 'web-mysql:3306',
- 'update' => isset($dc['mysql']) ? $dc['mysql']['host'] : 'web-mysql:3306',
- ),
- 'database' => 'sharepic',
- 'username' => isset($dc['mysql']) ? $dc['mysql']['username'] : 'root',
- 'password' => isset($dc['mysql']) ? $dc['mysql']['password'] : '123456',
- 'charset' => 'utf8',
- ),
- );
- $config['debug'] = array
- (
- 'log' => array('type' => 'file'),
- );
- $host = 'http://'.$local . '/';
- $upload = $host . 'upload/';
- $uploadcdn = $host . 'upload/data/';
- $config['host'] = array
- (
- 'upload'=> $upload . 'upload/?save',
- 'uploadRes' => isset($dc['res']) && $dc['res'] ? $dc['res'] : $uploadcdn . 'upload/',
- 'project' => array
- (
- /*
- 'upload' => array
- (
- //'path' => $host. 'upload/upload/?',
- 'path' => '/share/lib/php/dever_package/upload/',
- 'setup' => '/www/upload/upload/',
- ),
- */
- ),
- );
- return $config;
|