I’ve finally written some reasonably easy addition to the ZenMagick PHP templating engine that allows to set the crumbtrail (and other bits, if required) in the actual view.
This is something I’ve been struggling for a long time. The crumbtrail code has been a source of bending backwards and ugly code for a very long time.
Now, the view can just do something like:
$crumbtrail->addCrumb('Foo') and be done! As you might have spotted, the code in itself hasn’t changed at all. The only change in the templates so far has been to the layout file to use the new
fragment() method to ‘mark’ the place where to put the crumbtrail and then *after* the view has been included the marker is filled with whatever crumbtrail has been set up.
One nice thing is that right now the views do not anything, because the crumbtrail is set up by the controller classes. So, it will be possible to migrate each view individually by moving the crumbtrail code from the controller class to the view template – yay!
Probably nothing to get too excited about, but it has been a long time coming…
There are some big changes coming in ZenMagick. One of the big concerns was (and still is) the integration (or lack thereof) with zencart.
To pave the way for some real improvements for this there has been a huge amount of work to make things simpler, cleaner and faster.
Right now ZenMagick is integrated via a number of file patches and additional files (overrides) in storefront and admin. Last week we removed
- *all* of the remaining admin integration files
- the first batch of required file patches (replaced by one new file patch, though)
- the current storefront override file (
And, there is more to come.
This means for the next release/upgrade there will be some cleanup required to get rid of obsolete files. On the plus side – wait, that is already the plus side!
In the grand scheme of things this will mean faster request handling (more/no zencart code used for most of the time), less conflicts with zencart code and generally we expect a much more predictable behaviour.
Of course, with so many changes there are things to consider. For one thing, ZenMagick will, for the first time ship with custom versions of core zencart files. This means if those files are patched in your system right now, those changes will need to be applied in our version. OTOH, those files are mostly not the commonly modified files.
I will write up some more details once the dust has settled a bit…
To see the progress I am digging through the resolved issues and that list is slowly but steadily growing.
Right now there are about 7 issues left, although some might not get resolved for the next release.
One of the bigger issues is to upgrade ZenMagick to using the symfony routing component. This is not a small task and even after I thought I was finished with the component integration there was still plenty to do and improve.
Now all that is left to do is waiting for someone to donate a routing config file
So, what else is new?
- Plain object controller
Together with the routing integration there is now support to use any given class/method as controller. That means the method can be mapped to a request and there is no restriction to the proccess method any more.
This is in line with the way other frameworks do things and something people have been asking for quite some time
- Admin Store Status widget refactoring
The refactored code now allows plugins and other code that has access to the service container to register custom status checker to this widget. That means all important status checks can now be in a single consistent format/place.
- bootstrap refactoring
The files bootstrap.php and mvc.php are no longer supported and have been removed. The whole bootstrap/request handling process has been replaced by the zenmagick\base\Application and zenmagick\http\WebApplication classes.
This also allows to bootstrap individual components only, bootstrap without an application and more.
ZenMagick is now using .po files for translations, just like WordPress (in fact it uses the same code for handing .po and .mo files). Applications, themes and plugin now can contain translation files that will be merged during bootstrap.
Doctrine integration is progressing with some issues remaining that might only get fixed once we allow ZenMagick to control the request entirely, rather than run as a subsystem of zencart.
Some of the above changes have had widespread impact on the codebase, so upgrading has do be done with care.
In addition there is the ongoing work to migrate code to namespaces and generally improve the code (while doing that).
Next on the list of things are (in no particular order):
There is an (empty) store-installer application now in the repository. Not sure if there is enough time to get this going for the next release, but things are moving forward.
Paving the way for the stand alone installer is a new upgrade option. This will replace the current installation page and hopefully be even simpler.
I am sure there has been more, but the above seem to be the bigger tickets.