PHP remedial basics

Every few months it seems I’m doing some remedial research. I often take pages of notes and do hours of evaluation only to forget it. Luckily my webserver is up and running, php is installed (the last time I went through this was with magickwand — which I still haven’t used yet to create a gallery upload app for kelsey and for don lee. Time again.)

This time, I’m rebuilding the basics of my php dev framework, what logger to use, db api, orm, form validation, etc.

It was relatively painless (1/2 hour) to get pear installed, so I installed PEAR::Log. I thought I’d give DB_Dataobjects a try, but that’s complaining about a dependency for Validate that I can’t resolve.

So anyway, one of the reasons for this blog was to note things like this.

steps to install PEAR:
1. go to http://go-pear.org
2. save the page as go-pear.php (what a dumb way to do it)
3. type php go-pear.php
The following line is added to php.ini
include_path=”.;C:\PHP\pear”
4. when that’s done, type pear install Log
Log.php and Log folder are created under C:\PHP\pear
I don’t see how Log.php references the Log folder.

5. In your file, add lines similar to:

require(“Log.php”);
$file = &Log::factory(‘file’, ‘file.log’, ‘TEST’);
$file->log(‘Logging to file.log.’);

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s