/** * @return ServiceFactory */ protected function makeServiceFactory() { //this is what you usually want, for production: return new ServiceFactory($this->makeContext(), Host::standard(), '4.0'); //current release candidate for the next production version: //return new ServiceFactory($this->makeContext(), Host::http("rc-api.nameapi.org"), '4.1'); }
/** * @var $context * @var $host defaults to Host::standard() * @var $apiVersion default is the "latest stable", currently that is 4.0. * You want to change this to target another version, for example a release candidate or a development version. */ public function __construct(Context $context, Host $host = null, $apiVersion = null) { $this->context = $context; if ($host == null) { $this->host = Host::standard(); } else { $this->host = $host; } if ($host == null) { $this->apiVersion = '4.0'; } else { $this->apiVersion = $apiVersion; } $this->baseUrl = $this->host->toString() . '/soap/v' . $this->apiVersion . '/'; }
/** * @var $apiKey * @var $context * @var $host defaults to Host::standard() * @var $apiVersion default is the "latest stable", currently that is 5.0. * You want to change this to target another version, for example a release candidate or a development version. */ public function __construct($apiKey, Context $context, Host $host = null, $apiVersion = null) { $this->apiKey = $apiKey; $this->context = $context; if ($host == null) { $this->host = Host::standard(); } else { $this->host = $host; } if ($apiVersion == null) { $this->apiVersion = '5.0'; } else { $this->apiVersion = $apiVersion; } $this->baseUrl = $this->host->toString() . '/' . $this->technology . '/v' . $this->apiVersion . '/'; }