public static function init($config, $soap_enabled = true) { self::$config = $config; self::$api = new SoapClient(NULL, array('location' => self::$config['URL'], 'uri' => self::$config['URL'], 'trace' => 1, 'cache_wsdl' => WSDL_CACHE_NONE)); if ($soap_enabled) { $r = self::$api->auth(self::$config['CLIENT_ID'], self::$config['CLAPI_KEY'], NULL); if (is_object($r)) { $r = (array) $r; } if ($r['status']) { throw new Exception("Cannot authenticate"); } } }