daily pastebin goal
70%
SHARE
TWEET

Untitled

a guest Jun 18th, 2017 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. class Database extends Mysqli
  3. {  
  4.     private static $_instance;
  5.  
  6.     const HOSTNAME = 'localhost';
  7.     const USERNAME = 'root';
  8.     const PASSWORD = '';
  9.     const DATABASE = 'blog';
  10.  
  11.     private function __construct () { }
  12.  
  13.     private function __clone () { }
  14.  
  15.     protected static function getInstance ()
  16.     {
  17.         if (!isset(self::$_instance))
  18.             self::$_instance = new parent(
  19.                 self::HOSTNAME,
  20.                 self::USERNAME,
  21.                 self::PASSWORD,
  22.                 self::DATABASE
  23.             );
  24.         return self::$_instance;
  25.     }
  26. }
  27. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top