Exemplo n.º 1
0
 function __construct($config = array())
 {
     //检测日志目录是否存在
     $log_dir = dirname($config['webim']['log_file']);
     if (!is_dir($log_dir)) {
         mkdir($log_dir, 0777, true);
     }
     if (!empty($config['webim']['log_file'])) {
         $logger = new Swoole\Log\FileLog($config['webim']['log_file']);
     } else {
         $logger = new Swoole\Log\EchoLog();
     }
     $this->setLogger($logger);
     //Logger
     /**
              * 使用文件或redis存储聊天信息         
             $this->setStore(new \WebIM\Store\File($config['webim']['data_dir']));
     */
     /**
      * 使用redis存储聊天信息
      */
     $this->setStore(new \WebIM\Store\Redis());
     $this->setRooms(new \WebIM\Store\Rooms());
     $this->origin = $config['server']['origin'];
     parent::__construct($config);
 }
Exemplo n.º 2
0
 function __construct($config = array())
 {
     parent::__construct($config);
 }