In this new post, Chris Hartjes takes a look at something that is one of the banes of most programmers' existence - documentation. In it he wonders what should really be considered documentation and the importance of it.
As a committed user of open source technologies, the difference between me using something and not using something is the documentation. Is there documentation for it? Is it easy to find? Does it answer my questions? Is there someone I can call an idiot if I disagree with the level of documentation? These are all very important questions.
He uses the illustration of the documentation of the CakePHP framework that's helpful, but only really after you learn how to use the framework in the first place. He mentions people on both sides of the fence - those that love the framework and love the documentation and those that moved on to something simpler because they just couldn't get it.
He also mentions the variety of sources that can provide "documentation" for the framework when you're getting a bit stuck - everything from blogs to The Bakery to a different sort of documentation, unit test.
In this new posting from Xaprb's blog today, there's a look at four different types of database abstraction layers, each with their own unique strengths.
Quite a few people have chimed in on a recent discussion about PHP, MySQL, database abstraction layers, and performance. I think enough viewpoints have been covered that I don't need to comment, but one question I don't see answered is "what are the qualities of a good SQL abstraction layer?" I think it's a very interesting - and complicated - question. As it turns out, the term has several meanings, and I think it's important to understand them.
The four types he lists are:
Libraries that provide access to a database
Libraries that present a common interface to different server software
Libraries that write portable SQL
Object-relational mapping software
Each has their own description and example packages that show the strength. Following these notes, he shares some opinions on each, mentioning his likes and dislikes about the state of support for them.
On PHPBuilder.com today, there's a new tutorial that looks at a method to protect your PHP applications with the filters the Open Web Application Security Project provides.
OWASP (Open Web Application Security Project ) released a top ten list for web application security vulnerabilities in 2003 and 2004; you can find the latest information about their Top Ten Project here.
Most of the top ten vulnerabilities including (A1) Unvalidated Input, (A2) Broken Access Control, (A4) Cross Site Scripting (XSS) Flaws, and (A6) Injection Flaws, can be avoided by using these filters.
They walk through the installation before talking about the types of filters at your disposal - paranoid, SQL, system, HTML, int/float, UTF-8, and LDAP. The check() function looks at the inputted value to see if it passes the test (the other option the function takes).
They also give an example of combining filters as well, making more secure validation even easier.
In fact it's less about error codes / exceptions and more about what you do when something does go wrong-how to you "bail out" of the mess you're in?
There's a few different error handling types that Damienmentions
, including the "Get the Hell Out of Dodge" Error Handling, "Reverse the Flow of Time" Error Handling, and "Plan B" Error Handling as well as some suggestions to help you and your code cope.
After having his MyBic PHP/Ajax framework, Jim Plush has decided to use some of this popularity to drive some charitable work for some underprivileged kids at a school that it wife works with. He specifically mentions some with more technology-related needs, such as a specialized left-handed keyboard.
So, how can I help, you ask yourself sitting there behind your keyboard? Well, it's simple, really - Jim has set up a CafePress shop with some great t-shirts for purchase - and 100% of the funds made from the shirts will go right back to the kids at the school.
Justin Silverton has posted this brief overview of the patTemplate system - what it is and how it can be used in your site.
patTemplate is a set of classes that allow you to separate your php code from design/output, making your code easier to maintain. To identify a certain part of the page as a template, patTemplate uses XML tags to assign a template a unique name and a various attributes (see patTemplate Tags and attributes for a list of all tags and attributes). When parsing a template, the parser divides the page in several chunks and treats them as separate templates. By using patTemplate's API you can hide, display or repeat a certain template.
He describes the different template types (OddEven, Condition, SimpleCondition) and how to use variables inside the templates. He wraps it up with a quick installation overview, both using PEAR and the manual installation.
DevShed has posted the last article in their "Enforcing Object Types in PHP" series today - "Using the Type Hinting Feature in PHP5".
[Returning] to the subject of this last tutorial, I'll introduce another method for enforcing object types in PHP 5: the "Type Hinting" feature. It can also be used in conjunction with the "instanceof" operator that you learned about before, in order to develop PHP applications that implement thorough routines for filtering unwanted objects. Generally speaking, when you finish reading this article, you should be armed with a few more methods for forcing object types in PHP, in this way expanding your overall knowledge of object-oriented programming.
They start with an introduction to type hinting and some basic examples of its use. From there, they build up a relevant example with the help of their (X)HTML widget class they've used throughout the series.
Richard Heyes has posted two updates about new features of the XML-RPC library that he's been developing.
In this post he mentions the updates he's made to allow the class to send aggregate types (arrays, objects, etc) as well as the ability to use standard HTTP authentication.
He also notes (in this post) he added the ability, via a javascript library, to handle the unserializing of the PHP pulled from the remote server.
For more in formation about the class, you can check out his detailed page...
DevShed is continuing their "Enforcing Object Types in PHP" series with this new tutorial today. This time, they're focusing mor eon the use of the instanceof operator in PHP5.
This three-part series goes through the basic concepts of object type enforcement in PHP 4/PHP 5. It explores different approaches for checking types of objects to help you avoid possible code contamination when objects of incorrect type are inputted within PHP classes.
The end result of this article hopefully will help you to expand your grounding in how to implement object type enforcement in PHP 5, by developing some illustrative, object-oriented examples.
They start with a look at how not to do the object checking but provide a solution to the situation with the help of the instanceof operator. They explain its usage in the context of the widget class they've created, and show you how it can be integrated easily to simplify object validation.
In this latest tutorial on DevShed today, they look at methods to enforce the types of objects in a PHP4 environment.
When you are writing an object-based web application in PHP, you want to prevent your classes from being convoluted with input objects of the incorrect type. These input objects can cause the application to throw a fatal error. In this article, you will learn how to enforce object types in PHP 4.
By the end of this series, hopefully you'll have a clear idea of how to force object types inside of your PHP application, in this way avoiding further problems related to the so-called code contamination.
They start off with the creation of an (X)HTML widgets class to render certain page elements. Then, they show you the creation of a class to render the page and display them in a full document. There are examples of what happens when type checking isn't done and how to enforce the types inside of your class.