Ejemplo n.º 1
0
 static function item_updated($old_item, $new_item)
 {
     if ($new_item->id == 1) {
         return true;
     }
     if ($new_item->has_aws_s3_meta()) {
         aws_s3::log("Item updated - " . $new_item->id);
         if ($old_item->relative_path() == $new_item->relative_path() && $old_item->s3_item_hash == $new_item->s3_item_hash) {
             aws_s3::log("nothing changed?!");
         } else {
             if ($old_item->relative_path() != $new_item->relative_path()) {
                 aws_s3::log("Item moved...");
                 aws_s3::move_item($old_item, $new_item);
             } else {
                 aws_s3::log("Item hasn't moved. Image updated?");
                 aws_s3::remove_item($old_item);
                 aws_s3::schedule_item_sync($new_item);
             }
         }
     }
 }
Ejemplo n.º 2
0
 static function item_moved($new_item, $old_item)
 {
     aws_s3::log("Item moved - " . $item->id);
     aws_s3::move_item($old_item, $new_item);
 }