Page 1 of 1

Please critique my PHP framework: CodeFrame

Posted: Wed Jun 17, 2009 3:30 am
by codeframe
Hello,

I would like to know what people here think about a framework I wrote.

http://www.majgaj.com/codeframe

This project was born some time ago and now I got inspiration to continue on this. Please have a look at the project and tell me your thoughts on it.

Thanks!

Re: Please critique my PHP framework: CodeFrame

Posted: Wed Jun 17, 2009 3:38 am
by onion2k
The documentation isn't complete. How can anyone evaluate it?

Also...

Code: Select all

<?= $this->content ?>
Seriously?

Re: Please critique my PHP framework: CodeFrame

Posted: Wed Jun 17, 2009 3:42 am
by codeframe
onion2k wrote:The documentation isn't complete. How can anyone evaluate it?
Evaluation can be done by downloading the source. As this is 0.xxx release I'm not putting effort into detailed documentation. And also by actually reading what is written in the documentation pages that are currently available. By looking at the access logs, you spent about 3 seconds per page.
onion2k wrote: Also...

Code: Select all

<?= $this->content ?>
Seriously?
And you are saying?

Re: Please critique my PHP framework: CodeFrame

Posted: Wed Jun 17, 2009 3:57 am
by onion2k
codeframe wrote:
onion2k wrote: Also...

Code: Select all

<?= $this->content ?>
Seriously?
And you are saying?
Short tags and the shortcut "=" echo are both very bad practise in PHP development*. The php.ini short_open_tag directive needs to be switched on for them to work, which, in any properly configured environment, won't be the case. And finally, short tags won't be in PHP 6.

* Arguably Zend's push to use "PHP as a template" encourages them, as does CodeIgniter's template system, but both of those frameworks have a system to expand them out. Your framework doesn't (at least, not according to the documentation).

Re: Please critique my PHP framework: CodeFrame

Posted: Wed Jun 17, 2009 4:12 am
by codeframe
Well, replacing <?= with <?php echo is not a tremendous amount of work done if it bother someone. Some like the short tags and some don't.

Its a matter of preference I think until we get to PHP 6.

Re: Please critique my PHP framework: CodeFrame

Posted: Wed Jun 17, 2009 4:23 am
by onion2k
codeframe wrote:Its a matter of preference I think until we get to PHP 6.
Well, true, but if I were to run the default template you've included with your framework on my server here it'd fail (it'd output the raw PHP text). No problem for me because I've been writing PHP for over a decade but a new user wouldn't immediately understand what's wrong and would be confused by it.

If you're writing libraries and frameworks they need to work with the minimum of configuration especially for new users.

Re: Please critique my PHP framework: CodeFrame

Posted: Wed Jun 17, 2009 4:32 am
by codeframe
Thanks for your reply. You are correct, the framework should work with minimal server configuration. I never thought about this as I have never stumbled upon a server in which the short tags are disabled, not even at my work.

I will make the changes in the next release.

Re: Please critique my PHP framework: CodeFrame

Posted: Wed Jun 17, 2009 5:04 am
by codeframe
I created a Subversion repository in Google Codes, so that people can look at the source code before downloading.

http://code.google.com/p/codeframe/sour ... #svn/trunk

Re: Please critique my PHP framework: CodeFrame

Posted: Tue Jun 23, 2009 10:13 am
by Benjamin
codeframe wrote:Well, replacing <?= with <?php echo is not a tremendous amount of work done if it bother someone. Some like the short tags and some don't.

Its a matter of preference I think until we get to PHP 6.
Not so much. You'll get parse errors in XML files.

Re: Please critique my PHP framework: CodeFrame

Posted: Tue Jun 23, 2009 11:32 am
by onion2k
astions wrote:
codeframe wrote:Well, replacing <?= with <?php echo is not a tremendous amount of work done if it bother someone. Some like the short tags and some don't.

Its a matter of preference I think until we get to PHP 6.
Not so much. You'll get parse errors in XML files.
That's not wrong, obviously, and I've seen it as an argument against short tags many times, but I've never quite worked out why you'd be putting PHP source code through an XML parser in the first place so it's a bit redundant really. Right?

Re: Please critique my PHP framework: CodeFrame

Posted: Tue Jun 23, 2009 1:04 pm
by Christopher
Seems like a fine super minimal framework. It's really more a simple Front Controller and a few utility classes.

As for <?= vs <?php echo, why ever use <?= when it is not supported everywhere, its is going away, and it provides minimal/no benefits. I don't even find it more readable because I am used to looking for <?php echo.