I just ran across an interesting thing about calling a class directly vs calling it via its singleton instance.
class mytest extends prefab {
public $call_once = true;
function __construct() {
if ($this->call_once)
{
$this->call_once = false;
echo "I have not initizalized!<br>";
}
}
}
new mytest();
mytest::instance();
I have not initialized
I have not initialized
That doesn't seem right?
It's not a big issue. But I had to change some very important code around.new $module["module"]($module["namespace"]);
$module["module"]::instance($module["namespace"]);
foreach ($f3->installed_modules as $module)
{
if (class_exists($module["module"]))
{
if (is_subclass_of($module["module"], "prefab"))
$module["module"]::instance();
else
new $module["module"]($module["namespace"]);
}
}