|
@@ -1,20 +1,42 @@
|
|
|
<?php
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+$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' => 'web-mysql:3306',
|
|
|
- 'update' => 'web-mysql:3306',
|
|
|
+ 'read' => isset($dc['mysql']) ? $dc['mysql']['host'] : 'web-mysql:3306',
|
|
|
+ 'update' => isset($dc['mysql']) ? $dc['mysql']['host'] : 'web-mysql:3306',
|
|
|
),
|
|
|
'database' => 'wonderful',
|
|
|
- 'username' => 'root',
|
|
|
- 'password' => '123456',
|
|
|
+ 'username' => isset($dc['mysql']) ? $dc['mysql']['username'] : 'root',
|
|
|
+ 'password' => isset($dc['mysql']) ? $dc['mysql']['password'] : '123456',
|
|
|
'charset' => 'utf8',
|
|
|
),
|
|
|
);
|
|
@@ -24,7 +46,6 @@ $config['debug'] = array
|
|
|
'log' => array('type' => 'file'),
|
|
|
);
|
|
|
|
|
|
-$local = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : '192.168.33.10';
|
|
|
|
|
|
$host = 'http://'.$local . '/';
|
|
|
|
|
@@ -34,7 +55,7 @@ $uploadcdn = $host . 'upload/data/';
|
|
|
$config['host'] = array
|
|
|
(
|
|
|
'upload'=> $upload . 'upload/?save',
|
|
|
- 'uploadRes' => $uploadcdn . 'upload/',
|
|
|
+ 'uploadRes' => isset($dc['res']) && $dc['res'] ? $dc['res'] : $uploadcdn . 'upload/',
|
|
|
'project' => array
|
|
|
(
|
|
|
'upload' => array
|
|
@@ -51,4 +72,5 @@ $config['host'] = array
|
|
|
),
|
|
|
),
|
|
|
);
|
|
|
+
|
|
|
return $config;
|