[TYPO3-media] Comments regarding FAL commits

Ingmar Schlecht ingmar at typo3.org
Mon Nov 14 16:51:35 CET 2011


By the way, this mail wasn't meant as public bashing, but I just put it 
here because the mistake with wrongly assuming the identifier to be the 
equivalent to the path has been made by others as well already, so I 
thought it's better to discuss about it at this place.

cheers
Ingmar


Am 14.11.11 13:59, schrieb Ingmar Schlecht:
> Hi guys,
>
> I think it would be useful to have a thread in thie list to communicate
> about changes / commits to the Git repository of the fileabstraction
> project, so we can explain the reason behind the changes.
>
> Also, I will probably get back to some commits and comment on them if I
> see something which doesn't fit.
>
> Here is a first comment reagarding one commit from the day before
> yesterday:
>
> @Andreas:
> http://git.typo3.org/TYPO3v4/Incubator.git?a=commit;h=830c1335309c8aa81b47a19d477f97db8f593dbd
>
>
> In this commit you introduced a new method createFolder(), even though
> we already have an addFolder() method.
>
> /**
> + * Creates a folder.
> + *
> + * @param string $identifier
> + * @param bool $createRecursively
> + * @return bool
> + */
> + public function createFolder($identifier, $createRecursively = TRUE) {
> + return $this->driver->createFolder($identifier, $createRecursively);
> + }
>
> Also, it has a dangerous / wrong method signature, as it only has the
> $identifier, which is not enough to create a folder. Keep in mind that
> an identifier could also look like "md5aoisudzfg79as6dfvztas", in other
> words any random identifier a Driver chooses to identify its objects. To
> create a new folder, you always need at least the name of the new folder
> to create.
>
> Therefore, this method has already been there with the correct signature:
>
> /**
> * previously in t3lib_extFileFunc::folder_new()
> * @param string $newFolderName
> * @param t3lib_file_Folder $parentFolder The parent folder to create the
> new folder inside of
> * @return t3lib_file_Folder The new folder object
> */
> public function addFolder($newFolderName, t3lib_file_Folder
> $parentFolder) {
> // TODO: Implement this function
> // return $this->driver->createFolder($newFolderName, $parentFolder);
> }
>
>
> cheers
> Ingmar



More information about the TYPO3-project-media mailing list