witam wszystkich.
otoz probuje sie logowac poprzez webapi i mi wywala taki blad:
Parse error: syntax error, unexpected T_ARRAY, expecting '&' or T_VARIABLE in c:\usr\krasnal\www\przyklad-1\allegro4.php on line 95
prosze o pomoc.
a moj program wyglada tak::
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2" />
<title>Untitled Document</title>
</head>
<body>
<?php
class Allegro
{
const WEBAPI_URL = 'http://webapi.allegro.pl/uploader.php?wsdl';
private $_data = array();
/**
* @var SoapClient
*/
private $_soap;
public function __construct($encoding = null, $userLogin = null, $userPassword = null, $webAPIKey = null, $localVersion = null) {
if(!is_null($encoding)) $this->_data['encoding'] = $encoding;
if(!is_null($userLogin)) $this->_data['userLogin'] = $userLogin;
if(!is_null($userPassword)) $this->_data['userPassword'] = $userPassword;
if(!is_null($webAPIKey)) $this->_data['webAPIKey'] = $webAPIKey;
if(!is_null($localVersion)) $this->_data['localVersion'] = $localVersion;
$this->_soap = new SoapClient(self::WEBAPI_URL);
// sprawdzanie poprawnosci klucza wersji
$sysStatus = $this->getAllegroSysStatus();
if($this->_data['localVersion'] != $sysStatus['ver-key']) {
$this->_data['localVersion'] = $sysStatus['ver-key'];
}
}
public function login() {
$params = array (
'user-login' => $this->_data['xxxxxxx'],
'user-password' => $this->_data['xxxxxxx'],
'country-code' => 1,
'webapi-key' => $this->_data['xxxxxxx'],
'local-version' => $this->_data['xxxxxxx']);
return $this->doLogin($params);
}
public function getAllegroSysStatus() {
$params = array(
'sysvar' => 1, //which feature you are asking for, 1 is for AllegroWebApi, other possible options above
'country-id' => 1, //country code, 1 is for Poland, all country codes are available in doLogin method documentation
'webapi-key' => $this->_data['webAPIKey']);
return $this->doQuerySysStatus($params);
}
public function __call($name, array $args = array()) {
if(is_array($args[0])) $args = $args[0];
return $this->_soap->__soapCall($name, $args);
}
public function __get($name) {
return $this->_data[$name];
}
}