script per retrocompatibilità link in versione di check
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
#!/usr/bin/php
|
||||
<?php
|
||||
/*
|
||||
Author: Riccardo Di Dato
|
||||
Creation Date: 19/apr/2016
|
||||
*/
|
||||
|
||||
require_once(dirname(__FILE__)."/../load.php");
|
||||
|
||||
$pdo = new PDO("mysql:host=localhost;dbname=fdn_old","root","root",array(PDO::MYSQL_ATTR_INIT_COMMAND => "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");
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user