From 9f382150234e6ce398ec4519d1033e476d4b47f0 Mon Sep 17 00:00:00 2001 From: Jordan Lev Date: Sun, 15 May 2011 17:03:48 -0700 Subject: configure() function can now accept an array of settings (also updated README to reflect this) --- README.markdown | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'README.markdown') diff --git a/README.markdown b/README.markdown index 2e6e6b5..2b31155 100644 --- a/README.markdown +++ b/README.markdown @@ -391,6 +391,10 @@ Other than setting the DSN string for the database connection (see above), the ` ORM::configure('setting_name', 'value_for_setting'); +A shortcut is provided to allow passing multiple key/value pairs at once. + + ORM::configure(array('setting_name_1' => 'value_for_setting_1', 'setting_name_2' => 'value_for_setting_2', 'etc' => 'etc')); + #### Database authentication details #### Settings: `username` and `password` @@ -401,6 +405,10 @@ Some database adapters (such as MySQL) require a username and password to be sup ORM::configure('username', 'database_user'); ORM::configure('password', 'top_secret'); +Or you can combine the connection setup into a single line using the configuration array shortcut: + + ORM::configure(array('connection_string' => 'mysql:host=localhost;dbname=my_database', 'username' => 'database_user', 'password' => 'top_secret')); + #### PDO Driver Options #### Setting: `driver_options` -- cgit v1.2.3