diff --git a/private/bin/retroBuildIDs.php b/private/bin/retroBuildIDs.php new file mode 100644 index 0000000..200188c --- /dev/null +++ b/private/bin/retroBuildIDs.php @@ -0,0 +1,49 @@ +#!/usr/bin/php + "SET NAMES utf8") ); +$pdo->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION ); + +$count = 0; +// $statement = $pdo->query("select * from notizia order by id desc limit $count,100"); +$statement = $pdo->query("select * from notizia order by id desc limit $count,100"); +$dati = $statement->fetchALL(PDO::FETCH_CLASS,"stdClass"); + +while (is_array($dati) && sizeof($dati)>0){ + + foreach ($dati as $ele){ + + $notizia = GlobalVariables::get("dao")->getFirst("NotiziaModel",array("titolo"=>$ele->mainTitle)); + + if (is_null($notizia)){ + $notizia = GlobalVariables::get("dao")->getFirst("NotiziaModel",array("titolo"=>htmlspecialchars_decode($ele->mainTitle))); + } + + if (is_null($notizia)){ + var_dump($ele); + } + + if (!is_null($notizia)){ +// $notizia->oldId = $ele->id; + +// GlobalVariables::get("dao")->save($notizia); + } + else { + echo $ele->id."\n"; + } + + } + $dati = array(); +// $count+=100; +// $statement = $pdo->query("select * from notizia order by id desc limit $count,100"); +// $dati = $statement->fetchALL(PDO::FETCH_CLASS,"stdClass"); +} + + +?> \ No newline at end of file