dotkernel / api

DotKernel's PSR-7 REST style API built around the Mezzio API skeleton.
https://docs.dotkernel.org/api-documentation/
MIT License
26 stars 4 forks source link

enabling development mode #204

Closed arhimede closed 9 months ago

arhimede commented 9 months ago

how to enable development mode ?

the command liste here https://github.com/dotkernel/api#step-3-development-mode is not working

composer development-status

@OnitaAndrei

alexmerlin commented 9 months ago

Please explain this:

is not working

Does it throw an error (ex: laminas-development-mode: command not found)? Does is say that development mode is already enabled/disabled, even though it isn't? How did you composer install the project dependencies? With/without the --no-dev option?

arhimede commented 9 months ago

1 server with Plesk , where the command:

#!/usr/bin/env php is invalid AND is in production mode

composer development-status

laminas-development-mode status sh: line 1: laminas-development-mode: command not found Script laminas-development-mode status handling the development-status event returned with error code 127

arhimede commented 9 months ago

for a WSL2 container, in dev mode, the same command return

composer development-status

laminas-development-mode status sh: line 1: laminas-development-mode: permission denied

alexmerlin commented 9 months ago

1 server with Plesk , where the command: #!/usr/bin/env php is invalid AND is in production mode

composer development-status

laminas-development-mode status sh: line 1: laminas-development-mode: command not found Script laminas-development-mode status handling the development-status event returned with error code 127

if you installed in prod mode (composer install --no-dev) then the package that provides the composer development-* commands (laminas/laminas-development-mode) does not get installed. In this case, if you want to toggle development-mode, you need to reinstall composer dependencies without the --no-dev option.

alexmerlin commented 9 months ago

for a WSL2 container, in dev mode, the same command return

composer development-status

laminas-development-mode status sh: line 1: laminas-development-mode: permission denied

Is the project up-to-date? This is a permission issue. Did you install the project in the recommened location? (/var/www/your-project-here/html) What user were the vendor/ files and composer.lock created? I just tested on WSL the latest version of the API, installed dependencies using composer install in dev mode (without the --no-dev option) and all composer development-* commands work.

[merlin@excalibur:/var/www/api.dotkernel.local/html]$ composer development-status
> laminas-development-mode status
Development mode is ENABLED
[merlin@excalibur:/var/www/api.dotkernel.local/html]$ composer development-enable
> laminas-development-mode enable
Already in development mode!
[merlin@excalibur:/var/www/api.dotkernel.local/html]$ composer development-disable
> laminas-development-mode disable
Development mode is now disabled.