Added Tagging, Moving with Replace, Optimised Delete
This commit is contained in:
32
application/classes/Task/Photo/Stat.php
Normal file
32
application/classes/Task/Photo/Stat.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php defined('SYSPATH') or die('No direct access allowed.');
|
||||
|
||||
/**
|
||||
* Find photos that dont match their database entries.
|
||||
*
|
||||
* @package Photo
|
||||
* @category Tasks
|
||||
* @author Deon George
|
||||
* @copyright (c) 2014 Deon George
|
||||
* @license http://dev.leenooks.net/license.html
|
||||
*/
|
||||
class Task_Photo_Stat extends Minion_Task {
|
||||
protected $_options = array(
|
||||
);
|
||||
|
||||
protected function _execute(array $params) {
|
||||
$p = ORM::factory('Photo')->find_all();
|
||||
|
||||
foreach ($p as $po) {
|
||||
if (! file_exists($po->file_path())) {
|
||||
printf("ID [%s] doesnt exist (%s)?\n",$po->id,$po->file_path());
|
||||
continue;
|
||||
}
|
||||
|
||||
if (($x=$po->io()->getImageSignature()) !== $po->signature) {
|
||||
printf("ID [%s] signature doesnt match (%s) [%s != %s]?\n",$po->id,$po->file_path(),$po->signature,$x);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
Reference in New Issue
Block a user