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

Dayle Rees:
Composer primer
Apr 15, 2013 @ 12:55:09

For those that might have heard about the Composer package management system for PHP but haven't had the time to get into it, you should definitely check out this great primer from Dayle Rees.

Composer is something special in the world of PHP. It has changed the way we handle application dependencies, and quelled the tears of many PHP developers. You see, in the olden days, when you wanted to build an application that relied on third party dependencies you would have to install them with PEAR or PECL. These two dependency managers both have a very limited set of outdated dependencies and have been a thorn in the side of PHP developers for a long time. [...] Enter composer, king of the package managers.

He jumps right in and gets into the configuration (the composer.json file) and using it to describe the package. He shows how to set up "required" resources complete with version number information. There's a bit about setting up autoloading and classmaps too. He then moves on to getting the tool installed and using the composer.json definition to load in needed packages (and development ones if needed).

tagged: composer package manager primer configuration usage

Link: http://daylerees.com/composer-primer

Michael Nitschinger's Blog:
A primer on PHP exceptions
May 23, 2012 @ 09:17:41

Michael Nitschinger has a new post focusing on one of the more commonly used, but maybe just as commonly misunderstood, part of PHP - exceptions and their handling. His latest post looks at what Exceptions in PHP have to offer and provides some "best practices" in their use.

Exceptions are and should be an integral part of any general purpose programming language. PHP introduced them long ago (with the release of PHP 5 or 5.1), but it still seems that many of the concepts are not fully understood or ignored by the community. This post aims to be a solid introduction to exception architecture, handling and testing. At the end of the post you should be able to know when to raise an exception and how it should look like.

