Quote:
Originally Posted by ETbyrne
The '@' is there to prevent an error from $_SERER['PATH_INFO'] which, oddly, sometimes gives an error even whe it is present.
|
There should never be an error if it is present. However, if the value is not present a NOTICE will be raised and the define will assign NULL. If you are getting an error, is it repeatable and under what circumstances does it occur?
Quote:
Originally Posted by ETbyrne
PHP Code:
if(!empty($route[preg_replace('/^(\/)/','',$url)]))
Does not produce an E_NOTICE error.
|
Like isset, calling empty will not raise any NOTICE if the variable is not found.
Quote:
Originally Posted by ETbyrne
So, any thoughts on the the framework from a application developers perspective? Like, how controllers work, how you access views, ect...
|
I've only had a very brief look at the framework, mostly as a result of Kalle's post. Your method of gathering the request variables and pushing them through to a controller is odd (constructing a string for the arguments and evaling it.
Also, perhaps I'm missing something, but the only way to have any form of dynamic routes is you use what you call plugins? For example, how could one have "user/1" refer to (user.php) controller::index(1) or something more abstracted like "img/abc.jpg" refer to (images.php) controller::stream('abc', 'jpg')? The
Routes documentation doesn't make any mention of any more basic than straight substitution (mypage => mycontroller/func/argument).
Your requirement of loading MySQLi should be disabled by default. Not every application wants to always have access to a database and even if they did, not necessarily MySQL via the MySQLi extension.
Helpers: I'd like to see these namespaced (class-based... we can use "real" namespaces somewhere in the future). For example, you have the functions base_url, page_url, model_url and redirect; why not have these as url::base, url::page, url::model and url::redirect? The same can be said for cookie::set and cookie::delete (no cookie::get?).
You use short PHP tags in places, please go through and replace them will their full alternatives. You can't expect short_tags to be turned on by default, nor for people to turn them on just to support your framework.
Models: accessible by the URL? I'm not sure this should be the case, or even if it is they should always be routed through a router.
I think your whole section of index.php under "Detect Illegal Characters in URL" could do with some re-working. How you construct the regular expression doesn't result in what I think you think it does (confused yet?).
That's all, after a very quick look. I do look forward to having a really good delve into the whole framework soon though.
