Exemple #1
0
 /**
  * @param $startUrl
  * @param $maxLevel
  * @param $filePath
  */
 public function generate($startUrl, $maxLevel, $filePath)
 {
     $this->startUrl = $startUrl;
     try {
         $this->storage->init();
         $this->siteProcessor->setMaxLevel($maxLevel);
         $this->siteProcessor->process($startUrl);
         $this->writer->write($startUrl, $filePath);
         $this->storage->deInit();
     } catch (loader\LoaderException $e) {
         echo $e->getMessage();
     } catch (parser\ParserException $e) {
         echo $e->getMessage();
     } finally {
         $this->storage->deInit();
     }
 }