Absolute path in AWS adapter
NicolaPez opened this issue · comments
NicolaPez commented
I'm using this code for get the path of an adapter in my project. For the dev enviroment I use an local adapter, and all works fine. In prod enviroment I use an AWS adapter, but don't know how get the absolute path of this. Someone can help me?
...
$adapter = $filesystemGuafrette->getAdapter();
$reflection = new \ReflectionClass($adapter);
if($this->kernel->getEnvironment() == 'dev'){
$property = 'directory';
}else{
//prod enviroment, AWS adapter
$property = '?';
}
$directory = $reflection->getProperty($property);
$directory->setAccessible(true);
$prePath = $directory->getValue($adapter);
...
Nicolas MURE commented
Hello, you can have a look to gaufrette's extras to get the url of your object : https://github.com/Gaufrette/extras