He talks about situations when (and when not) to use exceptions, normalizing them for easier try/catch-ing and includes the exception class hierarchy, including the types pulled from the SPL. He shows examples (based on the Lithium framework's namespacing) how to create "namespaced exceptions" and how to use these in a bit of sample code. He also mentions the use of the custom error handling with the ErrorException as well as a quick look at testing these basic and custom exceptions correctly (PHPUnit-based tests).

tagged: exception custom namespace tutorial primer unittest lithium

Link:

PHPBuilder.com:
A Primer On Postgres Exception Handling For The PHP Developer, Part 2
Nov 16, 2007 @ 09:35:00

PHPBuilder.com has posted part two of a series they're working through introducing PHP developers to the world of exception handling in the Postgres database.

Last week we left off with an example where notice, exception and log levels are sent to the client. This week we present more POSTGRES exception examples, and continue with our article on Postgres exception handling.

They create a few examples:

  • handling other error conditions with OTHERS
  • using f_ex2
  • returning NO_DATA_FOUND and TOO_MANY_ROWS
  • handling exceptions like table constraints
  • nested exceptions
  • using f_ex5
  • a RAISE EXCEPTION dilemma
  • using f_ext1
tagged: postgres exception handling developer primer postgres exception handling developer primer

Link:

PHPBuilder.com:
A Primer On Postgres Exception Handling For The PHP Developer, Part 2
Nov 16, 2007 @ 09:35:00

PHPBuilder.com has posted part two of a series they're working through introducing PHP developers to the world of exception handling in the Postgres database.

Last week we left off with an example where notice, exception and log levels are sent to the client. This week we present more POSTGRES exception examples, and continue with our article on Postgres exception handling.

They create a few examples:

  • handling other error conditions with OTHERS
  • using f_ex2
  • returning NO_DATA_FOUND and TOO_MANY_ROWS
  • handling exceptions like table constraints
  • nested exceptions
  • using f_ex5
  • a RAISE EXCEPTION dilemma
  • using f_ext1
tagged: postgres exception handling developer primer postgres exception handling developer primer

Link:

Zend Developer Zone:
L10N==Localization (See there are ten letters...Oh, you get it...OK)
Jun 09, 2006 @ 06:57:37

Internationalization and Localization are concepts that all web sites and applications will have to deal with at some point. Why not design it form the start? Most people just don’t think about it but in an increasingly global society, you need to. The earlier you design for it, the easier it is to do.

They continue on in this post on the Zend Developer Zone with a resource to get you thinking - an Internationalization Primer from Johnathan Snook (as printed in Digital Web Magazine). He looks at the basics you'll need to know when putting in multi-language support, including database designs and precompiling.

tagged: localization article digital web magazine primer localization article digital web magazine primer

Link:

Zend Developer Zone:
L10N==Localization (See there are ten letters...Oh, you get it...OK)
Jun 09, 2006 @ 06:57:37

Internationalization and Localization are concepts that all web sites and applications will have to deal with at some point. Why not design it form the start? Most people just don’t think about it but in an increasingly global society, you need to. The earlier you design for it, the easier it is to do.

They continue on in this post on the Zend Developer Zone with a resource to get you thinking - an Internationalization Primer from Johnathan Snook (as printed in Digital Web Magazine). He looks at the basics you'll need to know when putting in multi-language support, including database designs and precompiling.

tagged: localization article digital web magazine primer localization article digital web magazine primer

Link:

PHPBuilder.com:
Using XML - A PHP Developer's Primer, Part 4 (Subpart 2)
Apr 26, 2006 @ 16:41:13

PHPBuilder.com has continued their "PHP Developer's Primer" series covering the various uses of XML in PHP with this new tutorial, part two of their "XML-RPC, PHP, and Javascript" coverage.

Continuing with the code developed in part one, they work on creating the PHP server side of things, showing the code to respond to the connections, validate the email address sent, and how to use Javascript to make a connection and call the server.

By the end, you'll have a set of scripts that can ship off an email address to be validated on the server-side with the help of some handy Javascript and a simple backend connection.

tagged: xml developer primer xml-rpc javascript xml developer primer xml-rpc javascript

Link:

PHPBuilder.com:
Using XML - A PHP Developer's Primer, Part 4 (Subpart 2)
Apr 26, 2006 @ 16:41:13

PHPBuilder.com has continued their "PHP Developer's Primer" series covering the various uses of XML in PHP with this new tutorial, part two of their "XML-RPC, PHP, and Javascript" coverage.

Continuing with the code developed in part one, they work on creating the PHP server side of things, showing the code to respond to the connections, validate the email address sent, and how to use Javascript to make a connection and call the server.

By the end, you'll have a set of scripts that can ship off an email address to be validated on the server-side with the help of some handy Javascript and a simple backend connection.

tagged: xml developer primer xml-rpc javascript xml developer primer xml-rpc javascript

Link:

PHPBuilder.com:
Using XML - A PHP Developer's Primer (Part 3)
Mar 24, 2006 @ 07:04:06

For those of you that have been following along, PHPBuilder.com has posted the third and final part of their "Using XML: A PHP Developer's Primer" series. Even if you haven't been keeping up, it's worth a look.

In this edition, they look at more advanced topics - a deeper look at Ajax and how to style the data you get back with XSL, both on the client and sever.

To start, they look at XSL - what it is, how it's used, and some code examples of both the XML and XSL structures to style XML data into a valid HTML page. Of course, you'll need the PHP extension to get this all working, so they step you through the installation/enabling of that as well.

They touch on other topics (like passing variables to a stylehseet and XSLT in Javascript) before getting to a simple XSLT and Ajax example - pulling book data and formating it with examples of both the PHP and Javascript sides.

tagged: xml xslt primer part three style javascript server-side client-side xml xslt primer part three style javascript server-side client-side

Link:

PHPBuilder.com:
Using XML - A PHP Developer's Primer (Part 3)
Mar 24, 2006 @ 07:04:06

For those of you that have been following along, PHPBuilder.com has posted the third and final part of their "Using XML: A PHP Developer's Primer" series. Even if you haven't been keeping up, it's worth a look.

In this edition, they look at more advanced topics - a deeper look at Ajax and how to style the data you get back with XSL, both on the client and sever.

To start, they look at XSL - what it is, how it's used, and some code examples of both the XML and XSL structures to style XML data into a valid HTML page. Of course, you'll need the PHP extension to get this all working, so they step you through the installation/enabling of that as well.

They touch on other topics (like passing variables to a stylehseet and XSLT in Javascript) before getting to a simple XSLT and Ajax example - pulling book data and formating it with examples of both the PHP and Javascript sides.

tagged: xml xslt primer part three style javascript server-side client-side xml xslt primer part three style javascript server-side client-side

Link: