Skip to content

Commit

Permalink
Updated to support MongoClient class. Removed GoChat tracking.
Browse files Browse the repository at this point in the history
  • Loading branch information
elmerfud committed Sep 23, 2013
1 parent c2efc57 commit df1b9fd
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions moadmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,11 @@ class moadminModel {
*/
protected function _mongo() {
$connection = (!MONGO_CONNECTION ? 'mongodb://localhost:27017' : MONGO_CONNECTION);
return (!REPLICA_SET ? new Mongo($connection) : new Mongo($connection, array('replicaSet' => true)));
if (class_exists('MongoClient') === true) {
return (!REPLICA_SET ? new MongoClient($connection) : new MongoClient($connection, array('replicaSet' => true)));
} else {
return (!REPLICA_SET ? new Mongo($connection) : new Mongo($connection, array('replicaSet' => true)));
}
}

/**
Expand Down Expand Up @@ -1132,8 +1136,7 @@ public function header(array $args) {
$return .= PHP_EOL . (is_array($head) ? implode(PHP_EOL, $head) : $head);
}

$return .= PHP_EOL . '</head>' . PHP_EOL . '<body>'
. $this->js('https://GoChat.us/chat.js#identity=5047dd509c3a8dd8fec07b5b&appid=phpmoadmin.com');
$return .= PHP_EOL . '</head>' . PHP_EOL . '<body>';
return $return;
} else {
$errorMsg = 'Invalid usage of ' . __METHOD__ . '() - the header has already been returned';
Expand Down

0 comments on commit df1b9fd

Please sign in to comment.