Well, a busy week. So, the bad news first: no release before Christmas! I know I said it would happen, but there is just so much time.
On the other hand I did get some stuff done. The forum continues to be a source of inspiration and discussion and that is great. One of the results of those discussions is an experimental haml plugin that I just checked in.
It’s far from being perfect, but it works.
Also, I refactored the code from init.php and store.php, although not all is used yet. However, it allows to use the mvc code standalone, without any zen cart stuff involved. Pretty much all that is still missing is session handling and then the mvc code is ready to be used for *any* application! (I am sure there are still hidden dependencies, but nothing major).
If you are interested in the templating discussion please have a look at haml and voice your preference…
Happy Christmas or whatever you may celebrate this weekend.
I’ve been through the Visions page on the wiki to cross out some things and I noticed that quite a few things that are currently hot topics on the forum are actually in there! Some perhaps in slightly different wording, but nevertheless!
Obviously, some of the things for 0.9.9 are in there too.
Still, I need new glasses I think…
Today I reached a milestone in my pursuit of trying to make the ZenMagick MVC code more generic. The ultimate aim is to be able to use it as generic framework for any PHP web application.
With the last check-in, just a few minutes ago, it is now possible to browse to this URL inside the zenmagick folder:
zenmagick/apps/sample/web/index.php and see the text ‘Hello world!‘
Actually, you’ll see the line twice. This is due to some incompatibilities between the file layout of the sample app and the current storefront code. Eventually this should be fixed by moving the storefront code around one more time!
However, that is not that important. The good news is that I now can work on the core and mvc packages without any side-effect from storefront code. Also, this exercise allowed me to find and fix quite a few more dependencies on storefront code that still existed in core and mvc.
Instead of waiting until the last minute I’ve started rather early with the release notes for 0.9.8. I do hope this reflects in the quality (eventually).
So far this makes up for some impressive reading, IMHO. One indicator that the pace has increased is the fact that I do not have the usual release blues. What’s that, you ask?
Well, usually it gets to a point where I am not motivated to add anything else any more (because I run out of things to do?). Then nothing happens for a week or two and after that I just write the release notes and build a release.
Not so this time! However, having promised a Christmas release I do have to restrain myself and leave some time for (hopefully) enough testing. I did have some hope that the snapshots would help with that, but no luck so far. I am sure this will happen over time, though.
(To be fair: all this means is that I haven’t received any feedback on snapshots so far. Given that I found and fixed a few bugs in the meantime could mean that I do test more than I think or that others do test even less!)
Either way, the release will happen and that is good.
I finally managed to repair the database and get the wiki running again. Should there be still issues, please let me know.
Seeing that I am too tired to do anything else I figured I might as well write my weekly update a bit sooner (for a change!).
Although, I have to say it really feels like Thursday…
Anyway, so what have I done?
I added spyc, a YAML library to be used for future and existing configuration files. Perhaps I should say configuration data, because the url mappings, etc haven’t been in a configuration file, but wrapped in a function!
So, url and sacs mappings are converted, including refactoring of the url mapper as a bonus! More to come.
I have to say it’s an easy exercise, mostly because you can also dump arrays as YAML, so dumping existing internal array structures in YAML allows to convert things in minutes, provided there isn’t anything else to change in the structures.
- Full release build
Main thing here was that the build process will move the extras folder into install_zc, so it is more likely to be removed or at least inaccessible than now.
Converted a few more plugins, which lead to further refinements in the way plugins use the MVC code. I think I’ve got working examples for all possible combinations now!
I fixed heaps of stuff, mostly things I broke on the way. However, there have been a few things that must have been broken since 0.9.7, so I am not sure about the amount of thrashing the snapshots actually get…
On request of a certain person I wrote a new plugin, including some small changes to view code to allow to map arbitrary contents to HTML comments (if they follow a given syntax). There is no UI, so usability is limited so far. I hope that is going to change soon (wink, wink).
Well, converting all ZenMagick admin pages to using the MVC code felt so good, I decided to see what happens if I just take any existing zen cart admin file (I took
customers.php, btw) and try to convert that into a view template (although keeping all the logic in the file for now).
Turns out that is really really easy! Just remove all common HTML like the <head> section, the common footer code (including
application_bottom.php, etc.), add one or two global $db; and there you are – zen cart code served by the ZenMagick default admin controller!
Obviously there is more than that. Forms still point to the wrong URL and hidden
main_page elements will be needed for POST forms, but it’s a good start and it looks like it will pave the way to being able to change the default layout of the admin pages soonish.
Of course, all that is more than I wanted to put into this release, but why stop when it is so much fun
I’ll try to get a new snapshot uploaded tonight or the weekend as the latest. Unless there are major complains that code will be the promised Christmas release.
There have been a couple people asking about using different template formats. So far ZenMagick uses plain PHP files as templates. There has been a smarty plugin (currently unmaintained) for a long time, but that never took off.
I guess the main issue is that it is all good and well offering support for different templating engines (and it wouldn’t be too hard). However, there is the question of maintaining separate a default theme for each template system.
Anyway, seeing that there is currently some discussion about templating, I think it would be just fair to get some feedback on using a template engine as default.
Candidates could be:
I’ve refactored the url mapping code and also added code to load YAML formatted mappings. This is working great and beside the fazt that the default mappings are now in a config file and not a function the new mapping is a lot more efficient and fixes a couple bugs/limitations as well!
Other places where YAML could/should be used:
- default sacs mappings
- database mappings
- other suggestions?
The wiki is currently unavailable due to some database issues. Unfortunately, I can’t login to the management panel as the ISP decided to blacklist my IP!
I’ll write a update once things are back to normal. Sorry for any trouble this should cause.
… yes, YAML to the rescue!
A while ago I was asking for alternative config file formats. I finally seem to have found a strong candidate: YAML!
It’s readable, flexible, supports hierarchical structures and best of all there are pure PHP parsers available!
I’ve picked spyc for some experiments and, in fact, already added that to the repository! spyc seems a very active project and does have good speed.
As a quick test I wrote some debug code to dump the url mappings as YAML. Then, I modified the url mapper to load that mapping using spyc rather than using it’s own mappings. And – voila! It works!
Now I can work on the YAML formatted mappings without having to create nested arrays or anything – what a relief!