friends-of-presta / fop_console

Prestashop Module providing a set of shell/terminal commands for developers (PrestaShop 1.7.5+)
Academic Free License v3.0
84 stars 35 forks source link

fop:environment:setup-dev works fine on docker install. #221

Closed SebSept closed 2 years ago

SebSept commented 2 years ago

(new \PrestaShop\PrestaShop\Adapter\Debug\DebugMode())->enable() is supposed to return an int but it can also return null. I didn't search why but that's a fact.

To reproduce the problem, install PrestaShop with docker and can reproduce the issue. https://github.com/PrestaShop/docker/blob/master/base/config_files/defines_custom.inc.php Without docker, you can try with this setup (not tested) : when a defines_custom.inc.php file is present and the environment variable PS_DEV_MODE is set.

I also found that (new \PrestaShop\PrestaShop\Adapter\Debug\DebugMode())->isDebugModeEnabled() return an wrong value when using PS_DEV_MODE env variable. Define _PS_DEVMODE in config.inc.php to false and set PS_DEV_MODE=1, having a defines_custom.inc.php file. In this case, the shop runs in debug mode, but (new \PrestaShop\PrestaShop\Adapter\Debug\DebugMode())->isDebugModeEnabled() will return false. This behavior can be considered as a bug. I'll open an issue on PrestaShop.


SebSept commented 2 years ago

Yes, it's the same for fop:environment:debug We should add an issue, I forgot. And yes, we could maybe refactorize, but that's maybe not possible.

SebSept commented 2 years ago

Call another command isn't something we should encourage. It's better to have a (shared) service.

tom-combet commented 2 years ago

Ok LGTM! 👍

SebSept commented 2 years ago

issue created #225