FileInfo
class FileInfo extends AbstractLocalImage (View source)
Creates a LocalImage object with a \SplFileInfo object as input.
Ideally used for images on a file system, but can be used for anything SplFileInfo supports (php streams and such)
Example:
With a path to a file:
$image = new FileInfo(new \SplFileInfo($filepath), $identifier, $context);
With the image in a variable, please use the \Rokka\Client\LocalImage\StringContent class
$image = new StringContent($content, $identifier, $context);
Properties
protected mixed|null | $context | Can be anything and accessed in callbacks and such. |
from AbstractLocalImage |
protected string|null | $rokkaHash | The rokka hash from the rokka API. |
from AbstractLocalImage |
protected string|null | $identifier | A unique identifier for this image, can be any string. |
from AbstractLocalImage |
Methods
No description
Returns the realPath of an image, if there is one.
Returns the filename of an image.
Returns the actual content of an image.
Returns the unique custom identifier.
Returns the rokkaHash, in case the object knows it already.
Details
__construct(SplFileInfo $image, string|null $identifier = null, mixed|null $context = null)
No description
string|bool
getRealpath()
Returns the realPath of an image, if there is one.
If the file isn't on the local file system (or a stream, php understands), return false.
string|null
getFilename()
Returns the filename of an image.
string|null
getContent()
Returns the actual content of an image.
null|string
getIdentifier()
Returns the unique custom identifier.
setIdentifier(string|null $identifier)
Sets the unique custom identifier.
mixed|null
getContext()
Returns the custom context.
setContext(mixed|null $context)
Sets the custom context.
null|string
getRokkaHash()
Returns the rokkaHash, in case the object knows it already.
Happens especially with the RokkaHash LocalImage class, but others may use it too