Skip to content
This repository has been archived by the owner on Jul 1, 2022. It is now read-only.

Commit

Permalink
code style
Browse files Browse the repository at this point in the history
  • Loading branch information
FO-nTTaX committed Mar 1, 2018
1 parent c774f08 commit 2a28325
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions api/Connection.php
Expand Up @@ -2,31 +2,31 @@

class Connection {

protected static $db;
protected static $db;

private function __construct() {
global $wgBracketContestDbType,
$wgBracketContestDbServer,
$wgBracketContestDbName,
$wgBracketContestDbUser,
$wgBracketContestDbPassword;
try {
self::$db = new PDO( $wgBracketContestDbType . ':host=' . $wgBracketContestDbServer. ';dbname=' . $wgBracketContestDbName,
$wgBracketContestDbUser, $wgBracketContestDbPassword);
self::$db->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );
}
catch (PDOException $e) {
// echo "Connection Error: " . $e->getMessage();
}
private function __construct() {
global $wgBracketContestDbType,
$wgBracketContestDbServer,
$wgBracketContestDbName,
$wgBracketContestDbUser,
$wgBracketContestDbPassword;
try {
self::$db = new PDO( $wgBracketContestDbType . ':host=' . $wgBracketContestDbServer. ';dbname=' . $wgBracketContestDbName,
$wgBracketContestDbUser, $wgBracketContestDbPassword);
self::$db->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );
}
catch (PDOException $e) {
// echo "Connection Error: " . $e->getMessage();
}

}
}

public static function getConnection() {
if (!self::$db) {
new Connection();
}
return self::$db;
}
public static function getConnection() {
if (!self::$db) {
new Connection();
}
return self::$db;
}
}
?>

0 comments on commit 2a28325

Please sign in to comment.