[Adapter] - Directory
There should be a public method Adapter:getDirectory().
Similar to #175, #201
I don't agree with you : I don't think this issue is similar to #175 and #201. For me, @zender talks about having a getDirectory method in order to retrieve directory path. Useful if you want to manage manually the directory, which is not possible at the moment (#115).
#175 and #201 just refer to add an option for limiting recursion when you iterate through keys to improve performance.
I don't think it should be on the Adapter though. Not every adapter uses a directory. But it would be useful to be able to get the directory path on the Local adapter for example.
What is the usecase ? You set the directory in the adapter by yourself.
@gpaton What is the use case please? The whole point of Gaufrette is to provide a storage-agnostic layer. For me, opening the fact that this storage uses a directory is already breaking the abstraction of this layer. It's for the same reason that it's not possible to get the file path from outside of the Local adpater.
For me, I inject a Filesystem into a class that writes a file. After writing the file, i need to return the file path. Because different filesystems could be injected, I can't know the directory path the adapter uses.
It would be useful to be able to simply call $this->filesystem->getAdapter()->getDirectory().
That's my point, the only input/output of a Gaufrette filesystem is a file key. This key will allow you to communicate with whatever filesystems you defined and if you need a path that is storage specific, then you're doing it wrong.
Another solution is that you configure a directory into the local adapter that you could reuse elsewhere and compute by hand a file path. It really depend on what you want to achieve with the file path in the class you inject a Filesystem instance.
Well yeah you're right. In my case I needed the full path to execute a shell command with it. I'll have a look at it later to find a better solution.
I'm having the same use case. I need to have a path to execute some files. @rvanlaarhoven how did you solve this?