Thanks Stephen. I'd build a full working app. I took the challenge. Hi euromark, your tutorial seems hard for me. I dare not take the risks changing stuff too much maybe I should get more familiar first. I'd check the link back. Thanks for it.
On Dec 23, 8:50 pm, euromark <[email protected]> wrote: > http://www.dereuromark.de/2010/08/17/development-vs-productive-setup/ > as you can see my app switches the configs based on the server > > it is even possible to select a specific datasource in the controller > actions etc. > for twitter datasources, for example. > > you can also see that i use a special prefix for testing > (if you use the default config your "app" tables get filled with > testing stuff > you really would want to avoid that! I once tried that and it even > deleted some of the tables completely (with all data of course). > > On 23 Dez., 13:31, John Maxim <[email protected]> wrote: > > > class DATABASE_CONFIG { > > > var $default = array( > > 'driver' => 'mysql', > > 'persistent' => false, > > 'host' => 'localhost', > > 'login' => 'root', > > 'password' => '', > > 'database' => 'blog', > > 'prefix' => '', > > ); > > > var $test = array( > > 'driver' => 'mysql', > > 'persistent' => false, > > 'host' => 'localhost', > > 'login' => 'user', > > 'password' => 'password', > > 'database' => 'test_database_name', > > 'prefix' => '', > > ); > > > } > > > ------------------------------------------------- > > Dear veterans, > > > Above is a sample database configuration. Can we set it to connect to > > more than a database ? Is it fixed to only one ? What I learned is > > Cake uses the default array by the name; whatever setting inside, var > > $default = array(); > > > What's the second array for?, var $test = array(); ? I accidentally > > entered some wrong setting for this second array and it doesn't affect > > the $default performance. Explanation ? > > > If I want to test many tutorials' codes, I would not be able to change > > the default setting to another database, hence creating another table, > > e.g. Members, instead of Users if I already have Users table in the > > existing database which my Cake's default config is pointing to. > > Therefore, the Controller, Model, and View would all have to be > > different, by the file named, e.g., controllers > > \members_controller.php, models\member.php, views\members\index.ctp > > > Is this how we test codes? because it may flood the MVC with many > > names that may not be reflective, e.g. what if I am testing the 3rd > > code by the table name Users as well ? and the 4th code with same > > table's name.. and so on..? > > > How do we usually go about this, suggested way? > > > Thanks in advance. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
