PHP News
Aug
16
Getting Started with the Fuel PHP Framework
A great new PHP framework has emerged and is gaining a respectable following after a short period of time. This tutorial takes you through installation, configuration, development, the template system and much more. If you are looking for a fresh new framework for your next project, be sure to check it out.
Fuel is a new PHP Framework built specifically for PHP 5.3, which uses the tried and tested MVC architecture for logical code separation and combines the best ideas of some existing frameworks with improvements and ideas of its own. A final v1.0 has only recently been released, but, already, the framework has a large following after nine months of heavy development. This article will get you up to speed on how to make sites with Fuel – but first, let’s talk a bit about the architecture.
Aug
12
Hardening PHP: SQL injection – Complete walkthrough
Krzysztof Kotowicz over at DZone has posted a very informative piece on securing your code when using SQL (MySQL, Oracle, MS SQL, etc) databases.
The materials teach how to use prepared statements, how to escape and write secure stored procedures. Many PHP projects are covered – PDO, Propel, Doctrine, Zend Framework and MDB2. Multiple gotchas and caveats are included. I discuss why escaping is usually the wrong choice, which practices to avoid or follow and how stored procedures sometimes offer no protection at all.
Aug
11
On Optimization in PHP
Anthony Ferrara posted an in-depth article on his blog that weighs in on the different viewpoints of code maintainability versus performance. This is quite a good read… go check it out.
When it comes to optimization, there are two competing viewpoints in the PHP community. Some say that optimization should only ever be an after thought and to avoid premature optimization at all costs. Others will say that this is impractical, and you should make your application fast as you write it, since then you won’t have to go back and clean it up to make it faster. While I can understand the viewpoints of both sides, I am firmly in the former category. Given the number of discussions that I’ve had as of late on the topic, I’ve decided to write a post as to why I believe my viewpoint is better and more sustainable in the long run.
Aug
11
Smarty PHP Template Engine: Building PHP Apps
Over at PHPBuilder they have posted a quick tutorial on how to get started with the Smarty PHP Template Engine and a sample ‘Hello World’ application.
Smarty is a template engine for PHP whose main goal is to facilitate a very useful way to separate the business logic from the presentation logic. This article introduces Smarty and demonstrates how to install the template, create an application from scratch and interact with a database.


