July 3, 2009

weekly update

Tags: , , , ,
Filed under: ZenMagick — DerManoMann @ 12:48 am

Another week and more progress! I’ve finally finished the first part of the big source reorganisation. The traditional core folder has disappeared and a new shiny lib folder is there instead.

There are still a few minor things to sort out, but apart from that all three main sub-folder core, mvc and store really separate things as one would expect from their name.
It should now be possible to use the files in core without anything else (not even Zen Cart!). The mvc code is build on top of core and, in turn, store (the ZenMagick store frontent code and API) on top of mvc!

Along the way I had t split up a few files. Some of the services had, so far, core and store features mixed and I’ve split those into a core (or mvc) part and custom implementations in store.
This led to interesting side effects. ZMPlugins now is a proper service again and in its basic version allows plugins without UI, etc. entirely configured via settings.

Another issue that I ran into was that core.php (compressing all code into a single stripped file) did not work any more. The most curious part here was that the loader was unable to find classes that were already loaded. As it turned out this was due to the fact that the lookup code only works correctly for classes resolved via the loader’s class path!

The fix for this also improved the general lookup code (less lookups) and also the internal caching. Another benefit is a much simpler version of ZMCoreCompressor.

A lot of the actual MVC code is still in store, as untangling that is only planned after a 1.0 release. However, I have this feeling that might keep working on this from time to time. With the new folder layout this is actually much easier and I can migrate file by file (some of the time at least) without having to move code into separate repositories where they just would get out of sync.

One other thing that changed during this process is that all settings in core and mvc changed and improved. In some cases things got simpler, in some more powerful. For instance, the getDatabase() method of ZMRuntime now accepts either a string or an array. The array parameter works as before, but the string lets you easily switch between different databases looked up via different settings. The setting value can be either an array or query style string.

For example, ZMRuntime::getDatabase('test'); would return an ZMDatabase instance configured with values found under the setttings ‘zenmagick.core.database.connections.test.

The last week also saw a number of updates and fixes to some plugins, so things are starting to look good… As always, the changelog lists all the details for those interested.

No Comments

No comments yet.

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.