- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
class ConnectDB {
protected static $_instance;
private function __construct() {
$this->DB = new DBConnector();
}
private function __clone() {}
private function __wakeup() {}
public static function getInstance() {
if (empty(self::$instance)) {
self::$_instance = new self;
}
return self::$_instance;
}
}
Комментарии (4) RSS