Advertisement
Guest User

Untitled

a guest
May 25th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. class Config
  2. {
  3. public static $obj;
  4.  
  5. public static function getObj()
  6. {
  7. if (!isset(self::$obj)) {
  8. return self::$obj = new self;
  9. }
  10. return self::$obj;
  11. }
  12.  
  13. public function setDbconnect()
  14. {
  15. $cfg = (include __DIR__ . '/../config.php')['db'];
  16. foreach ($cfg as $key => $value){
  17. $this->$key = $value;
  18. }
  19. }
  20.  
  21. private function __construct()
  22. {
  23.  
  24. }
  25.  
  26. private function __clone()
  27. {
  28.  
  29. }
  30. private function __wakeup()
  31. {
  32.  
  33. }
  34.  
  35.  
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement