S.P.I.
May 12th, 2011, 03:59 AM
Hi there, I spent the last 5 days developing an authorization system making use of the singleton pattern for a few classes. The script works just fine on my local server (running a php 5.3 config) but on my clients server it crashes royally.
The error says:
T_STATIC expecting T_STRING,T_FUNCTION OR $
I understand that earlier versions of PHP (in this case, 5.2.17) seem to have some trouble with late binding. Do you think this is what's causing the problem? Would it work out if they upgraded to 5.3? Here's the code that flags the error:
class session extends login{
private $fingerprint;
public static $s_instance = NULL;
private function __construct(){;}
public static function s_getinstance()
{
if (!isset(static::$s_instance)){
$c = __CLASS__;
static::$s_instance = new $c;
}
return static::$s_instance;
}
.... *code continues*
Also, what is the deal with the following mysql error:
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)"
Can this be flagged if I insert the incorrect hostname,username, password or dbname?
Thank you.
The error says:
T_STATIC expecting T_STRING,T_FUNCTION OR $
I understand that earlier versions of PHP (in this case, 5.2.17) seem to have some trouble with late binding. Do you think this is what's causing the problem? Would it work out if they upgraded to 5.3? Here's the code that flags the error:
class session extends login{
private $fingerprint;
public static $s_instance = NULL;
private function __construct(){;}
public static function s_getinstance()
{
if (!isset(static::$s_instance)){
$c = __CLASS__;
static::$s_instance = new $c;
}
return static::$s_instance;
}
.... *code continues*
Also, what is the deal with the following mysql error:
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)"
Can this be flagged if I insert the incorrect hostname,username, password or dbname?
Thank you.