Code: Select all
<?php
class Database {
private $instance = null;
final private function __construct() {}
public static function getInstance() {
if (null === self::$instance) {
self::$instance = new self();
}
return self::$instance;
}
/* ... the rest of the class code ... */
}
?>