Implicit Evaluation with PHP

13 March 2006

A feature request

I do wish PHP had some kind of preprocessor, macro system or way of manually aliasing functions. Right now, I use require_once(nsclass("Library::User.DataAdapter"));. How I wish I could import "Library::User.DataAdapter";. And while I could do:

function import ($path) {

$strRoot = “/var/www/html/”;

require_once ($strRoot . str_replace (”::”, “/”, $path) . “.php”);

}

It’s just not quite right. The file is included at the wrong scope, for one. But even if I could just alias require_once to req, and then rename nsclass to import, everything would be much tidier.

I have not filed this as a request with PHP.net (as I couldn’t find the approriate avenue for submission. If you know or have influence, please, let me know or even take credit for it and do it yourself.

No Comments currently posted.

Post a comment on this entry: