Archive for July 26th, 2006

Dikini.net: Poor man’s macro programming in php

vlado, thinking more about a previous post, started wondering what exactly you’d need to do to get macros working in PHP. Read on for his answers.

What is the closest we can get to that without actually changing anything in php (poor man’s version? What minimal sugar does php need to make it comfy? What is the natural syntax for macros in php? I definitely don’t know the answers to these questions but let’s try.

He doesn’t create working code, but he does make it a PHP-ish looking solution. He also suggests that while PHP doesn’t have this ability (yet?), the generic function pattern can help mimic its functionality pretty closely.

Continue Reading · Add comment

Zend Developer Zone: OSCON Day 2: Picking Up Steam

Cal Evans is back today with his day two recap from the O’Reilly Open Source Confernce going on now in Oregon. Day two is the first official day of the conference and had much more going on than the day before.

Things really started to pick up steam yesterday with regards to PHP. So here I sit in the first session for everybody. As I sit here and jam to the oldies, watch slide after slide on the many multimedia screens and wait for Nathan Torkington to take the stage, I’ll take the opportunity to give you a fly-over of yesterday’s activities.

He mentions

  • his breakfast with Laura Thomson
  • OmniIT’s sales of Theo Schlossnagle’s book (Scalable Internet Architectures)
  • Marcus Borger’s talk on OOP in PHP5
  • Chris Shiflett talk on “Essential PHP Security”
  • Laura Thomson and Luke Welling’s “Building an Asynchronous Multi-user Web App for Fun … and Maybe Profit”

Cal also mentions that the talks given by the OmniIT-ers are being videoed, so keep an eye out for those following the conference’s end.

Continue Reading · Add comment

PHPBuilder.com: An introduction to PEAR’s Validate package

On PHPBuilder.com today, there’s a new article introducing yet another valuable PEAR package - PEAR::Validate.

Poor validation is a key weakness many scripts are guilty of, enabling security exploits. The Validate package can be used to validate any data, and is especially useful for validating user input.

There are also related packages that apply specific validation rules according to geographic location. I don’t cover these packages in this article, though once you’ve grasped the basics of the main Validate package, using these won’t present much of a challenge.

They introduce the package by showing a quick install of it, including dependencies. From there, it’s examples of different validation types:

  • email addresses
  • numbers
  • strings
  • dates
  • URLs

And it wouldn’t be a tutorial without some code, so for each example there’s a snippet or two and a breakdown of its usage.

Continue Reading · Add comment

Loading Spread Sheet Data into Oracle 10G XE

If you have ever loaded data into an Oracle table you know that it is a rather complicated process. You will be surprised at how much easier it is to do in Oracle 1 G XE. Keep reading to find out….

(Advertisement) Automate Software Builds with Visual Build Pro Easily create an automated, repeatable process for building and deploying software.

Continue Reading · Add comment

Jacob Santos’s Blog: The Sexy Filter Extension and Fear of Regex

Jacob Santos has posted a new entry on his blog today with his own take on regular expressions and their collaboration with the Filter extension in PHP.

Regular Expressions are a powerful way to parse and evaluate strings. They can be fun sometimes, but there is rarely an indication of the reason why they fail.

I knew it would be satisfying, once I seen this (the Filter extension) in passing on the php.net site. It uses the procedural method, which I think fits perfectly. If you try to throw objects at a novice than most aren’t likely to use what you give. It is really simple to use, so there is no longer any excuse for an developer to not be using it, if using PHP 5.2+.

He gives examples of email validation methods both with and without the Filter extension, making it abundantly clear which is easier - a simple call to filter_data validates with no muss or fuss.

Continue Reading · Add comment