Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

two db conecctions... #5

Open
padreputativo opened this issue Mar 1, 2013 · 2 comments
Open

two db conecctions... #5

padreputativo opened this issue Mar 1, 2013 · 2 comments

Comments

@padreputativo
Copy link
Contributor

I want to keep using this class but i dont want open two db sessions (with the password in two different files)... I want to use my own $db conection class, not to create a new conn (or need to change the entire script).... I think that must be optional....

@padreputativo
Copy link
Contributor Author

ops! i did not solved it yet...

@cballou
Copy link
Owner

cballou commented Mar 1, 2013

It shouldn't be all that bad to implement. Pass in a config param called connection containing the Mongo class. Check if $config['connection'] exists, and if so don't require them to specify a database. Next, do a verification on $config['connection'] to ensure it's of class Mongo. Later in _init(), don't perform $this->_connection = if you've already set $this->_connection and it's an instance of Mongo via !empty($this->_connection) && get_class($this->_connection) == 'Mongo'.

@cballou cballou reopened this Mar 1, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants