Closed grebaldi closed 2 months ago
What a coincidence that I talked about this type of dev setup with @bwaidelich yesterday. I am all for changes that make this usecase easier. Wasn't aware this here is needed.
I just wonder if this could be applied to 8.3?
I wouldn't mind it!
@kdambekalns
I just wonder if this could be applied to 8.3?
I think so, too. I'm going to rebase this on 8.3
as soon as I get around to testing it there (which hopefully will be today :)).
Done. Works well on 8.3
:)
The Problem
In my development setups (for contribution), I prefer to have every repo that is under development installed via composer
path
repositories, like so:Now if I clone, say,
neos/neos-development-collection
intoDevelopmentPackages/
, composer will install the local version rather than the one from packagist.This works for
neos/neos-development-collection
,neos/neos-ui
and pretty much any other package around, but not forneos/flow-development-collection
.The
flow
CLI script makes the assumption that it is always located underPackages/*/
and uses this assumption to discover theautoload.php
script. It does so starting at its own path using the__DIR__
constant.Unfortunately, PHP resolves symlinks before it sets the
__DIR__
constant. So when flow is installed via symlink,__DIR__
does not contain its symlinked location, but its real location. This way it guesses the wrong path forautoload.php
, rendering theflow
CLI script unusable.The solution
The
flow
CLI script also figures out theFLOW_ROOTPATH
. It does so just after the autoload discovery.I guessed that it would be a safe assumption that the
autoload.php
can always be found underFLOW_ROOTPATH/Packages/Libraries/autoload.php
. (though actually, this path may have been configured differently, but flow wouldn't be able to handle that as of right now)Therefore, I moved the composer autload discovery below the
FLOW_ROOTPATH
discovery, to then useFLOW_ROOTPATH
as a starting point.I'm pretty sure this is applicable to lower branches as well, but I didn't test this yet, so I'm targeting
9.0
for now.