$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', 'create' => isset($dc['mysql']) ? $dc['mysql']['host_create'] : 'web-mysql:3306', ), 'database' => 'wonderful', 'username' => isset($dc['mysql']) ? $dc['mysql']['username'] : 'root', 'password' => isset($dc['mysql']) ? $dc['mysql']['password'] : '123456', 'charset' => 'utf8mb4', ), 'session' => array ( 'type' => 'redis', 'host' => isset($dc['redis']) ? $dc['redis'][0]['host'] : 'server-redis', 'port' => isset($dc['redis']) ? $dc['redis'][0]['port'] : '6379', 'password' => isset($dc['redis']) ? $dc['redis'][0]['password'] : 'dm_redis_123', ), 'session1' => array ( 'type' => 'memcache', 'host' => isset($dc['memcache']) ? $dc['memcache'][0]['host'] : 'server-memcached', 'port' => isset($dc['memcache']) ? $dc['memcache'][0]['port'] : '11211', 'password' => isset($dc['memcache']) ? $dc['memcache'][0]['password'] : '', ) ); /* $dc['mysql_user'] = array ( 'host' => array ( 'read' => 'web-mysql:3306', 'update' => 'web-mysql:3306', ), 'database' => 'wonderful', 'username' => 'root', 'password' => '123456', ); */ # 设置哪些项目需要切换到弹性数据库 if (isset($dc['mysql_user'])) { $dc['mysql_user']['charset'] = 'utf8'; $dc['mysql_user']['database'] = 'wonderful_act'; $dc['mysql_user']['type'] = 'pdo'; $config['database']['code'] = $dc['mysql_user']; $config['database']['act'] = $dc['mysql_user']; $config['database']['passport'] = $dc['mysql_user']; $config['database']['pay'] = $dc['mysql_user']; $config['database']['score'] = $dc['mysql_user']; $config['database']['message'] = $dc['mysql_user']; $config['database']['oauth'] = $dc['mysql_user']; $config['database']['wechat'] = $dc['mysql_user']; } if (DEVER_APP_NAME == 'tests' && isset($dc['mysql_test'])) { # 测试 $dc['mysql_test']['charset'] = 'utf8'; $dc['mysql_test']['database'] = 'wonderful_test'; $dc['mysql_test']['type'] = 'pdo'; $config['database']['default'] = $dc['mysql_test']; $config['database']['code'] = $dc['mysql_test']; $config['database']['act'] = $dc['mysql_test']; $config['database']['passport'] = $dc['mysql_test']; $config['database']['pay'] = $dc['mysql_test']; $config['database']['score'] = $dc['mysql_test']; $config['database']['message'] = $dc['mysql_test']; $config['database']['oauth'] = $dc['mysql_test']; $config['database']['wechat'] = $dc['mysql_test']; } # 缓存配置 $config['cache'] = array ( # 启用mysql数据库缓存,这个缓存是根据表名自动生成,dever::load形式和service的all、one形式均自动支持,无需手动添加 'mysql' => 0, # 启用页面缓存 会根据当前的url来生成缓存,相当于页面静态化。 'html' => 0, # 启用数据级别缓存 这个缓存是程序员自定义的:Dever::cache('name', 'value', 3600); 'data' => 1800, # 启用load加载器缓存,一般不加载 'load' => 0, # 启用load加载器的远程加载缓存 'curl' => 0, # 启用路由缓存 'route' => 1800, # 缓存精细控制,根据uri来控制,0则无需缓存 'routeKey' => array ( 'journal.buy_action' => 0, 'journal.code' => 0, 'passport' => 0, 'oauth' => 0, 'cron' => 0, //'act' => 0, 'combine' => 0, 'service_' => 0, 'vip_' => 0, 'order.' => 0, 'pay.' => 0, 'buy_home' => 0, 'buy_my_code' => 0, 'buy_codedetail' => 0, 'buy.pay' => 0, 'journal_v1.top' => 600, 'journal_v1.subscribe' => 0, 'journal_v1.getView' => 0, //'journal_v1.getList' => 0, 'journal_v1.view' => 0, 'tests_api.user' => 0, 'tests_api.buy' => 0, 'stat_' => 0, 'buy_' => 0, 'order_' => 0, 'pay_' => 0, ), # 哪些路由中的参数不参与生成缓存的key 'routeNoParam' => array ( 'signature' => array ( 'content.home', 'content.news', 'content.up', 'content.ad', 'journal.home', 'journal.getList', 'journal_v1.home', 'journal_v1.getList', 'journal_v1.top', 'journal_v1.buy', 'journal_v1.read', 'journal_v1.getAppList', 'journal_v1.getView', 'journal_v1.getAppView', 'buy_list', 'buy_pay', ), 'uid' => array ( 'content.home', 'content.news', 'content.up', 'content.ad', 'journal.home', 'journal.getList', 'journal_v1.home', 'journal_v1.getList', 'journal_v1.top', 'journal_v1.buy', 'journal_v1.read', 'journal_v1.getAppList', 'journal_v1.getView', 'journal_v1.getAppView', 'buy_list', 'buy_pay', ), ), # 缓存清理的参数名,请通过shell=clearcache执行 'shell' => 'clearcache', # 是否启用key失效时间记录,启用之后,将会记录每个key的失效时间 'expire' => true, # 缓存类型 'type' => 'redis',//memcache、redis # 缓存保存方式,支持多个数据源、多台缓存服务器 'store' => array ( array ( 'host' => 'server-redis', 'port' => '6379', 'weight' => 100, 'password' => 'dm_redis_123', ), ), ); if (isset($dc['redis']) && $config['cache']['type'] == 'redis') { $config['cache']['store'] = $dc['redis']; } if (isset($dc['memcache']) && $config['cache']['type'] == 'memcache') { $config['cache']['store'] = $dc['memcache']; } $config['debug'] = array ( 'log' => false ); /* if (DEVER_APP_NAME == 'source') { $config['debug']['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/?', ), 'pays' => array ( 'path' => $host. 'pay/pay/?', ), 'wechat_applet' => array ( 'path' => $host. 'wechat/wechat_applet/?', ), 'jingpin' => array ( 'path' => 'http://192.168.33.10/jingpin/content/?' ), ), ); return $config;