|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
I'm messing around with some sample code that I downloaded from a
website (http://odnal.com/prosper-bid-sniper) that uses PHP objects and web services. When I upload it to my server, I get a weird error in a particular class. I'm posting 3 functions from that class. The error is Parse error: syntax error, unexpected '{' in /home/public_html/ prosperapi/prosper.class.php on line 164. Line 164 is the try-block in the call-function. I'm posting the preceding and following functions, since I know that sometimes an error isn't exactly at the line it is reported on. Can anyone spot the error? The variable "errorMessage" doesn't seem to be defined in the class, but even if I try and define it, the error doesn't change, so I suspect that that isn't the problem. Thanks. ----------------------------------------------------------------------- function authToken() { return $this->decrypt($this->auth_token); } function call($operation, $params) { $this->errorMessage = ''; try { $result = (array) $this->soap_client- >__soapCall($operation, array('Request' => $params)); } catch (Exception $e) { $this->error($operation, $params, $e); return false; } return $result; } function query($params = array()) { $result = $this->call('Query', $params); if ((isset($result['QueryResult']->Success)) && $result['QueryResult']->Success == 1) { return isset($result['QueryResult']->ProsperObjects- >ProsperObject) ? $result['QueryResult']->ProsperObjects- >ProsperObject : array(); } else { $this->error('query', $params, $result['QueryResult']- >Message); return false; } } function retrieve($params = array()) { if (!isset($params['authenticationToken'])) { $params['authenticationToken'] = $this->authToken(); } $result = $this->call('Retrieve', $params); if ((isset($result['RetrieveResult']->Success)) && $result['RetrieveResult']->Success == 1) { return $result['RetrieveResult']->ProsperObjects- >ProsperObject; } else { $this->error('retrieve', $params, $result['RetrieveResult']->Message); return false; } } |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
On Jun 15, 11:54 pm, MikeB <MPBr...@gmail.com> wrote:
> I'm messing around with some sample code that I downloaded from a > website (http://odnal.com/prosper-bid-sniper) that uses PHP objects > and web services. > The full code can be viewed here: http://svn.odnal.com/prosper_bid_sni...sper.class.php Thanks again. |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
MikeB escribió:
> When I upload it to my server, I get a weird error in a particular > class. I'm posting 3 functions from that class. The error is > Parse error: syntax error, unexpected '{' in /home/public_html/ > prosperapi/prosper.class.php on line 164. > > Line 164 is the try-block in the call-function. What's your PHP version? Exception handling did not exist in PHP versions older than 5. -- -- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain -- Mi sitio sobre programación web: http://bits.demogracia.com -- Mi web de humor al baño María: http://www.demogracia.com -- |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
On Jun 16, 2:40 am, "Álvaro G. Vicario"
<alvaroNOSPAMTHA...@demogracia.com> wrote: > MikeB escribió: > > > When I upload it to my server, I get a weird error in a particular > > class. I'm posting 3 functions from that class. The error is > > Parse error: syntax error, unexpected '{' in /home/public_html/ > > prosperapi/prosper.class.php on line 164. > > > Line 164 is the try-block in the call-function. > > What's your PHP version? Exception handling did not exist in PHP > versions older than 5. > > -- > --http://alvaro.es- Álvaro G. Vicario - Burgos, Spain > -- Mi sitio sobre programación web:http://bits.demogracia.com > -- Mi web de humor al baño María:http://www.demogracia.com > -- Rats. That's it. My hosting company provides PHP 4.4.7 My options are: 1. Find a new hosting company 2. Ask them to upgrade to V5 3. Is there anything I can code in PHP V4 tht is similar to exception handling? |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
Greetings, MikeB.
In reply to Your message dated Tuesday, June 17, 2008, 00:16:31, > On Jun 16, 2:40 am, "Álvaro G. Vicario" > <alvaroNOSPAMTHA...@demogracia.com> wrote: >> MikeB escribió: >> >> > When I upload it to my server, I get a weird error in a particular >> > class. I'm posting 3 functions from that class. The error is >> > Parse error: syntax error, unexpected '{' in /home/public_html/ >> > prosperapi/prosper.class.php on line 164. >> >> > Line 164 is the try-block in the call-function. >> >> What's your PHP version? Exception handling did not exist in PHP >> versions older than 5. >> >> -- >> --http://alvaro.es- Álvaro G. Vicario - Burgos, Spain >> -- Mi sitio sobre programación web:http://bits.demogracia.com >> -- Mi web de humor al baño María:http://www.demogracia.com >> -- > Rats. That's it. My hosting company provides PHP 4.4.7 > My options are: > 1. Find a new hosting company > 2. Ask them to upgrade to V5 > 3. Is there anything I can code in PHP V4 tht is similar to exception > handling? You can try error handling http://www.php.net/manual/en/functio...or-handler.php But better to ask your hosting company to move your account to server with PHP5 installed. I think they do have such server. -- Sincerely Yours, AnrDaemon <anrdaemon@freemail.ru> |
|
![]() |
| Outils de la discussion | |
|
|