private static function getInterface($version, $protocol)
{
$path = DIR . '/version/' . $version . '/';
if (is_dir($path)) {
if ($protocol == PROTOCOL_SOAP) {
$class = SOAP_INTERFACE;
$classfile = $path . $class . '.php';
} else {
if ($protocol == PROTOCOL_XML || $protocol == PROTOCOL_JSON) {
$class = RESTFUL_INTERFACE;
$classfile = $path . $class . '.php';
} else {
throw new ApiClientException(CLI_ERROR_PROTOCOL);
}
}
if (is_file($classfile)) {
require_once $classfile;
if (class_exists($class)) {
return $class;
} else {
throw new ApiClientException(CLI_ERROR_PROTOCOL_CLASS);
}
} else {
throw new ApiClientException(CLI_ERROR_PROTOCOL_CLASSFILE);
}
} else {
throw new ApiClientException(CLI_ERROR_VERSION);
}
}