function create_obj_from_conf($type, $conf) { $name = $conf[$type]; $file = dirname(__FILE__) . strtolower("/{$type}/{$name}.class.php"); $obj = AClientUtils::create_obj('AClient' . $name, 'AClient' . $type, $file); if ($obj == null) { AClientUtils::add_error("can not create {$type} {$name}"); return null; } $ret = $obj->set_conf(@$conf[$name . "Conf"]); if ($ret != true) { AClientUtils::add_error("{$name} Conf no correct"); return null; } return $obj; }