FrameWorks 2.0
If nothing else, I'm learning a lot about practical programming through this project.
The original backbone, FrameWorks 1.0CI, had more bugs than your average Microsoft release, and was about as useful as anything before Service Pack 2. It couldn't do much of anything, except handle user authentication and basic data access. The "CI" part of the version also meant it had been rewritten for PHP4, and lost a lot of its performance.
The first part of the new version, FrameWorks 2.0, was the Calendar object, an abstraction of basic calendar functions, which I talked about in the last post. Calendar is currently in version 1.1.2, but I'm hard at work on version 1.2.
The Calendar object caused me to build a Math object, which is nothing but a bunch of static functions (I love PHP5) to do basic math that PHP doesn't have built in, like a true modulo function. Math basically augments versions every time I find a new function it needs.
I also created my own exception class, called Error. Currently in version 1.0.1, Error simply cleans up the messages created by the built in Exception class.
The next big project was a template parser, called, simply, Parser. Parser is like a slimmed down version of Smarty. It's missing some of the big features, mostly because it works much differently. Smarty, for instance, compiles templates into workable PHP code. It then caches these compiled files. It doesn't have true page-caching. Parser, on the other hand, doesn't compile templates, so it can't cache them, so, summarily, it has no caching system (yet). Since all the pages are dynamic, I'm not too worried about this, either.
Parser 0.1-1.0 involved a built-in Menu system, which would create automatic variables known to fill in a menu and submenu. Parser 1.1 ditched this (retrospectively dumb) idea for two much more powerful implementations: template inclusion and basic boolean logic. This pretty much eliminated the need for a difficult-to-implement menu system anyway. Now it's much easier to just create a "menu.htm" template with various if/then statements to decide which link to highlight or whatever.
Parser also uses an internal object called Translator. This is my first real stab at multiple language support. Language files just have an associative array with the text label and translation. This will let the new version of the OTS support users native languages. And through the Translator, the Parser can interact with the Calendar to change the language and date formats there, too.
Also new is an RSSFeed object, which will be able to automatically generate RSS feeds (either static files, like through cron or publishing script, or dynamic through another script). The idea for the OTS is that users will be able to subscribe to a feed with their next 10 appointments or something.
Finally, major updates are planned for both the DB and User classes, which should both be in a functional 2.0 by the end of the week.
Labels: FrameWorks

0 Comments:
Post a Comment
<< Home