Config.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351
  1. <?php
  2. return [
  3. // 内置项目配置
  4. 'app_name' => PROJECT_NAME,
  5. 'app_path' => PROJECT_PATH,
  6. // 自定义项目配置
  7. //'logPath' => PROJECT_PATH . '/log', // 项目日志目录
  8. 'logPath' => PROJECT_PATH . '/log/crontab/'.date("Ymd"), // 项目日志目录
  9. 'logSaveFileApp' => 'application.log', // 默认日志文件名称
  10. 'logSaveFileWorker' => 'crontab.log', // 进程启动相关log存储名字
  11. 'pidPath' => PROJECT_PATH . '/log',
  12. 'sleep' => 2, // 队列没消息时,暂停秒数
  13. 'queueMaxNum' => 10, // 队列达到一定长度,启动动态子进程个数发和送消息提醒
  14. 'excuteTime' => 3600, // 子进程最长执行时间,防止内存泄漏
  15. 'queueTickTimer' => 1000 * 10, //一定时间间隔(毫秒)检查队列长度;默认10秒钟
  16. 'messageTickTimer' => 1000 * 180, //一定时间间隔(毫秒)发送消息提醒;默认3分钟
  17. 'processName' => ':swooleTopicQueue', // 设置进程名, 方便管理, 默认值 swooleTopicQueue
  18. //job任务相关
  19. 'job' => [
  20. 'topics' => [
  21. ['name' => 'MyJob', 'workerMinNum' => 1, 'workerMaxNum' => 5],
  22. //['name'=> 'MyJob2', 'workerMinNum'=>1, 'workerMaxNum'=>5],
  23. //['name'=> 'MyJob3', 'workerMinNum'=>1, 'workerMaxNum'=>5],
  24. ],
  25. // redis
  26. 'queue' => [
  27. 'class' => 'Jobs\Model\Queue\MRedisTopicQueue',
  28. 'host' => '127.0.0.1',
  29. 'port' => 6379,
  30. 'password' => '',
  31. 'database' => 3,
  32. ],
  33. // rabbitmq
  34. // 'queue' => [
  35. // 'class' => '\Kcloze\Jobs\Queue\RabbitmqTopicQueue',
  36. // 'host' => '192.168.9.24',
  37. // 'user' => 'phpadmin',
  38. // 'pass' => 'phpadmin',
  39. // 'port' => '5671',
  40. // 'vhost' => 'php',
  41. // 'exchange' => 'php.amqp.ext',
  42. // ],
  43. ],
  44. //框架类型及装载类
  45. 'framework' => [
  46. //可以自定义,但是该类必须继承\Kcloze\Jobs\Action\BaseAction
  47. 'class' => 'Jobs\Controller\CJobs',
  48. ],
  49. 'message' => [
  50. 'class' => '\Kcloze\Jobs\Message\DingMessage',
  51. 'token' => '***your-dingding-token***',
  52. ],
  53. 'db' => [
  54. 'default' => [
  55. 'driver' => 'mysql',
  56. 'host' => '127.0.0.1',
  57. 'port' => '3306',
  58. 'username' => 'rootdefault',
  59. 'password' => '0d6047adbbae53c7',
  60. 'dbname' => 'qnys_devanfei',
  61. 'prefix' => 'qianniao',
  62. 'pconnect' => 0,
  63. 'charset' => 'utf8',
  64. ],
  65. 'stock' => [
  66. 'driver' => 'mysql',
  67. 'host' => '127.0.0.1',
  68. 'port' => '3306',
  69. 'username' => 'rootdefault',
  70. 'password' => '0d6047adbbae53c7',
  71. 'dbname' => 'qnys_devstock',
  72. 'prefix' => 'qianniao',
  73. 'pconnect' => 0,
  74. 'charset' => 'utf8',
  75. ],
  76. 'price' => [
  77. 'driver' => 'mysql',
  78. 'host' => '127.0.0.1',
  79. 'port' => '3306',
  80. 'username' => 'rootdefault',
  81. 'password' => '0d6047adbbae53c7',
  82. 'dbname' => 'qnys_devprice',
  83. 'prefix' => 'qianniao',
  84. 'pconnect' => 0,
  85. 'charset' => 'utf8',
  86. ],
  87. 'log' => [
  88. 'driver' => 'mysql',
  89. 'host' => '127.0.0.1',
  90. 'port' => '3306',
  91. 'username' => 'rootdefault',
  92. 'password' => '0d6047adbbae53c7',
  93. 'dbname' => 'qnys_devlog',
  94. 'prefix' => 'qianniao',
  95. 'pconnect' => 0,
  96. 'charset' => 'utf8',
  97. ],
  98. 'finance' => [
  99. 'driver' => 'mysql',
  100. 'host' => '127.0.0.1',
  101. 'port' => '3306',
  102. 'username' => 'rootdefault',
  103. 'password' => '0d6047adbbae53c7',
  104. 'dbname' => 'qnys_devfinan',
  105. 'prefix' => 'qianniao',
  106. 'pconnect' => 0,
  107. 'charset' => 'utf8',
  108. ],
  109. ],
  110. 'cache' => [
  111. 'default' => [
  112. 'storage' => 'redis',
  113. 'host' => '127.0.0.1',
  114. 'port' => '6379',
  115. 'auth' => '',
  116. 'prefix' => 'new_',
  117. 'database' => '0',
  118. ],
  119. 'mapping' => [
  120. 'storage' => 'redis',
  121. 'host' => '127.0.0.1',
  122. 'port' => '6379',
  123. 'auth' => '',
  124. 'prefix' => 'new_',
  125. 'database' => '1',//用于缓存地区
  126. ],
  127. 'user' => [
  128. 'storage' => 'redis',
  129. 'host' => '127.0.0.1',
  130. 'port' => '6379',
  131. 'auth' => '',
  132. 'prefix' => 'new_',
  133. 'database' => '2',
  134. ],
  135. 'finance' => [
  136. 'storage' => 'redis',
  137. 'host' => '127.0.0.1',
  138. 'port' => '6379',
  139. 'auth' => '',
  140. 'prefix' => 'new_',
  141. 'database' => '3',
  142. ],
  143. 'activity' => [
  144. 'storage' => 'redis',
  145. 'host' => '127.0.0.1',
  146. 'port' => '6379',
  147. 'auth' => '',
  148. 'prefix' => 'new_',
  149. 'database' => '5',
  150. ],//活动
  151. ],
  152. 'dataResources' => [
  153. 'ThirdPartyService' => [
  154. 'host' => '',
  155. 'port' => '9508',
  156. 'time_out' => -1,
  157. ],
  158. ],
  159. 'search' => [
  160. 'goods_search' =>[
  161. 'protocol' => 'http',
  162. 'servers' => [
  163. '127.0.0.1:80'
  164. ],
  165. 'timeout' => null,
  166. 'index' => 'online_goods_search',
  167. 'type' => 'goods',
  168. ],
  169. 'customer_search' =>[
  170. 'protocol' => 'http',
  171. 'servers' => [
  172. '127.0.0.1:80'
  173. ],
  174. 'timeout' => null,
  175. 'index' => 'online_customer_search',
  176. 'type' => 'customer',
  177. ],
  178. 'goods_basic_search' =>[
  179. 'protocol' => 'http',
  180. 'servers' => [
  181. '127.0.0.1:80'
  182. ],
  183. 'timeout' => null,
  184. 'index' => 'online_goodsbasic_search',
  185. 'type' => 'goodsBasic',
  186. ],
  187. 'shop_search' =>[
  188. 'protocol' => 'http',
  189. 'servers' => [
  190. '127.0.0.1:80'
  191. ],
  192. 'timeout' => null,
  193. 'index' => 'online_shop_search',
  194. 'type' => 'shop',
  195. ],
  196. 'order_search' =>[
  197. 'protocol' => 'http',
  198. 'servers' => [
  199. '127.0.0.1:80'
  200. ],
  201. 'timeout' => null,
  202. 'index' => 'online_order_search',
  203. 'type' => 'order',
  204. ],
  205. 'priceAdjustmentSheet_search' => [
  206. 'protocol' => 'http',
  207. 'servers' => [
  208. '127.0.0.1:80'
  209. ],
  210. 'timeout' => null,
  211. 'index' => 'online_priceadjustmentsheet_search',
  212. 'type' => 'priceAdjustmentSheet',
  213. ],
  214. 'customerPriceAdjustmentSheet_search' => [
  215. 'protocol' => 'http',
  216. 'servers' => [
  217. '127.0.0.1:80'
  218. ],
  219. 'timeout' => null,
  220. 'index' => 'online_customer_price_adjustment_sheet_search',
  221. 'type' => 'customerPriceAdjustmentSheet',
  222. ],
  223. 'inventory_details_search' => [
  224. 'protocol' => 'http',
  225. 'servers' => [
  226. '127.0.0.1:80'
  227. ],
  228. 'timeout' => null,
  229. 'index' => 'online_inventory_details_search',
  230. 'type' => 'inventory_details',
  231. ],
  232. 'purchase_details_search' => [
  233. 'protocol' => 'http',
  234. 'servers' => [
  235. '127.0.0.1:80'
  236. ],
  237. 'timeout' => null,
  238. 'index' => 'online_purchase_details_search',
  239. 'type' => 'purchase_details',
  240. ],
  241. 'order_out_search' => [
  242. 'protocol' => 'http',
  243. 'servers' => [
  244. '127.0.0.1:80'
  245. ],
  246. 'timeout' => null,
  247. 'index' => 'online_order_out_search',
  248. 'type' => 'order_out',
  249. ],
  250. 'inventory_out_search' => [
  251. 'protocol' => 'http',
  252. 'servers' => [
  253. '127.0.0.1:80'
  254. ],
  255. 'timeout' => null,
  256. 'index' => 'online_inventory_out_search',
  257. 'type' => 'inventory_out',
  258. ],
  259. 'inventory_in_search' => [
  260. 'protocol' => 'http',
  261. 'servers' => [
  262. '127.0.0.1:80'
  263. ],
  264. 'timeout' => null,
  265. 'index' => 'online_inventory_in_search',
  266. 'type' => 'inventory_in',
  267. ],
  268. 'inventory_batch_search' => [
  269. 'protocol' => 'http',
  270. 'servers' => [
  271. '127.0.0.1:80'
  272. ],
  273. 'timeout' => null,
  274. 'index' => 'online_inventory_batch_search',
  275. 'type' => 'inventory_batch',
  276. ],
  277. 'should_receive_receipt_search' => [
  278. 'protocol' => 'http',
  279. 'servers' => [
  280. '127.0.0.1:80'
  281. ],
  282. 'timeout' => null,
  283. 'index' => 'dev_should_receive_receipt_search',
  284. 'type' => 'should_receive_receipt',
  285. ],
  286. 'should_pay_receipt_search' => [
  287. 'protocol' => 'http',
  288. 'servers' => [
  289. '127.0.0.1:80'
  290. ],
  291. 'timeout' => null,
  292. 'index' => 'dev_should_pay_receipt_search',
  293. 'type' => 'should_pay_receipt',
  294. ],
  295. 'activity_search' => [
  296. 'protocol' => 'http',
  297. 'servers' => [
  298. '127.0.0.1:80'
  299. ],
  300. 'timeout' => null,
  301. 'index' => 'online_activity_search',
  302. 'type' => 'activity',
  303. ],
  304. 'login_log' =>[
  305. 'protocol' => 'http',
  306. 'servers' => [
  307. '127.0.0.1:80'
  308. ],
  309. 'timeout' => null,
  310. 'index' => 'online_login_log',
  311. 'type' => 'login',
  312. ],
  313. 'logs' => [
  314. 'protocol' => 'http',
  315. 'servers' => [
  316. '127.0.0.1:80'
  317. ],
  318. 'timeout' => null,
  319. 'index' => 'dev_logs',
  320. 'type' => 'logs',
  321. ],
  322. 'received_receipt_search' => [
  323. 'protocol' => 'http',
  324. 'servers' => [
  325. '127.0.0.1:80'
  326. ],
  327. 'timeout' => null,
  328. 'index' => 'online_received_receipt_search',
  329. 'type' => 'received_receipt',
  330. ],
  331. 'user_coupon_search' => [
  332. 'protocol' => 'http',
  333. 'servers' => [
  334. '127.0.0.1:80'
  335. ],
  336. 'timeout' => null,
  337. 'index' => 'online_user_coupon_search',
  338. 'type' => 'user_coupon',
  339. ],
  340. ]
  341. ];