Forums | Mahara Community
Switching template engines
25 November 2021, 14:47
With PHP8 coming up this is going to be something we have to do. Dwoo, the current engine, is out of support (actually abandoned) which means we would need to upgrade it ourselves and permanently support it going forward. Not an ideal option.
As the 'Replacing Smarty' (Dwoo is a fork of an old version of Smarty) idea mentions, this will be a breaking change in that every custom theme out there will no longer work.
What do people think of the following idea?
Create a mahara_template() that wraps the template engine.
Check a $config var for which template engine is in use.
- Process vars and files using the selected engine.
This would allow us to leave the existing system in place so existing sites, especially those with custom themes, just keep working. It would also allow us to add a new PHP8 compatible template engine alongside the existing one. The new templates can be converted in a less stressful manner. Once released new sites should be encouraged to use the new engine and it made very clear that the old engine should not be used on servers running PHP8. Sites wanting to upgrade to PHP8 will be able to run the same codebase while upgrading their custom themes, etc.
09 February 2022, 8:03
Just thinking about it... Step 2 should probably be "Check the theme config to determine which template engine it is built for."
22 February 2022, 9:58
This sounds like a really good way to manage the transition smoothly, causing the least disruption.