aFramework 4.0 a.k.a. SleekPHP
Published Wednesday 21st of April 2010
As usual when I've finished building 5 or 6 sites and ~80 modules for one version of aFramework I want to start the next, non-backwards-compatible, version of it :P

This year is no different and I've begun development on aFramework 4.0 or Sleek 0.1.
I'm not sure about the name SleekPHP (or just Sleek) but I feel aFramework is a little too generic and I want a change. Any suggestions are welcome! :)
What's new in this version is that I've really tried to focus on writing best practice OOP. I've obviously learnt quite a bit from writing 3 versions of aFramework and I recently read some really good MVC-articles that got me excited enough to begin development.
The "best practice OOP" bit means that there are (almost) no static classes in 4.0, also almost everything is a class (the running site, the current controller etc are all classes with handy functionality) as opposed to 3.0 where there was no programmatic representation of either the site nor the controllers. Since no classes are static it means I can also finally take advantage of inheritance, thus all the module classes now extend the Module class which comes with some neat functionality.
Another completely new feature is that of plugins. Thanks to a really simple Events-class code can now be inserted at certain points in the execution of the framework. I've started by moving the HTML packing (which was built into the core of 3.0) into a plugin. A plugin is nothing more than a function that gets triggered at some point in the code. Sometimes data is passed to it, sometimes it returns data and sometimes it may just do something on its own.
Another new thing is that the actual Sleek Core will be just that, nothing but Core. Unlike aFramework Sleek itself will not come with any modules, only the ability to run modules built by others. I will, however, convert all the old sites to Sleek but I will probably put them on a different repo. Same goes for my personal projects - people who svn co the framework shouldn't need to get all my personal projects as well :P
There's still shit loads of work to be done. I'm rewriting the Router and CSSCompressor from scratch and adding loads of features and then I of course, as usual, have to rewrite all the modules for aBlog, aCMS, aDynAdmin and all the other sites that are already finished for 3.0.
If you want to check it out, head over to Google Code. You can also follow the development on sleek.a-framework.org
I'm still travelling btw. We're in Vietnam at the moment. Should be in Cambodia by the 25th or so.
Laters
- Tags
- Comments
- 2 comments
Comments
Published Friday 23rd of April 2010
The link to Google Code should be http://code.google.com/p/sleek-php/.
How would the boiler-plate code look in SleekPHP vs aFramework?
Published Saturday 24th of April 2010
@Erik - thanks for catching that :)
They're actually very similar. The big difference though is that all the classes that used to be static (DB, Router, Lang, Config etc - basically any class that would be accessed "globally" - is now not static) and another pretty big difference is that I've created a Controller class that handles the XML-controllers.
Before the aFramework-class would parse the XML-files and run/fetch all the modules. Now that's the Controller-class' job.
If you check out the Sleek Class (url) you'll probably get a pretty good overview of the flow of the framework.