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

Andreas Wolf andreas.wolf at ikt-werk.de
Mon Dec 5 15:08:07 CET 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hi,

Am 05.12.2011 08:28, schrieb Fabien Udriot:
> Just wondering why getDriver() has been set as private in the
> Storage?
> 
> http://git.typo3.org/TYPO3v4/Incubator.git?a=blob;f=t3lib/file/Storage.php;h=e226de57386097129eeeca3ffcf58126d93e1816;hb=refs/heads/project-fileabstraction#l197

that's
> 
perfectly ok - we decided a while ago to tightly couple the
Storage and the Driver and then use the Storage as the external
interface. The Storage does all access checks etc., which should never
be circumvented - so direct access to the driver is no option.


> 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.

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...).

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 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.

Cheers
Andreas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEAREIAAYFAk7c0EcACgkQHWtXp155bP8s9gCdF+WuwQgnefAdMSzE+plEBOZ3
jk0AniNfh19mGiFzKgg4U+hAbFdTiqO0
=nIpI
-----END PGP SIGNATURE-----


More information about the TYPO3-project-media mailing list