colly_wyx
2018-06-14 bef2c06923d3ba6727654f734bb93d5a09855dc5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php
/**
 * 文件MQ
 *
 * - 队列存放于本地文件 中,不支持分布式MQ
 *
 * @author dogstar <chanzonghuang@gmail.com> 20150516
 */
 
class Task_MQ_File extends Task_MQ_KeyValue {
 
    public function __construct(PhalApi_Cache_File $fileCache = NULL) {
        if ($fileCache === NULL) {
            $config = DI()->config->get('app.Task.mq.file');
            if (!isset($config['path'])) {
                $config['path'] = API_ROOT . '/Runtime';
            }
            if (!isset($config['prefix'])) {
                $config['prefix'] = 'phalapi_task';
            }
 
            $fileCache = new PhalApi_Cache_File($config);
        }
 
        parent::__construct($fileCache);
    }
}