Created
April 8, 2013 01:58
-
-
Save okovalov/5333642 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class BdController | |
{ | |
private $_instance = null ; | |
public function __construct() | |
{ | |
$this->_instance = new PDO('mysql:host=127.0.0.1; dbname=pa_tp1','root', ''); | |
} | |
public function getInstance() | |
{ | |
return $this->_instance; | |
} | |
} | |
class BdController | |
{ | |
private statuc $_instance = null ; | |
private function __construct() | |
{ | |
$this->_instance = new PDO('mysql:host=127.0.0.1; dbname=pa_tp1','root', ''); | |
} | |
public static function getInstance() | |
{ | |
if(is_null(self::$_instance)) | |
{ | |
self::_$instance = new self(); | |
} | |
return self::$_instance; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment