From a82dfff95ef071b7c43a5346ce35db404881a535 Mon Sep 17 00:00:00 2001 From: Riccardo Di Dato Date: Tue, 19 Apr 2016 12:17:30 +0200 Subject: [PATCH] =?UTF-8?q?script=20per=20retrocompatibilit=C3=A0=20link?= =?UTF-8?q?=20in=20versione=20di=20check?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- private/bin/retroBuildIDs.php | 49 +++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 private/bin/retroBuildIDs.php 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