Skip to content

Commit

Permalink
update mongo api to replace deprecated code
Browse files Browse the repository at this point in the history
  • Loading branch information
tchemineau committed Jul 10, 2013
1 parent d190dd3 commit b3366f7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions classes/Model/Mongo.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public function save($validate = true)
}

try {
$this->_collection->save($obj, array('safe'=>true));
$this->_collection->save($obj, array('w'=>true));
}
catch (MongoException $e) {
$this->_error = $e->getMessage();
Expand Down Expand Up @@ -181,4 +181,4 @@ public function collection()
return $this->_collection;
}

}
}
4 changes: 2 additions & 2 deletions classes/Mongo/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function __construct($config='default')
// Set the DB Name
$this->_db = $this->_config['database'];

$this->_conn = new Mongo('mongodb://'.$str);
$this->_conn = new MongoClient('mongodb://'.$str);
}

public static function instance($config='default')
Expand All @@ -54,4 +54,4 @@ public function db()
{
return $this->_conn->{$this->_db};
}
}
}

0 comments on commit b3366f7

Please sign in to comment.