Guest User

Untitled

a guest
Jul 13th, 2018
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. <?php
  2.  
  3. namespace App;
  4.  
  5. class Config
  6. {
  7. private static $single;
  8. protected $host = 'localhost';
  9. protected $dbname = 'NewsSky';
  10. protected $user = 'root';
  11. protected $password = '';
  12.  
  13. function getDbHost()
  14. {
  15. return $this->host;
  16. }
  17. function getDbName()
  18. {
  19. return $this->dbname;
  20. }
  21. public function getDbUser()
  22. {
  23. return $this->user;
  24. }
  25. public function getDbPass()
  26. {
  27. return $this->password;
  28. }
  29. public function getSingle()
  30. {
  31. if (self::$single === null){
  32. $class = __CLASS__;
  33. self::$single = new Config();
  34. return self::$single;
  35. }
  36. else
  37. return self::$single;
  38. }
  39. private function __construct(){}
  40. private function __clone(){}
  41. private function __wakeup(){}
  42. }
Add Comment
Please, Sign In to add comment