Remove unnecessary use of anonymous functions

This commit is contained in:
Kijin Sung 2015-04-03 16:28:46 +09:00
parent b4bbbb378f
commit 3ac6579968
4 changed files with 11 additions and 17 deletions

View file

@ -328,8 +328,7 @@ class DB
unset($oDB);
require_once($class_file);
$tmp_fn = create_function('', "return new {$class_name}();");
$oDB = $tmp_fn();
$oDB = new $class_name();
if(!$oDB)
{

View file

@ -1060,14 +1060,13 @@ class ModuleHandler extends Handler
return NULL;
}
// Create an instance with eval function
// Create an instance
require_once($class_file);
if(!class_exists($instance_name, false))
{
return NULL;
}
$tmp_fn = create_function('', "return new {$instance_name}();");
$oModule = $tmp_fn();
$oModule = new $instance_name();
if(!is_object($oModule))
{
return NULL;