PDA

View Full Version : Non-static method ClientFactory


crounauer
03-07-08, 23:00
Hi,

I am building an application and have fully error reporting enabled which is throwing up this error. Could anyone shed some light?

An error occurred in script '/var/www/vhosts/pricescompare.co.uk/httpdocs/test_pc/modules/aw/pricesAW.php' on line 30: Non-static method ClientFactory::getClient() should not be called statically

which points to this line => $oClient= ClientFactory::getClient(11111, '344hhg4yu4jjj4jj4jjh4uy4777', 'affiliate');

Thanks,
Simon

crounauer
07-07-08, 17:13
Bump....

Do any of the AW developers perhaps know what this error message is and how to fix it?

Thanks,
Simon

Ollie
08-07-08, 13:41
Hi crounauer,

This error only usually occurs when you are using Strict Standards. To clear this you will have so tell the functions that they are actually 'static'.

You can do this by editing the files that the functions are contained in. So for example, to clear your error change the following:
function getClient($iUserId, $sUserPassword, $sUserType)
to
static function getClient($iUserId, $sUserPassword, $sUserType)
The above line can be found in /classes/class.ClientFactor.php ~ line 41.

If this does not work if you can post up or PM a link to a page showing the error and your PHP version so that I can take a look.

Cheers

crounauer
14-08-08, 23:17
Hi Ollie,

That worked, thanks for the post!

Regards,
Simon