Advertisement
Guest User

Untitled

a guest
Aug 28th, 2016
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. class Config
  2. {
  3. private static $config = null;
  4. private $host = 'localhost';
  5. private $userName = 'root';
  6. private $password = '';
  7. private $database = 'keep_lab';
  8. private $lcTimeNames = 'ru_RU';
  9. private $encoding = 'utf8';
  10. public static function getConfig()
  11. {
  12. if (self::$config === null) {
  13. self::$config = new self;
  14. }
  15. return self::$config;
  16. }
  17. }
  18.  
  19. public static function getDB()
  20. {
  21. if (self::$db === null) {
  22. self::$db = new self(Config::getConfig());
  23. }
  24. return self::$db;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement