单例模式:
~~~
class Single
{
static private $single;
private function __construct(){
}
static public function getSingle()
{
if(!(self::$single instanceof self)){
self::$single = new Single();
}
return self::$single;
}
private function __wakeup()
{
// TODO: Implement __wakeup() method.
}
private function __clone()
{
// TODO: Implement __clone() method.
}
}
~~~