mdsupport wrote on Saturday, January 25, 2014:
This is in response to Brady’s request for alternative mechanisms -
We think deployment of zf2 or any other framework should be treated as primarily refactoring project while allowing concurrent deployment of new features using framework features exclusively (‘pure’ modules). In practical terms :
phase 1: Objective - Establish platform that supports concurrent operation of framework based code and legacy code
Establish zf2 application under https://emrserver/some_zf2_basedir and few mod_rewrite rules route https://emrserver/openemr requests to legacy code but https://emrserver// traffic is routed to zf2 module. Initial base module view could be as simple as a ‘Coming Soon’ display.
phase 2: Objective - Establish common services for new modules
Using globals established by legacy login, enable a base module that others can depend on to provide common services such as db link to openemr database, logging, mail, menus, debuggers etc…
phase 3: Objective - Refactor / New development
Refactor base modules code and other legacy code as modules or create completely new modules using services of other modules. This phase could talke considerable amount of time. Care is needed during this phase that modifications to legacy code use ajax/json to invoke new features.
phase 4: Objective - Discountinue legacy
When all desired functionality of the legacy codebase is available as pure modules, change mod_rewrite and eliminate legacy code.
When we had tried few approaches around time of zf2 release, we had working prototype of phase 1. It can be created with few command lines and edit of apache config in 10-15 minutes. If anyone is interested we can share that. However hard and crucial aspect of the process is designing common services as they need to implement same or better functionality but use the framework provided components. Consider logger - while it is tempting to write a record to a table, zf2 approach is to invoke logger/db which brings in logger. Logger then allows output to Firebug and/or console etc. Logger can be tied to events so the application can record the context of the database update as well.