eviL3 wrote:I guess you could come up with a complex way to configure the cache. But there's no way you can predict the arguments the module will need. Creating the instance directly seemed like the simplest and most flexible way to do it. Of course, it's just a suggestion.
$cache = new cache($a, $b, $c);
// config.php
$cache_args = array($a, $b, $c);
// elsewhere
// php 5.1.3+. http://php.net/manual/en/function.call-user-func-array.php
$reflectionObj = new ReflectionClass($cache_className);
$cache = $reflectionObj->newInstanceArgs($cache_args);


Oleg wrote:This topic's title takes the prize for most errors per word (3 in 4).
Users browsing this forum: Exabot [Bot] and 18 guests