Exemplo n.º 1
0
 /**
  * 启动器的构造函数,注册component文件中的组件,并运行crawler
  * @param Interfaces\ConfigInterface $Config 配置文件类
  * @param array $components 需要注册的所有组件
  */
 public function __construct(Interfaces\ConfigInterface $Config, $components)
 {
     $this->config = $Config;
     $this->components = $components;
     $this->bind();
     $presentUrl = $this->config->get("presentUrl");
     $maxLevel = $this->config->get("maxLevel");
     $sleepTime = $this->config->get("sleepTime");
     //调用crawler组件
     $this->begin(Component::Crawler($maxLevel, $presentUrl, $sleepTime));
 }