 | News Feed |
Sections
|
| feed this: |  |
Ibuildings Blog: Dependency Injection and Zend Framework Controllers
by Chris Cornutt July 28, 2008 @ 08:47:40
Ian Barber has written up a look at dependency injection as a part of the Zend Framework's controller functionality for the Ibuildings blog.
Among the standard object oriented principles is favouring composition over inheritance, and there are plenty of design patterns that work along this line. However, one of the most useful day-to-day facets of the idea doesn't seem to get a lot of attention from PHP developers, namely dependency injection.
The general idea is, that if your class depends on some other object, that object should be passed in rather than generated internally or retrieved via a global variable or singleton.
He shares few ideas on how you can use this method in the controller of a Zend Framework including the use of the Zend Registry and an Action Helper. Code snips are provided for reach to show you how it'd be done.
voice your opinion now!
dependency injection zendframework application controller
PHPBuilder.com: Validating PHP User Sessions
by Chris Cornutt April 07, 2008 @ 11:12:33
On PHPBuilder.com, there's a new tutorial about validating user sessions - ensuring that data in your user's sessions is valid and isn't an attack trying to sneak in.
In a nutshell, sessions are the way that we "maintain state" from one page to the next, that is, how we identify specific users across multiple page requests. The ability to track users as they go from one page to the next using sessions allows us a number of options, such as tracking where they are going (web statistics) or to verify credentials for a specific section of the site.
First, there's a little mini-intro to sessions for those unsure on their use. It's followed by a look at some session vulnerabilities that could be introduces by malicious users looking to break things on your site (including HTML/Javascript injection, as their example shows).
They recommend a three step plan to get started with the validation of your user's sessions - making it easy for users to log out when they want to, use unique aspects of the remote machine to define the session and to validate all user input, especially things that will be put into a session variable.
voice your opinion now!
tutorial session security tip vulnerabilities injection validate
Paul Jones' Blog: Sending Mail with Solar
by Chris Cornutt July 18, 2007 @ 13:48:00
Paul Jones has posted a new tutorial about using the mail functionality of the Solar framework - the Solar_Mail and Solar_Stmp packages.
While each of these [PEAR Mail, PhpMailer, SwiftMailer, Zend_Mail] will work with Solar, the new Solar_Mail and Solar_Smtp packages work "natively", in that they support automatic configuration, locale and exception inheritance, and so on. Read on for some examples on how to use them.
In his example he sets up and sends a simple message, setting the contents of the email (sent as an HTML message). Since there's been much talk about the safety of a lot of the mailing systems in frameworks, Paul talks about how it's been secured from header injections, through safe attachments, and from a transport dependency-injection for SMTP.
There's even a method included that lets you take the SMTP information out of the script and put it into the Solar configuration file to use in the entire application.
voice your opinion now!
mail solar framework tutorial attachment header injection transport dependency mail solar framework tutorial attachment header injection transport dependency
Templora.com: Basic PHP Script Security
by Chris Cornutt December 28, 2006 @ 15:49:05
As mentioned on Digg, there's a very simple guide to securing your PHP applications - or at least taking steps towards that.
For the purpose of this tutorial we have listed some commonly known attacks, and how to protect against them. This is crucial for beginners in PHP because PHP tutorials and basic documentation does not accentuate this problem enough. Examples are given that are vulnerable to attacks, and students are either not aware of the vulnerabilities, or are not adequately educated how to protect their scripts.
They topics they look at are SQL injections, XSS attacks, CSRF attacks, and PHP variable insertion. They talk talk about one of the best things you can do to help secure your site and its data - input filtering.
If you've been paying attention at all to the buzz in the PHP community lately, you'll know that articles like this are nothing new. These are the same things other developers are commenting on as well. It is good to see it get more exposure via digg though...
voice your opinion now!
basic security xss csrf attack injection sql input filter basic security xss csrf attack injection sql input filter
|
Community Events
Don't see your event here? Let us know!
|