Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Absolute path in AWS adapter #606

Open
NicolaPez opened this issue Apr 5, 2019 · 1 comment
Open

Absolute path in AWS adapter #606

NicolaPez opened this issue Apr 5, 2019 · 1 comment
Assignees

Comments

@NicolaPez
Copy link

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);
...
@nicolasmure
Copy link
Contributor

Hello, you can have a look to gaufrette's extras to get the url of your object : https://github.com/Gaufrette/extras

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants