DefaultCallbacks
class DefaultCallbacks extends AbstractCallbacks (View source)
The default implementation for \Rokka\Client\TemplateHelper\AbstractCallbacks.
It stores the hash to an image on the filesystem as json. Either next to the image, if it's on the filesystem, otherwise in the sys_get_temp_dir().
Properties
static string | $fileExtension |
Methods
This method is called, when an image was saved/uploaded to the rokka server.
Details
null|string
getHash(AbstractLocalImage $image)
Callback when a "local" image needs its hash.
Look up if the hash is stored in the right place (DB or similar) and return it. If not stored, return null, so that the picture will be uploaded.
string
saveHash(AbstractLocalImage $image, SourceImage $sourceImage)
This method is called, when an image was saved/uploaded to the rokka server.
This is the place, where you would store the hash in the right place (DB or similar). Has to return the hash or short hash.
array
getMetadata(AbstractLocalImage $image)
Return an array of metadata to be sent to the rokka server.