[TYPO3-dev] Change driver of a FAL file

Philipp Gampe philipp.gampe at typo3.org
Mon Oct 13 00:13:50 CEST 2014


Hi Frans,

Frans Saris wrote:

>>
>> Lol, imagine this with an editor moving a 4GB movie file from a remote
>> storage to a local storage.

Well, actually this was a bad example. Image moving a 32GB file from one 
remote storage to another remote storage (possible with a different driver). 
Creating a temp file could kill the /tmp file system.

> Your right.
> Maybe you can have a look at it and fix it? Have a look at the
> resourceStorage and the use of  $file->getForLocalProcessing();
> 
> Setting it to $file->getForLocalProcessing(FALSE); should prevent the copy
> for local storages but I do not know if there are situations where this
> will break stuff.

I though about this and I think we need to have dedicated functions for 
this, because this should not be mixed with the regular file functions.

IMHO each storage/driver should have a method:
void import(File $originalFile, Storage $originalStorage) {};

That way the new storage can decide how to import the file based on the old 
storage; e.g. move file or a more complex operation in cloud storages.

The old storage should have counter part that is be called from within the 
import method:
mixed export(File $file, Storage $newStorage) {};

That way, both storages can be programmed to handle complex moving scenarios 
with a minimum of resource effort. We should ship a default implementation 
in the abstract storage class to be backwards compatible.

I think this will be mainly used for bigger sites with a custom 
driver/storage implementation.

Let me know what you think about it.

Best regards
-- 
Philipp Gampe – PGP-Key 0AD96065 – TYPO3 UG Bonn/Köln
Documentation – Active contributor TYPO3 CMS
TYPO3 .... inspiring people to share!




More information about the TYPO3-dev mailing list