Can i call the Setup method and Close method more than one time in the same application?

16 views
Skip to first unread message

Mohamed Essam

unread,
Jan 30, 2016, 6:08:52 PM1/30/16
to redbeanphp
Can i call the Setup method and Close method more than one time in the same application? 
cause i always get this error : Unexpected exception of type [RedBeanPHP\RedException] with message [A database has already be specified for this key.]

Daniel Denayer

unread,
Jan 31, 2016, 7:03:03 AM1/31/16
to redbe...@googlegroups.com
What does work for me is to use:
  • R::setup() for the initial database
  • R::addDatabase()  to set up some additional database
  • R::selectDatabase() to switch among these databases (i;e. to designate one as the "current" database) - with R::select('default') invoking the initial one
  • R::close() to disconnect from the "current" database.


2016-01-30 22:56 GMT+01:00 Mohamed Essam <mess...@gmail.com>:
Can i call the Setup method and Close method more than one time in the same application? 
cause i always get this error : Unexpected exception of type [RedBeanPHP\RedException] with message [A database has already be specified for this key.]

--
You received this message because you are subscribed to the Google Groups "redbeanphp" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redbeanorm+...@googlegroups.com.
To post to this group, send email to redbe...@googlegroups.com.
Visit this group at https://groups.google.com/group/redbeanorm.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages