Hi...

Originally Posted by
Resolution
Doesn't your solution imply nesting though? For instance what if DB.php in the example you provided had it's own require_once_with_prefix? Does that nest the prefixes?
That wasn't what I was thinking. I was thinking that pear_stuff_DB would still be called by that name and already tagged files would not be double tagged. So utilities.php...
PHP Code:
class Hammer { }
toolbox.php...
PHP Code:
require_once_with_prefix('utilities.php', 'ToolboxUtility');
class toolbox {
...
function &getHammer() {
return new ToolboxUtilityHammer();
}
}
my_script.php...
PHP Code:
require_once_with_prefix('toolbox.php', 'My');
$toolbox = &new MyToolbox();
$hammer = &new ToolboxUtilityHammer(); // You would never do this.
What I am trying to do is to invert the logic. I am trying to push nameclashes out of the global namespace by tagging, rather than import things into the namespace under unique names. I think that this is a much easier problem to solve.
yours, Marcus
Bookmarks