News Feed
Sections




News Archive
feed this:

Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

DevShed:
Sub Classing Exceptions in PHP 5
October 15, 2008 @ 12:06:24

DevShed has start up a new series today with the first part in a four-part series looking at exception handling in PHP5.

If you do any serious programming, whether it's in PHP 5 or some other language, you've needed to know how to handle run time errors and other "exceptional" conditions. You can do this by making your program throw generic exceptions. Or you can unlock the potential of PHP 5 and learn how to create custom exceptions, which is the subject of this four-part series.

In this first part they get you started with exceptions, showing how to throw them and catch them correctly (try/catch). They put it to good use in an example catching exceptions thrown from a MySQL connection and select.

0 comments voice your opinion now!
php5 exception tutorial subclass try catch


DevShed:
Introducing the Chain of Responsibility Between PHP Objects
October 30, 2006 @ 12:18:00

DevShed is starting off a new series today with this first article talking about how to introduce the "chain of responsibility" method in how you use your objects.

In this three-part series, I'll show you how to create a chain of responsibility across different classes, which hopefully will give you a better understanding of how this schema can be implemented with PHP.

Since it's just the first part in the esries, they start with the whys and hows of the chain of command process before getting on with the actual code. For the foundation, they create some subclasses that will make the parts of the chain. Next up is combining them and, finally, making the "master class" to combine the links of the chain together. They use a "DataServer" example to work with local files.

0 comments voice your opinion now!
tutorial chain responsibility object process pattern subclass tutorial chain responsibility object process pattern subclass


DevShed:
Abstract Classes in PHP - Setting Up a Concrete Example
February 01, 2006 @ 07:54:08

DevShed has posted part two of their "Abstract Classes in PHP" series today, this time focusing on the creation of an example class structure.

Welcome to part two of the series "Abstract classes in PHP." In three tutorials, this series introduces the key concepts of abstract classes in PHP 4-PHP 5, and explores their application and use in different object-oriented development environments. Whether you're an experienced PHP developer wanting to fill in some gaps related to abstract classes, or only a beginner starting to taste the power of object-based programming in PHP, hopefully you'll find this series enjoyable and instructive.

They take a moment and look at how their example will be structured before jumping into the code. After that, they creat subclasses of the parent, defining the resultProcessor and fileProcessor classes. At the end, they combine them, creating a class that can parse data pushed into it (such as parsing out an XML file).

0 comments voice your opinion now!
abstract class set up concrete example subclass process data abstract class set up concrete example subclass process data



Community Events





Don't see your event here?
Let us know!


release testing code unittest language introduction refactor threedevsandamaybe developer series interview api laravel framework symfony2 install podcast list community opinion

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework