PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.php > PHP error
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
PHP error

Réponse
 
LinkBack Outils de la discussion
Vieux 16/06/2008, 05h54   #1
MikeB
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut PHP error

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;
}
}

  Réponse avec citation
Vieux 16/06/2008, 06h22   #2
MikeB
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: PHP error

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.
  Réponse avec citation
Vieux 16/06/2008, 08h40   #3
Álvaro G. Vicario
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: PHP error

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
--
  Réponse avec citation
Vieux 16/06/2008, 21h16   #4
MikeB
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: PHP error

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?
  Réponse avec citation
Vieux 16/06/2008, 21h37   #5
AnrDaemon
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: PHP error

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>

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 13h07.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,15323 seconds with 13 queries