Archive for June 27, 2006

WebProNews: Introduction To Regular Expressions In PHP

Linked to from this new post on the Zend Developer Zone is a handy regular expressions tutorial that any budding PHP developer should definitely check out.

Man I hate REGEX. Not for what it does, it’s a powerful weapon. It’s part sniper rifle, part bazooka and extremely useful in some situations. As powerful as it is though, it is a pain to write a good REGEX query; especially when you only do it occasionally. Thankfully, Bernard Peh and the gang over at WebProNews have released a primer for REGEX in PHP that makes it a little less painful to work with.

Appropriately titled Introduction To Regular Expressions In PHP, the article starts with a basic REGEX primer. It’s sparse on details but it discusses the different types of characters in a REGEX query. Properly formatted, this would be a great little cheat sheet to have handy.

Cal (on the Zend site) mentions that it’s a good starting place, but they don’t get too deep into the meat of the matter, showing more than just the basics of “this is what this character does”. Oh well, I suppose maybe that’s being saved for part two…

Joshua Eichorn’s Blog: HTML_AJAX Wordpress Plugin Tutorial

Joshua Eichorn has found a tutorial someone else has written on creating a stock lookup plugin for WordPress with his HTML_AJAX package.

The only problem I see is the code won’t work in PHP5 since introspection will return the method name as GetQuote instead of getquote.

He gives the code changes you’ll need to make to get it all working in your PHP5 installation, and includes another option as well - registering all of the functions you want to use instead of just automagically using them.

Jeff Moore’s Blog: Dependency Injection in PHP

In his latest blog post, Jeff Moore adds a bit more background to his column in the newest issue of php|architect covering “dependency injection”.

The June issue of PHP Architect is out. My column this month is on dependency injection, a topic which I’ve been warming up to lately.

First there was CORBA. Then insane complexity of CORBA was supplanted by the intolerable complexity of EJB. Influenced by an agile mindset and the power of Unit testing, a group of java programmers began to construct simpler alternatives to EJB. Thus, the inversion of control frameworks were born. Martin Fowler came along, clarified and renamed the pattern dependency injection. This activity has originated in the Java world, but the pattern applies in PHP as well.

It is heartening to see an industry solve a problem over the course of a decade, moving from complex vendor driven middle-ware to simple patterns. The thing I like most about DI is how dead simple it really is.

He goes on to say that Fowler’s article on the topic is a “must read” for anyone who will even be looking into dependency injection. He also mentions two issues he has with most of the other introductions - the examples they use and the “over-emphasis on the container”.

His goal in writing this month’s column was to help to avoid some of those problems while still keeping it relevant and easy to understand.

Performing Basic Tasks with MySQL 4.1 and Above, using mysqli with PHP 5

For anyone who has spent a few weeks working with PHP 5 the plethora of cool improvements and new features added to this incarnation of the language has brought a new more powerful level for developing and deploying Web applications. These include the implementation of exceptions and the brand new object model. But what if I tell you that now you can use PHP 5 to work with MySQL using an object-oriented approach …

(Advertisement) Protect your software for the entire lifecycle. Only Unified Software Protection from SafeNet gives you complete security from the development stage through fast and flexible licensing, to distribution and beyond. Lock down your software– click for a free whitepaper on securing software revenue.

Paul Jones’ Blog: Solar 0.20.0 released

Paul Jones has posted today about the release of the latest version of his Solar framework, version 0.20.0 alpha.

Exactly one month after the last release, I have uploaded version 0.20.0 alpha. There are lots of changes in this release, but the biggest news is that the page-controller now uses method-based actions (as opposed to file-based actions).

You can read the change notes here, but it’s a really long list. If you want something a little more readable, with better narrative, you’ll find it after the jump below. The new page-controller information is especially good. However, the narrative is quite long, so consider yourself warned. ;-)

For those that don’t want to take the time to read through it all, he summarizes it into six different sections:

  • Naming and Standards
  • Class Name Changes
  • Inherited Config File Values
  • Adapter Configuration
  • Locale Files
  • Page-Controller Class

Each section has its own explaination of the changes made in (a bit) more concise manner. Be sure to check out the full notes to read up on everything.

Laura Thomson’s Blog: Jobs @ OmniTI

OmniTI, the company that employs such PHP notables as Wez Furlong, Laura Thomson, and George Schlossnagle, is hiring according to this new post from Laura.

We are currently in need of four people:

  • A junior PHP dev
  • A junior-ish web designer (Photoshop, HTML, CSS, Javascript + ideally some coding)
  • An Oracle DBA
  • A PostgreSQL DBA

The job ads will be up on our website shortly, but if you are eager to act before then, please email me your resume at jobs@omniti.com.

You can find out more about OmniTI as a company from their site and more about previous jobs and how they hire from these two links.