[TYPO3-media] RFC: make use of t3lib_extFileFunctions API in VIDI - func_move

Fabien Udriot fabien.udriot at ecodev.ch
Thu Nov 17 08:17:09 CET 2011


Hi,

Here would be the RFC which I would like to have feedback before merging: http://review.typo3.org/6704

The concern is about making use of t3lib_extFileFunctions API within VIDI. In my eyes, 
t3lib_extFileFunctions can be seen as a kind of wrapper around the FAL API. Consider the func_move 
function bellow:

http://git.typo3.org/TYPO3v4/Incubator.git?a=blob;f=t3lib/class.t3lib_extfilefunc.php;h=9ccff3215e6e5b3a4c04e5c405ecde80ca228c98;hb=refs/heads/project-fileabstraction#l511

Notice the current patch works in term of functionality: I can drag an drop files in the VIDI UI and 
get file moved. However, it introduces some changes in the API that needs validation. The patch 
r6704 tries to fix different problems:

* Folder can be instantiated as File

To explain it, I let take this example:

$object = $this->fileFactory->getFileObjectFromCombinedIdentifier($identifier);

Say that $identifier is the identifier of a folder. What should be the value of $object in the code 
above ? Currently, it returns a t3lib_file_File object but I am not 100% convinced the result is the 
one expected (even tough a folder can be consider as a file, strictly speaking).

I have changed the API towards a NULL value because I need a way to distinguish the two different 
objects (file and folder).
https://review.typo3.org/#patch,sidebyside,6704,1,t3lib/file/Service/Driver/LocalDriver.php


* I have added addMoveOfFile to be coherent with addCopyOfFile. Can you check it and let me know 
whether it makes sense.

https://review.typo3.org/#patch,sidebyside,6704,1,t3lib/class.t3lib_extfilefunc.php
https://review.typo3.org/#patch,sidebyside,6704,1,t3lib/file/Folder.php


* Besides, I / we are still in the search of a good concept for extfilefunc. API is not really nice 
IMO. Take as example the code on this link. I wish we could have a more elegant wrapper. Just 
collecting idea for now...

https://review.typo3.org/#patch,sidebyside,6704,1,typo3/sysext/file/Classes/Service/VidiDragAndDrop.php

Cheers,






More information about the TYPO3-project-media mailing list