PHP

Post Archives
Archive for the ‘PHP’ Category

PHP MVC Framework Performance – Part 1

April 8th, 2010 39 comments

As part of my assessment of PHP MVC Frameworks which I blogged about in Choosing the best PHP MVC Framework I decided to do a compare performance of the various PHP MVC Frameworks I was considering.  I did this using Apache Bench with ab -t 30 -c 10 http://testserver/framework/index.php as this is common and did the basic Hello World test where each framework just put out Hello World in an empty HTML document.  Here are the results…

Read more…

Categories: PHP MVC Frameworks Tags:

Why Yii Framework is better than Kohana PHP

April 7th, 2010 45 comments

Recently I’ve set out comparing and choosing the best PHP MVC Frameworks so that I could then decide if I’m going to use an existing framework or roll my own minified super-efficient framework, because most frameworks seem too bloated for my liking these days (and hence run poorly on shared hosting).  Two of the frameworks I short-listed were Yii Framework and Kohana PHP.  After spending considerable time playing around with both I’ve come to the conclusion that Yii Framework is better than Kohana PHP. Here’s why…

Read more…

Categories: PHP MVC Frameworks Tags:

PHP conditional include statement parsing

April 7th, 2010 1 comment

I’m writing some PHP and using include statements as is pretty common.  When using conditional includes in my code I wasn’t quite sure whether the content of the included file is included regardless and then ignored or is only included conditionally (which of course would be the better option from a memory consumption perspective and so on), so I set out to find some info about PHP conditional includes, but surprisingly it wasn’t so easy to find.

I’ve finally managed to come across this PHP Include article that confirm what I was hoping for and also something that I didn’t know.  Apparently when an include is conditional, the content won’t be included if the condition evaluates to false, while if you use a require the content will be included but will not execute.  The last statement seems a little weird since I would expect that if logic is used to work out the source for the require statement that source might not exectute because it’s inside the conditional block, but that may be the exception.

Anways, it’s good to know that files which are conditionally included won’t get parsed.

Categories: PHP Tags:

Choosing the best PHP MVC Framework – Part 1

April 6th, 2010 15 comments

So, perhaps like me you are writing a fair bit of PHP and building some serious PHP apps.  Perhaps like me you have also decided that re-inventing the wheel for every app you write doesn’t make much sense and PHP by itself isn’t quite at a high enough level to be considered a framework.  I mean PHP is nice and all and there are fast ways to do many things in PHP, but there are far too many ways to do things in PHP and all you need is just one that works.  So having come to this realisation you decide that what you need is a PHP MVC Framework.   Read more…

Categories: PHP MVC Frameworks Tags: