Пример #1
0
 protected function init()
 {
     // 获取redis实例
     $this->redis = Boot::redis();
     $this->db = Boot::DB();
     // 从配置文件中获取最大limit并写入到redis中
     $size = Crawler::getMaxLimit();
     $this->redis->set('limitSize', $size);
     if (DEBUG == true) {
         echo 'the usernames at redis :';
         var_dump($this->redis->llen('usernames'));
     }
     if (!$this->redis->llen('usernames')) {
         // 初始化数据
         $this->getUsernames(0);
     }
 }