-
Notifications
You must be signed in to change notification settings - Fork 23
/
sqliimagediffhandler.php
35 lines (32 loc) · 1.04 KB
/
sqliimagediffhandler.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
/**
* File containing SQLIImageDiffHandler class
* @copyright Copyright (C) 2010 - SQLi Agency. All rights reserved
* @licence http://www.gnu.org/licenses/gpl-2.0.txt GNU GPLv2
* @author Jerome Vieilledent
* @version @@@VERSION@@@
* @package sqliimport
* @subpackage content
* @subpackage diffhandlers
*/
/**
* Diff handler for ezimage attributes.
* Only takes file name into account.
*/
class SQLIImageDiffHandler implements ISQLIDiffHandler
{
/**
* (non-PHPdoc)
* @see extension/sqliimport/classes/content/diffhandlers/ISQLIDiffHandler::contentIsModified()
*/
public static function contentIsModified( $data, eZContentObjectAttribute $attribute )
{
$isModified = false;
$imageHandler = $attribute->attribute( 'content' );
$originalFilename = $imageHandler->attribute( 'original_filename' );
$newImageFilename = basename( (string)$data );
if( $newImageFilename != $originalFilename )
$isModified = true;
return $isModified;
}
}