[snip]
This is another rather hackish attempt at using the tokeniser.

Which isn't perfect by a long shot, but I'm away home now so it'll have
to do.

I'd be interested to know what it makes of your queries.
[/snip]

This little slice of code is really well done, and I think that when it
is combined with the code from the original so that the file names for
each query can be identified and the other items can be specified from
the command line as Jochem had done this will be one really popular
little application. I made one change Robin and have one suggestion

I changed line 4 from 
//looks at all $dir/*.php files.
$dir = '/path/to/php/files';

//looks at all $dir/*.php files.
$dir = $_SERVER['PWD']; 

Which means that you will not have to modifiy the line each time you
place it in a different directory. Other than that, using glob in this
function;

function getPhpFileList($dir)
{
  if (!is_dir($dir)) $dir = '.';
  return glob($dir . '/*.php');
}

Will not work in older versions of PHP. Some folks still have these
older versions running (for various reasons) and may need this changed.

What's possibly next for this little application? Perhaps a method to
determine which type of database is being used based on connection
information or what have you. Learning by hacking, isn't it cool?

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to