I don't mind looking at frameworks, regardless of license. It's not like I'm going to use your framework, basically for the same reasons you don't use others. But if I can steal an idea, it's worth my time.
Questions/Suggestions:
1) Why do you have the cron folder inside your your framework? Doesn't linux already provide a cron folder? Or is that where you store maintenance scripts? if the latter, I would rename that to make it more clear.
2) What the heck is $_KERNEL about? I see 2 problems with using that. One, $_ I think is reserved for built in PHP super globals so I would stay away (personally). Two, Kernel is a bit of a misnomer. I see kernel and I think it's somehow wrapping actual Kernel functions in PHP.
3) What or where is your boot strap? includes/core/init.php is your bootstrap? I see a kernel::get_instance() which I assume is your interpretation of a front controller? Seem's it's actually more than a front controller though, as the object returned also initializes your templates, etc??? index.php also calls a rendering function on the kernel object.
Personally I think your delegating to much work to one object. Seems like you have the KERNEL object acting as a master class which handles requests (front controller) views (view manager of sorts) template initializastion, etc. You have something of a super facade going on.
includes/core/fuctions.php
A lot of generic functions in there get, post, etc. I'd suggest switching over to a request object to keep things more OOP.
You also have some functions in there which generate FORM code. Personally I would store those functions in separate well named files for clarity. Anything that generates HTML in my own framework is done in a template, always. I think I have encountered one situation where I needed to actually output HTML in code that wasn't template based.
That file also has functions which would be best in a response object, but your redirect() has a dependency on KERNEL so you might have some serious refactoring/redesigning to do if you wanted a more pure OOP approach.
I like your pagination class, at least in how you avoid any HTML inside the actual class and essentially just have the class initialize some variables which can then be used by a template to generate the actual pager HTML. Although it seems to have a concrete dependency on DB object which is dependent on KERNEL.
The classes buffer, compiler...are they for templates?
dbconnection class is redundant. Why not use PDO and save yourself a tonne of time and increase efficiency?
I notice you have the following in every class:
Code: Select all
$this->kernel = kernel::get_instance();
two concerns:
1) You don't explicitly create the member variable and set it's access control modifier.
2) You do this in each and every class.
Although it became pretty clear, pretty quick that the $this->kernel was an dynamic/expando property I still prefer to see the access control modifier for explicitness and clarity. I'm not sure if the property can be accessed publically in these cases, but I rarely (if ever) allow properties to be publically accessible -- private or protected at best.
My biggest conern with your classes in the amount of coupling and dependencies. Although they are simple classes on their own, things get wildly complex once you start trying to peice togather how the work to form a complete system. The coupling would make it fragile to change and likely require a re-write in order to change anything drastically.
Your file structure is a little, well, typical. I hate redundancy.
I notice you have:
Code: Select all
includes/classes/{empty}
includes/core/classes/{files}
I can't stand when projects do that, just a personal beef I have. In my applications I strive for absolute clarity and simplicity. If I'm looking for a class I know I have only one directory to look under, etc.
Most of what I complain about isn't really important to the original developer, but for someone just coming onto a project, these are always my concerns.
I do like the fact that your directory tree isn't 25 levels deep, that is another pet peeve of mine.
One last beef. index.php it's so empty??? Personally I find that such a waste as that is the first place I start when I enter a new project. I find it irritating when it starts calling includes and a single function. Why not keep the include expanded inside index.php -- unless there is an overwhelming reason to keep it as a external include???
I'm still quite bothered by your KERNEL object. After reading your docs breifly, it seems now that it's almost acting as a registry, when you say:
The kernel allows you to easily call any class or method from anywhere in the code base
Sounds like a registry.
It will autoload classes located in includes/classes and includes/core/classes.
Now I'm thinking service locator.
What are event triggers all about? I didn't bother trying to figure those out. What purpose do they serve? Are they hooks to allow core customiztion without tinkering with core code? Did you borrow that idea from CodeIgnitor?
Off Topic: While I agree arborint sometimes sounds like a grumpy old man.

His devils advocate approach to answering questions is usually very helpful. I hate to say it (just teasing) but I don't think there is a single person on these boards who has taught me more about my own best practices than him. If not directly, indirectly by at least making me second guess myself and try something different and sometimes that results in something better.
I do agree with the sentiment, that you want people to look at your code probono but have not made it publically usable. On the flip side, I don't really think in your case (astions) a license is a big deal. It's not like anyone is going to run off and use your code, anymore than arborints framework, my framework, or anyone else's on here.
If anyone made a PHP framework private in that regard and attempted to sell it, I'd laugh as all frameworks have their sucky parts and good parts.
Now how about looking over my application and offering some opinions?
I appreciate your sharing your code with us, I learn something new each time I look at code.
Cheers
