Archive | March, 2005

Dumping your data

Posted on 29 March 2005 by Demian Turner

If you ever need to display the content of arrays or objects or any other data for that matter I have developed a function to dump the data
with syntax highlighting, indenting, variable type etc. The purpose of this function is not for debugging, like the excellent xdebug, but just to let you view data in a simple way. It requires no server installation but only two lines of code. You can see an example and
download the LGPL sourcecode at this website

Comments (1)

Having Fun with (Amazon) Web Services

Posted on 24 March 2005 by Demian Turner

Via Aaron Wormus, blow your socks off with this cool app:

amaztype

Comments (2)

PHPkitchen Saved by Serendipity

Posted on 21 March 2005 by Demian Turner

I’ve known about Serendipity for a while, just never had a chance to get around to trying it. What a fantastic piece of software, not only as a blog but as something that excels in many areas – templating, coding style, plugin integration, documentation, ease of installation to name a few. What a contrast – after spending the last few months fixing really low quality but ‘popular’ PHP apps, I have to say Serendipity really shines.

In the last few weeks, I got stuck between a rock and a hard place – the Seagull project now relies on some features that can only be implemented with PEAR_Server, a new PEAR package that is PHP5 only, and I was unable to switch as my existing blog was running on Geeklog, something I chose 5 years ago when PHPkitchen started, which to be fair, has been fine until now, but that does not support PHP5 in any shape, way or form.

I searched the web high and low for Geeklog converters, nothing of any note to be found, and then just started experimenting with Serendipity by fluke, after being left with rather a bad taste in my mouth having gone through the source for the trendy WordPress package.

Scanning through the mess of options I discovered the ‘Import Data’ section, and to my amazement, ‘Geeklog 1.3.11’ was an option. Even though I was running 1.3.7sr4, I thought I’d give it a whirl. Things hummed, purred, some heavy data munching was clearly going on behind the scenes. Then lo and behold, about 20 seconds later, the whole whack of 5 years worth of users, stories and comments had been flawlessly imported into Serendipity! I don’t need to describe my astonishment at the event, or the fact my socks were blown off clean across the room – this kind of feat was unheard of in PHP circles, I’d just had the Geeklog 1.3.7 to 1.3.11 upgrade script fail on me and even the latest fresh install came nowhere near to running on PHP5. What a pleasant surprise – my faith is fully restored in the capacity for PHP excellence, and PHPkitchen’s 742 users will be glad to know all 668 entries spanning the last 5 years have been flawlessly imported, including all 341 comments.

Hats off to Serendipity!

As a side note, the small downside to the changeover is none of PHPkitchen’s google indexed links will now work, and things like polls don’t seem to be implemented yet in Serendipity – but I hope readers find the new format less cluttered, easier to read, and more importantly, more fun to interact with.

Comments (10)

Seagull 0.4.0dev2 Released

Posted on 19 March 2005 by Demian Turner

At last there is a new release of the Seagull framework project out. Despite the fact the previous release was 2 months ago, a mountain of work has gone into the codebase and there are many new features to try out.

Be forewarned, this release is not for your live servers, hence the ‘dev’ suffix, however the sooner people can test it out, report bugs and hopefully send in patches – the better 🙂 There is a list of known issues, some of which have been fixed in CVS, the idea is that a subsequent release will follow shortly with the major bugs fixed.

The main new feature of this release is the implementation of a front controller (many thanks to AJ Tarachanowicz who helped extensively here) which permits the use of search engine friendly urls. As a results, all the previous ‘start files’ in the webroot have been removed. As well, some considerable refactoring of the core classes has been undertaken, judge for yourself, or browse the files in our new Chora cvs viewer.

Other features of note:

  • categories converted to nested set (AJ Tarachanowicz, Radek Maciaszek)
  • install wizard improved (Andy Crain)
  • significant CSS refinement (Riccardo Magliocchetti)
  • new Brazilian Portuguese translation (Rafael F. Silva)
  • integration of PEAR’s HTTP::Download package (Pierpaolo Toniolo)
  • cleaner separation between data manipulation and presentation
  • integration of Flexy plugins and full php5 compatibility (Rares Benea)

See the changelog for full details and the wiki for the ever-improving project documentation.

Comments (1)

DB portability Idea

Posted on 10 March 2005 by Demian Turner

There’s quite an interesting article by Daniel Convissor, the maintainer of PEAR DB, on making a database schema portable across DB vendors. His approach is quite interesting, he uses customised meta tags to describe data types, then runs the meta-schema through a regex-replace script to produce native outputs for the target DB.

Comments (0)

Tags:

Advantages of using the PEAR class naming convention

Posted on 09 March 2005 by Demian Turner

There are many good reasons for following the PEAR coding standards which I don’t have time to go into now, a slightly elabourated version of the ‘rules’ is available here, mostly borrowed from the Horde project.

But by far the most convincing reason to use the file naming convention, which means that a class located in your include path like Foo/Bar/Baz.php is called Foo_Bar_Baz, is the ability to take advantage of PHP 5’s __autoload magic method.

What this means is that if you instantiate the above class, and forgot to require it, it can be located and loaded automatically, from any of hundreds of classes in your include path. Here’s the code:

function __autoload($class)
{
  $filename = str_replace('_', '/', $class) . '.php';
  @require_once $filename;
}

Comments (6)

Getting pearified with the PEAR Package Manager

Posted on 09 March 2005 by Demian Turner

Not suprisingly a host of developments have cropped up following Greg Beaver’s successful release of PEAR 1.4, including a number of channels, and now pearified.com, as described by Robert Peake’s article.

If you are one of the majority of people answering ‘I don’t know what the PEAR package manager is’ at the survey below, please read up on this exciting technology and help raise the bar for PHP application deployment.

Comments (0)

PHP London strikes again

Posted on 04 March 2005 by Demian Turner

Last night‘s
monthly PHP London meetup was so successful, the landlord of the pub we
met at forbade us to ever gather there again 🙂 It would appear
PHPers drink more beer than order dinners, and dinners are what keeps
the place afloat.

Perrick Penet gave a talk on SimpleTest, the group’s wiki project got subjected to some debugging, and we invested some thought into where we should meet next month.

Comments (0)

Categories

Books

Demian Turner's currently-reading book recommendations, reviews, favorite quotes, book clubs, book trivia, book lists

Facebook