|
|
|
@ -3,6 +3,7 @@
|
|
|
|
|
namespace model;
|
|
|
|
|
|
|
|
|
|
use DAL\ArticleGateway;
|
|
|
|
|
use DAL\Connection;
|
|
|
|
|
use DAL\FluxGateway;
|
|
|
|
|
use DOMDocument;
|
|
|
|
|
use Exception;
|
|
|
|
@ -62,13 +63,25 @@ class Parser
|
|
|
|
|
/**
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
|
|
|
|
public function addAllArticles(){
|
|
|
|
|
$allFlux = $this->fluxGateway->findAllFlux();
|
|
|
|
|
public function addAllArticles()
|
|
|
|
|
{
|
|
|
|
|
$this->articleGateway->removeAllArticleForParser();
|
|
|
|
|
|
|
|
|
|
$allFlux = $this->fluxGateway->findAllFlux();
|
|
|
|
|
var_dump($allFlux);
|
|
|
|
|
$allArticles = $this->parseAll($allFlux);
|
|
|
|
|
|
|
|
|
|
var_dump($allArticles);
|
|
|
|
|
foreach ($allArticles as $article) {
|
|
|
|
|
$this->articleGateway->addArticle($article);
|
|
|
|
|
}
|
|
|
|
|
return $allArticles;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
$gwArt = new ArticleGateway(new Connection('mysql:host=londres.uca.local;dbname=dbrorossetto', 'rorossetto', 'tpphp'));
|
|
|
|
|
$gwFl = new FluxGateway(new Connection('mysql:host=londres.uca.local;dbname=dbrorossetto', 'rorossetto', 'tpphp'));
|
|
|
|
|
$pars = new Parser( $gwFl,$gwArt);
|
|
|
|
|
var_dump($pars->addAllArticles());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|