Scrutinizer Auto-Fixes

This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
This commit is contained in:
Scrutinizer Auto-Fixer
2015-03-24 11:56:32 +00:00
parent 22935f5aef
commit 2db9954e8a
128 changed files with 5016 additions and 4680 deletions
+15 -15
View File
@@ -7,7 +7,7 @@ $pdo = new DB();
$covers = $updated = $deleted = 0;
if ($argc == 1 || $argv[1] != 'true') {
exit($pdo->log->error("\nThis script will check all images in covers/console and compare to db->consoleinfo.\nTo run:\nphp $argv[0] true\n"));
exit($pdo->log->error("\nThis script will check all images in covers/console and compare to db->consoleinfo.\nTo run:\nphp $argv[0] true\n"));
}
@@ -16,20 +16,20 @@ $path2covers = NN_COVERS . 'console' . DS;
$dirItr = new \RecursiveDirectoryIterator($path2covers);
$itr = new \RecursiveIteratorIterator($dirItr, \RecursiveIteratorIterator::LEAVES_ONLY);
foreach ($itr as $filePath) {
if (is_file($filePath) && preg_match('/\d+\.jpg/', $filePath)) {
preg_match('/(\d+)\.jpg/', basename($filePath), $match);
if (isset($match[1])) {
$run = $pdo->queryDirect("UPDATE consoleinfo SET cover = 1 WHERE cover = 0 AND id = " . $match[1]);
if ($run->rowCount() >= 1) {
$covers++;
} else {
$run = $pdo->queryDirect("SELECT id FROM consoleinfo WHERE id = " . $match[1]);
if ($run->rowCount() == 0) {
echo $pdo->log->info($filePath . " not found in db.");
}
}
}
}
if (is_file($filePath) && preg_match('/\d+\.jpg/', $filePath)) {
preg_match('/(\d+)\.jpg/', basename($filePath), $match);
if (isset($match[1])) {
$run = $pdo->queryDirect("UPDATE consoleinfo SET cover = 1 WHERE cover = 0 AND id = " . $match[1]);
if ($run->rowCount() >= 1) {
$covers++;
} else {
$run = $pdo->queryDirect("SELECT id FROM consoleinfo WHERE id = " . $match[1]);
if ($run->rowCount() == 0) {
echo $pdo->log->info($filePath . " not found in db.");
}
}
}
}
}
$qry = $pdo->queryDirect("SELECT id FROM consoleinfo WHERE cover = 1");