|
-
May 12th, 2011, 03:59 AM
#1
[RESOLVED] PHP 5.2.17 and Singleton classes
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:
Code:
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:
Code:
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|