[Flow] Broken 'Flow\Composer feature' to copy packages files into installation on composer install?

Stefan Reichelt eichelt at web.de
Wed Jul 16 02:31:53 CEST 2014


Hello everyone,

in a package I wanted to use the 'Flow\Composer feature' (Dunno what to
really called it..) that allows one to copy/overwrite files from a
directory inside a package into directories inside of and into the
installation itself. This automatically happens once composer
installed/updated a package configured to use this feature.

As an example, the typo3/neos package* uses this feature. The package
has the necessary setting (called 'manage-resources') set in its
composer.json and offers files to be copied, for example:
/Packages/Application/TYPO3.Neos/Resources/Private/Installer/Distribution/Defaults/Configuration/Routes.yaml

[* I think Neos's usage of that feature might be obsolete since
'typo3/neos-base-distribution' already contains all files the typo3/neos
package wants to copy?]

This file would then be copied (no overwriting when using directory
named 'Defaults' in source path though) to:
/Configuration/Routes.yaml

However the feature doesn't work (anymore?), The file(s) never get
copied (target(s) don't exist beforehand of course).


After some digging, I found what I believe to be the error:
In 'TYPO3\Flow\Composer\InstallerScripts::postPackageUpdateAndInstall'
at lines 67, 68, 70 & 71 the variable $relativeInstallPath contains a
slash at its end and the string it gets combined with contains another
slash at its own beginning.

This additional excess slash prevents a later str_replace call in
'TYPO3\Flow\Utility\Files::copyDirectoryRecursively' (line 261) to
return the correct relative path for each single file. In the end
nothing happens since the calculated target path is the same (except
'./' prepended) as the source one and exists already after all.


So yeah, might this thing be a bug and should I create an issue for it
or do I did I do it wrong and/or have something misconfigured in my
installation?

Also, is there no documentation about this particular feature or did I
miss it somewhere? :(


Kind regards
Stefan

PS: *sigh* Sometimes I wish I only knew how to get my points and
problems across in as few words as possible...
So yeah, sorry about that. :o)


More information about the Flow mailing list