frontend icon indicating copy to clipboard operation
frontend copied to clipboard

inject at composer install ?

Open arhimede opened this issue 9 months ago • 2 comments

let's see what happens if you run composer install on a production repo

it inject or not stuff in config/config.php

arhimede avatar May 06 '24 12:05 arhimede

when you run composer install it asks

Please select which config file you wish to inject 'Laminas\Validator\ConfigProvider' into:

[0] Do not inject

[1] config/config.php

Make your selection (default is 1):

if you type 1 and hit enter or just hit enter (default is 1), then the config/config.php file is updated with 12 more ConfigProviders, but this is not needed

our installation steps (see readme under 'II. Installing DotKernel frontend using git clone') already have the below

the setup asks for configuration settings regarding injections (**type 0 and hit enter**) and a confirmation to use this setting for other packages (type y and hit enter)

should we update the installation section to make this step more clear?

bidi47 avatar May 07 '24 09:05 bidi47

the injection issue is discussed in threads like these https://github.com/laminas/laminas-component-installer/issues/1 https://github.com/zendframework/zend-component-installer/issues/51 it looks like the default is likely to remain 1 which injects the ConfigProviders

bidi47 avatar May 07 '24 12:05 bidi47

in the DK frontend documentation, it says :

https://github.com/dotkernel/frontend?tab=readme-ov-file#i-installing-dotkernel-frontend-using-composer

 Make your selection (default is 0):

arhimede avatar May 13 '24 18:05 arhimede

It says default is 0 since the beginning of the Frontend repo (April, 2020). At that time it probably was defaulting to 0 in https://github.com/laminas/laminas-component-installer/blob/3.5.x/src/ComponentInstaller.php#L534

Assuming that laminas-component-installer always finds our config/config.php file, the correct text is:

Make your selection (default is 1):

because their code here does the following check:

        // Default to first discovered option; index 0 is always "Do not inject"
        $default   = $options->count() > 1 ? 1 : 0;

if they see our config/config.php, $options->count() should always be > 1 => $default is set to 1.

alexmerlin avatar May 14 '24 05:05 alexmerlin

modified readme.md in both frontend and admin to state that the default values is 1, not 0

arhimede avatar May 14 '24 09:05 arhimede