-
Notifications
You must be signed in to change notification settings - Fork 195
Development mode #412
Comments
If you are using the standard
It might be as easy as adding an array key in
and add your logic right into the |
I have a proposal which is included in this PR (modular expressive skeleton - for version 1.1) Basically it requires the following in your composer.json file "require-dev": {
"zfcampus/zf-development-mode": "^3.1"
},
"scripts": {
"development-disable": "zf-development-mode disable",
"development-enable": "zf-development-mode enable",
"development-status": "zf-development-mode status",
"post-create-project-cmd": ["@development-enable"]
}
} Dependency is the PR for zf-development-mode package - probably for version 3.1 I'm thinking also for maintenance mode of the application, meaning you temporarily disable the functionality while deploying a new version or adding patches. But there are other techniques like using symbolic link using the version number of the app.
You can rollback your app but you need to manually handle also the database rollback if it's included in a certain release. Thus this caveat will only be applicable to certain type of organization - especially those who offer zero-downtime application. |
The The strategy proposed by @moderndeveloperllc looks good, from that logic "handling development middlewares" could be part of "best pratices" rather than being part of Expressive's features, what I think it's also a nice approach. My 2 cents: not neglecting the performance, a strategy with |
This feature is part of the upcoming zend-expressive-skeleton 2.0 featureset (via zendframework/zend-expressive-skeleton#54). |
Our app has some middlewares that are specific to the development environment.
In the past, with config-based pipeline we managed to pipe these middlewares only in development enviroment by placing their config in
local.php
file. But now with the programmatic pipeline approach I'm not sure what's the best way to pipe a middleware or route depending on the environment.I think we could add an
isDevelopmentMode()
method to theApplication
class that returns the value ofdebug
flag from config, so that we could pipe development middlewares like that:Thoughts?
The text was updated successfully, but these errors were encountered: