Gaufrette
Gaufrette copied to clipboard
Get absolute physical path?
Hello, Sonata Media is using Gaufrette File and when I call this method of a provider:
/**
* {@inheritdoc}
*/
public function getReferenceFile(MediaInterface $media)
{
return $this->getFilesystem()->get($this->getReferenceImage($media), true);
}
It returns an instance of File
, how can I get the absolute path after this instance? Thanks!
Hello,
I assume you are using the local
adapter. You can get the file path from the getKey
method of the File
instance. You then have to prefix it with the directory for which you've configured the local
adapter in order to have the absolute path of the file.
I close this stale issue. Please feel free to reopen it if necessary.