Why will you kill the following pretty working code to load
classes if they needed and use only $cl_api->subclass->method()
in the whole application?

The whole implementation is little complexer, if file does not exist
it looks if the file "modules/$subclass/api$subclass" exists and
do the same, so any external developer can create project-specific
modules and using the global load-mechanism. Yes there are some
checks too, i tried so simplyfie

This works fine for 122 automatic deployed installations of our
core-application which is developed over 7 years without any troubles
while jumping php4 -> php 5 -> php 5.3 with error-reporting E_STRICT
so please do not kill it without really good reasons

public function __get($subclass)
{
 $include_file = CONTENTLOUNGE_BASEDIR . 'api_' . $subclass . '.php';
 $class_name   = 'cl_' . $subclass;
 $this->$subclass = new $class_name();
 return $this->$subclass;
}

Am 23.07.2010 00:54, schrieb Karoly Negyesi:
> Hi,
> 
> Given that call_user_func exists I would recommend to remove $foo()
> from PHP Next.
> 
> Observe the "logic" in the following examples:
> 
> $foo();
> new $foo();
> classname::$foo;
> classname::$foo();
> 
> There is a word for this and that word is madness.
> 
> The simplest is to nuke $foo(). call_user_func() is a perfect replacement.
> 
> Regards
> 
> Karoly Negyesi
> 

-- 

Mit besten Grüßen, Reindl Harald
the lounge interactive design GmbH
A-1060 Vienna, Hofmühlgasse 17
software-development / cms-solutions
p: +43 (1) 595 3999 33, m: +43 (676) 40 221 40
icq: 154546673, http://www.thelounge.net/

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to