[TYPO3-media] why getDriver set as private in storage?

Fabien Udriot fabien.udriot at ecodev.ch
Tue Dec 6 03:43:26 CET 2011


Hi Andreas,

Thanks for your reply.

>> How can we access the path of a File / Folder now? getIdentifier()
>> is obviously not enough to determine a full path. Previously we
>> had:
>>
>> $storage->getDriver()->getAbsolutePath()
>
> What do you need this for? The getAbsolutePath() method is specific to
> the local driver and not part of the driver interface.

This is a common need to retrieve a path of a file / folder.

> The full identifier for a file should be the combination of storage id
> and file identifier, which is unique (it has to be ->  enforced by
> database restrictions...).

Yeah, for backwards compatibility, we should have the identifier being prefixed by the storage ID.

> If you need a file for processing on the local hard disk, you should
> use the getLocalCopy() method (or its equivalent, I don't exactly
> remember the name currently; getLocalCopy() is the name I intend for
> this method).

Now, it has been called getForLocalProcessing(). Personally, I would prefer getLocalPath() which 
sounds more obvious for me to retrieve a path.

>> Now, it looks we have to go through the File / Folder itself. Is
>> it possible something is still missing in Folder?
>
> This is possible - if we discover some information that is not
> available via the Storage, we should (after careful consideration if
> the change fits the concepts) add it.

Given a $folderObject, tell me how you would retrieve its relative / absolute path on a local 
storage considering the actual implementation:

http://git.typo3.org/TYPO3v4/Incubator.git?a=blob;f=t3lib/file/Folder.php;h=2e24ded4ba62b450b465e77fc29ba9980fd363d5;hb=refs/heads/project-fileabstraction

Cheers,

Fabien


More information about the TYPO3-project-media mailing list