zend-component-installer
zend-component-installer copied to clipboard
Allow non-default filesystem layout
The config file paths are currently hardcoded. IMHO that's a bad move. The framework is very flexible about file names and directory layout, and the paths (in particular for the "config" files in question) are actually provided by the application, not the framework. Forcing a directory layout in the top-level directory can interfere with the project structure and give a bad end-user experience. (I have such a project where the forced layout does not fit in at all.)
Would it be possible to make paths configurable via the project's composer.json? The current layout could still be used by default if not configured explicitly.
Alternatively, notifications about possible injection points could be provided if none of the predefined files exist or its contents are not suitable for automatic modification. That would allow developers to add things manually. Currently, the installer remains silent if it cannot do anything automatically, and developers aren't even aware that injections are available/required.
We can certainly look into it; if you'd be willing to help enable the feature via a pull request, that would be even better!
The tool is largely geared towards the default and recommended use cases, which derive from our shipped skeletons. Anytime we add configurability, we have a potential gain for users, but also a larger maintenance burden, as more code paths lead to more potential surface area for bugs. Finally, adding more injectors is difficult, due to the fact that the plugin is operating in an isolated scope within composer; getting access to other classes to use for extension can be problematic.
So, tl;dr: not closed to the idea, but will likely defer to somebody submitting a concrete code feature versus developing it ourselves initially.
@hschletz @weierophinney
I began writing a longer comment in the wrong repo... :-), then I found somebody else asked the same question.
I have always been inclined to use *nix directory 3-chars names (bin, lib, etc, var, dat), so when I reactored config/ to etc/ the component installer obyiously stopped working (...well not much damage to me anyway)
I believe this customization could be achieved either by injecting the $configRoot instead of the $projectRoot or, maybe clearer, adding a $configDir parameter with config as the default value and making every $configFile property and aliases "directory-less".
kind regards, maks
(edit)
zend-expressive-tooling also contains a couple of hard-coded config/...
This repository has been closed and moved to laminas/laminas-component-installer; a new issue has been opened at https://github.com/laminas/laminas-component-installer/issues/4.