The current ZenMagick release does suffer a bit from performance issues. Progress on this is tracked in issue 353.
There are a number of improvements that have already gone into the code that is going to be ZenMagick 0.9.14.
- Conversion of code into namespaces
This is a biggie, as using namespaces means we can slowly switch off folder scanning to find global classes. The biggest remaining block of code is the shared folder. I am reluctant to rush that bit, though, because the plan is to take the time to improve/refactor code at the same time.
- The view component has seen a major refactoring.
The main reason for this was that most of the Savant features had already been re-implemented in the view classes, so it seemed easier to port the last bit (the fetch() method) as well and drop Savant (and two levels in the stack traces) completely.
- Conversion of system config/container files to XML
All container config files that are shipped with ZenMagick are now in XML. According to the symfony docs this is the fastest alternative.
In addition to the above I managed last night to fix a regression that created excessive SQL updates against the configuration table. This has improved the SQL stats quite a bit.
Looking at the current (outdated) demo site I can see that in 0.9.11.1 the homepage used about 300 queries. The most recent code for 0.9.14 gets away with ~100.
Despite all this progress there is more to do. In particular the time spend in the view is not acceptable. Another potential issue are the zencart wrapper classes during checkout. Right now they take up just too much time.
Lots to do…
Christmas is approaching fast and it is time to prepare for the (traditional) ZenMagick Christmas release. We’ haven’t always managed, but always aimed for having one.
This year is no difference and things are looking promising.
I am sure we will have to push a few tasks into the next release, but that is more a matter of organizing issues. Some surely should be ‘meta’ issues and have subtasks. Alternatively, we could probably have an ‘ongoing’ target that never expires.
Regression fixing is well under way and there is even a store online that uses a RC version of 0.9.13. All good signs that the code is ready to be released.
Comments Off
Last week I updated the symfony2 commit we are using in ZenMagick. Unfortunately, there had been a few changes, in particular around event handling, that needed some larger surgery on ZenMagick code.
I’ve just pushed changes that should fix all of that. I am not sure the changes are final, though. Especially the EventDispatcher class is a bit more elaborate than needed, but for now things are good.
The biggest impact has been the reduction to a single dispatch() method to fire events. This, of course, affects the way event handler can modify data as part of the event handling. This is also fixed, so if you have custom code that injects/modifies the HTML, have a look at some of the core code to see how this is now done.
Also, I’ve taken the chance to change the change the ‘finalise_contents’ event to finalise_content’. Also, the key for the content in the event changed from ‘contents’ to ‘content’.
I’ve done some testing of events and the usual suspects (page stats, theme switcher, etc) do work. If there is anything broken, please let me know.
The code changes also require to re-install at least one file patch, so it would be a good idea to uninstall file patches before upgrading and re-apply those after the upgrade.
Comments Off
Time is flying when you are having fun, so in that respect is has been a very short week.
We’ve made lots of progress, so here’s a quick summary:
Infrastructure
- doctrine
Lots of work here – looks like it is almost ready to move into HEAD, at least to provide basic functionality.
- Settings
We do have a new Settings class that improves and extends the current ZMSettings code. It also now supports imports: – something also found in symfony config files.
Also, the reorganized setting of config files/locations now also supports environments. The environment can be controlled by:
- .htaccess
SetEnv ZM_ENVIRONMENT production
- front controller
index_devel.php?rid=… or index_test.php?rid=…
- define
define('ZM_ENVIRONMENT, 'test');
- Events
The event system has been upgraded too, building on and extending the symfony2 EventDispatcher.
- Bootstrap
The bootstrap code (bootstrap.php) has been slimmed down quite a bit and a few things have changed order to make more sense.
- ClassLoading
The currents system of auto loading static PHP code (per convention all .php files in the class path with a filename starting with a lower case letter) has been deprecated and removed from the bootstrap sequence and all other places (plugins/themes).
There are a few outstanding items that still need to be tackled for the next release, most importantly Dependency Injection. With the current core.php system already removed from the code base there is definite need to allow plugins and themes to customize core classes.
With the improved bootstrap and settings code the location of config files (and support of local.php, etc) have changed. This will require a little bit of work for theme and plugin authors. For the next release documentation should be ready to guide upgrades and changes.
Bugs
There are a number of bugs that have been fixed, most notably a bug in the zen-cart admin integration, removal of debug code and a couple of edge cases in the WordPress plugin.
Just a quick heads up that there has been a tremendous amount of work spend in the last week moving the project forwards. In particular there are about three major goals right now:
- Replace existing code with proven 3rd party libraries.
I am not saying to do things really that much different, however cleaning up the code-base and using tested code does help stability and perhaps even performance.
- Get the bootstrap code in shape so things are done in a sane, documented way people can rely upon.
This is a major task, as it requires a few basic components to be in place before this can be implemented properly. In particular the current ZMLoader code does prove to not play nicely in some edge cases.
- Get to a point where it makes sense to have a separate installer.
Apart from the above, there are quite a few more things that need to be done to glue things together. For example, there is already code to wrap new libraries and base code in phar files. However, there isn’t code yet to integrate that into the build process. So, right now a snapshot would be about 65MB due to the amount of code in submodules that is not required to run the application.
For people that want to stay up-to-date with what is happening, subscribing to the RSS feeds on dev.zenmagick.org is a good idea, and perhaps also watching the git repo.
Comments Off
Things are progressing nicely and the new base classes will be a lot cleaner that what there is right now. So far there is:
- class loading
- logging
- events
- some custom database related classes for doctrine
- a first draft of a new plugin service (very similar to the current, just with a bit streamlined and with support for the new class loading)
There is some initial documentation in the new wiki and also some design/RFC documents. Feedback would be very welcome. With more people looking at the code there are also more bugs found and inconsistencies fixed, so that is really starting to look good.
There has also been some good work on the admin UI design. rubikintegration.com have posted some very nice mockups…
Comments Off
The move towards PHP 5.3 has opened a lot of opportunities for using features and libraries that were, so far, not an option. So, consequently, most of my time since the release has been spend on evaluating options.
Some of the results of that process can be found in the ScratchPad. Right now a lot revolves around integrating code via git submodules and trying to get rid of the current system of pre-packaged 3rd party libraries. As an alternative there is already new code that can wrap up lots and lots of code in PHP phar files. Similar to the current core.php stuff, this is a seamless process, so if the .phar files exist they will be used, otherwise the file system will be queries for missing classes.
The new class loader code is already working nicely and is so much simpler than the current one. However, there will be a migration period, so the current ZMLoader will not disappear in the short term.
Since the current overloading system via the ‘ZM’ prefix won’t be supported for all PHP5.3 code (read namespaces), there is need for a replacement to allow themes and plugins to customize core code. In order to do that in a more mainstream fashion I am currently working on integrating the symfony2 dependency injection code. Right now this is beta, but I would expect that in time for the next ZenMagick release things should be stable.
So, bottom line is that there is a new batch of low level tasks to prepare ZenMagick for PHP5.3 and also to use even more 3rd party code.
Finally, observant people might have noticed that there is now a second developer with full access to the github repository. Things will start slowly and I will talk a bit more about that in the next few weeks. Still, welcome aboard, Johnny – I am looking forward to some interesting times
Well, as is usually the case, once a release is done it is time to start looking what lies ahead. We’ve made good progress on getting new infrastructure set up to organize the future development of ZenMagick. That is good for several reasons:
- It brings new people on board
- It will hopefully streamline development, which, in turn, will result in getting more done in less time
- Gives us a lot better integration of the various systems than what we’ve had so far with sourceforge (which might not actually be their fault, but could also be sloppy use of what they offer).
The next big step that we’ve taken with ZenMagick 0.9.11 is moving on to PHP 5.3. This gives us a range of great new options and also a much better choice of 3rd party libraries (like doctrine) to use.
There are a lot things we can do now, for example using proper namespaces, replacing the current core.php system with a few pre-build phar files and a lot more.
The obvious advantage of using existing libraries is that there is less code that we have to write and maintain. Ideally this will happen all within the framework, so regular users that are just concerned with templates should not have to worry.
Getting finally to a point where it becomes clear how things are going to work in the long run also means it is now time to start with some proper documentation. So far documentation was hard to do as things changed just too fast. Reminds me: if there is a good technical writer out there willing to help write some good documentation, please let us know!
Comments Off
ZenMagick 0.9.11 is released – finally!
It’s been a long release cycle with lots of interesting changes and I am very happy to finally have pushed this release into the wild. One thing I think I might have not mentioned before (it’s in the release notes, though) is that ZenMagick 0.9.11 (and all future releases) will require PHP5.3.
Of the changes the one I like most is definitely the integration of the zencart admin pages into the ZenMagick admin UI. it all started from a chat in the zenmagick chat room (xmpp) and some playing around with code. After that things were surprisingly easy and perhaps will be a good example of doing the same with storefront code (using ZM exclusively and loading zencart only where required).
Please be aware that there is a new bug tracker and more that we now use to coordinate development. There is, of course, also the forum for all questions that you may want to ask.
Comments Off
I am sorry to have to tell you that the next ZenMagick release 0.9.11 will be delayed until sometime in January 2011. It wasn’t an easy decision, but there is no way for a thorough release build and documentation before Christmas.
To be clear, there have been some last minute regression fixes, but nothing major. Its entirely to blame for me to be rather too optimistic about the spare time I would have in the last and current weeks.
So, Merry Christmas everyone – enjoy the break (if you happen to have one) and/or the snow (if you have some and don’t need to travel…)
Comments Off