Re: A Deeper Insights to Database Config Settings

2010-12-27 Thread John Maxim
>  create separate apps which use separate dbs, not one app where you
>  test everything; check the book re useDbConfig; follow a tutorial
>  demonstrating how to use the test suite. with that your question
>  regarding db config should be resolved.

I think I found it, isn't it this one? Testing 4.7
http://book.cakephp.org/view/1196/Testing

Thanks. Regards,

Maxim J.

On Dec 25, 9:05 pm, John Maxim  wrote:
> >check the book re useDbConfig; follow a tutorial
> > demonstrating how to use the test suite. with that your question
> > regarding db config should be resolved
>
> I just checked on: 3.7.8.1 useDbConfig.
>
> There isn't a tutorial on how to use the test suite.
>
> On Dec 25, 4:32 pm, John Maxim  wrote:
>
> > Hi euromark, thanks I'm going to abstain from judging which is better,
> > but let me do with the more common one first..
>
> > Hope that more veterans could rate this thread so we can know which
> > may be the better way. Anyway, it's good enough to work on one method
> > first.
>
> > On Dec 25, 10:50 am, euromark  wrote:
>
> > > @john
>
> > > its not a hack - not even closely
> > > its a valid and in my opinion very well working strategy which worked
> > > for several years
> > > and several apps which repeatedly need updates and stuff.
>
> > > in the end its sth you need to decide for yourself
> > > it also depends on the way you are deploying your apps.
> > > in my case this is the best approach.
> > > in other cases it might (as the others suggested) be less appropriate.
>
> > > so it was more like a suggestion than a "do it this way - its the only
> > > way" :)
>
> > > as a last word one example for the config and config_private settings
> > > and why this is useful:
> > > you always have a default set of configs in svn.
> > > if you would work with a single config file you might lose the
> > > information like
> > > §config = array('x'=>.., 'y'=>..., 'z'=>...)
> > > or at least you might forget about some keys
>
> > > for example if your PC crashes
> > > or you check out your rep on a different computer
>
> > > if you use a default config with empty values you can simply copy it,
> > > save it as config_private
> > > and you can override the empty strings with the real stuff.
> > > Nothing can be forgotten (and this can easily happen with larger
> > > config files!).
>
> > > Either way: Find your own style here :) I did it the hard way as well
>
> > > On 24 Dez., 17:01, John Maxim  wrote:
>
> > > > Hi AD, Thanks for commenting. It makes it clearer that now your
> > > > suggestion seems to be same as Stephen's. I don't have to fret which
> > > > other methods are better. But thanks too euromark, I'm just not good
> > > > at hacking.
>
> > > > >check the book re useDbConfig; follow a tutorial
> > > > > demonstrating how to use the test suite.
>
> > > > Is the book above the cookbook 1.3 or somewhere else ?
>
> > > > On Dec 24, 9:39 pm, AD7six  wrote:
>
> > > > > On Dec 24, 2:19 pm, euromark  wrote:
>
> > > > > > "but obviously you've already managed to mix your environment's 
> > > > > > data"
> > > > > > that was before I wrote my little addons :)
>
> > > > > > wrong! i do have different salts.
> > > > > > i just use a specific config_private (as explained somewhere in this
> > > > > > article) which
> > > > > > overrides the defaults.
>
> > > > > I do not think it better or easier to have database (all) + config
> > > > > (all) + config_private (install specific) + bootstrap (all)
>
> > > > > instead of database (install specific) + config (install specific) +
> > > > > bootstrap (all)
>
> > > > > I also don't see how your post is really relevant to John Maxim's
> > > > > question.
>
> > > > > in any event - if you're happy keep doing it, but I would bet over
> > > > > time you conclude as I did it's not a good idea/technique.
>
> > > > > John Maxim:
>
> > > > > create sepearte apps which use seperate dbs, not one app where you
> > > > > test everything; check the book re useDbConfig; follow a tutorial
> > > > > demonstrating how to use the test suite. with that your question
> > > > > regarding db config should be resolved.
>
> > > > > hth,
>
> > > > > AD

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: A Deeper Insights to Database Config Settings

2010-12-25 Thread John Maxim
>check the book re useDbConfig; follow a tutorial
> demonstrating how to use the test suite. with that your question
> regarding db config should be resolved

I just checked on: 3.7.8.1 useDbConfig.

There isn't a tutorial on how to use the test suite.


On Dec 25, 4:32 pm, John Maxim  wrote:
> Hi euromark, thanks I'm going to abstain from judging which is better,
> but let me do with the more common one first..
>
> Hope that more veterans could rate this thread so we can know which
> may be the better way. Anyway, it's good enough to work on one method
> first.
>
> On Dec 25, 10:50 am, euromark  wrote:
>
> > @john
>
> > its not a hack - not even closely
> > its a valid and in my opinion very well working strategy which worked
> > for several years
> > and several apps which repeatedly need updates and stuff.
>
> > in the end its sth you need to decide for yourself
> > it also depends on the way you are deploying your apps.
> > in my case this is the best approach.
> > in other cases it might (as the others suggested) be less appropriate.
>
> > so it was more like a suggestion than a "do it this way - its the only
> > way" :)
>
> > as a last word one example for the config and config_private settings
> > and why this is useful:
> > you always have a default set of configs in svn.
> > if you would work with a single config file you might lose the
> > information like
> > §config = array('x'=>.., 'y'=>..., 'z'=>...)
> > or at least you might forget about some keys
>
> > for example if your PC crashes
> > or you check out your rep on a different computer
>
> > if you use a default config with empty values you can simply copy it,
> > save it as config_private
> > and you can override the empty strings with the real stuff.
> > Nothing can be forgotten (and this can easily happen with larger
> > config files!).
>
> > Either way: Find your own style here :) I did it the hard way as well
>
> > On 24 Dez., 17:01, John Maxim  wrote:
>
> > > Hi AD, Thanks for commenting. It makes it clearer that now your
> > > suggestion seems to be same as Stephen's. I don't have to fret which
> > > other methods are better. But thanks too euromark, I'm just not good
> > > at hacking.
>
> > > >check the book re useDbConfig; follow a tutorial
> > > > demonstrating how to use the test suite.
>
> > > Is the book above the cookbook 1.3 or somewhere else ?
>
> > > On Dec 24, 9:39 pm, AD7six  wrote:
>
> > > > On Dec 24, 2:19 pm, euromark  wrote:
>
> > > > > "but obviously you've already managed to mix your environment's data"
> > > > > that was before I wrote my little addons :)
>
> > > > > wrong! i do have different salts.
> > > > > i just use a specific config_private (as explained somewhere in this
> > > > > article) which
> > > > > overrides the defaults.
>
> > > > I do not think it better or easier to have database (all) + config
> > > > (all) + config_private (install specific) + bootstrap (all)
>
> > > > instead of database (install specific) + config (install specific) +
> > > > bootstrap (all)
>
> > > > I also don't see how your post is really relevant to John Maxim's
> > > > question.
>
> > > > in any event - if you're happy keep doing it, but I would bet over
> > > > time you conclude as I did it's not a good idea/technique.
>
> > > > John Maxim:
>
> > > > create sepearte apps which use seperate dbs, not one app where you
> > > > test everything; check the book re useDbConfig; follow a tutorial
> > > > demonstrating how to use the test suite. with that your question
> > > > regarding db config should be resolved.
>
> > > > hth,
>
> > > > AD

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: A Deeper Insights to Database Config Settings

2010-12-25 Thread John Maxim
Hi euromark, thanks I'm going to abstain from judging which is better,
but let me do with the more common one first..

Hope that more veterans could rate this thread so we can know which
may be the better way. Anyway, it's good enough to work on one method
first.



On Dec 25, 10:50 am, euromark  wrote:
> @john
>
> its not a hack - not even closely
> its a valid and in my opinion very well working strategy which worked
> for several years
> and several apps which repeatedly need updates and stuff.
>
> in the end its sth you need to decide for yourself
> it also depends on the way you are deploying your apps.
> in my case this is the best approach.
> in other cases it might (as the others suggested) be less appropriate.
>
> so it was more like a suggestion than a "do it this way - its the only
> way" :)
>
> as a last word one example for the config and config_private settings
> and why this is useful:
> you always have a default set of configs in svn.
> if you would work with a single config file you might lose the
> information like
> §config = array('x'=>.., 'y'=>..., 'z'=>...)
> or at least you might forget about some keys
>
> for example if your PC crashes
> or you check out your rep on a different computer
>
> if you use a default config with empty values you can simply copy it,
> save it as config_private
> and you can override the empty strings with the real stuff.
> Nothing can be forgotten (and this can easily happen with larger
> config files!).
>
> Either way: Find your own style here :) I did it the hard way as well
>
> On 24 Dez., 17:01, John Maxim  wrote:
>
> > Hi AD, Thanks for commenting. It makes it clearer that now your
> > suggestion seems to be same as Stephen's. I don't have to fret which
> > other methods are better. But thanks too euromark, I'm just not good
> > at hacking.
>
> > >check the book re useDbConfig; follow a tutorial
> > > demonstrating how to use the test suite.
>
> > Is the book above the cookbook 1.3 or somewhere else ?
>
> > On Dec 24, 9:39 pm, AD7six  wrote:
>
> > > On Dec 24, 2:19 pm, euromark  wrote:
>
> > > > "but obviously you've already managed to mix your environment's data"
> > > > that was before I wrote my little addons :)
>
> > > > wrong! i do have different salts.
> > > > i just use a specific config_private (as explained somewhere in this
> > > > article) which
> > > > overrides the defaults.
>
> > > I do not think it better or easier to have database (all) + config
> > > (all) + config_private (install specific) + bootstrap (all)
>
> > > instead of database (install specific) + config (install specific) +
> > > bootstrap (all)
>
> > > I also don't see how your post is really relevant to John Maxim's
> > > question.
>
> > > in any event - if you're happy keep doing it, but I would bet over
> > > time you conclude as I did it's not a good idea/technique.
>
> > > John Maxim:
>
> > > create sepearte apps which use seperate dbs, not one app where you
> > > test everything; check the book re useDbConfig; follow a tutorial
> > > demonstrating how to use the test suite. with that your question
> > > regarding db config should be resolved.
>
> > > hth,
>
> > > AD

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: A Deeper Insights to Database Config Settings

2010-12-24 Thread euromark
@john

its not a hack - not even closely
its a valid and in my opinion very well working strategy which worked
for several years
and several apps which repeatedly need updates and stuff.

in the end its sth you need to decide for yourself
it also depends on the way you are deploying your apps.
in my case this is the best approach.
in other cases it might (as the others suggested) be less appropriate.

so it was more like a suggestion than a "do it this way - its the only
way" :)


as a last word one example for the config and config_private settings
and why this is useful:
you always have a default set of configs in svn.
if you would work with a single config file you might lose the
information like
§config = array('x'=>.., 'y'=>..., 'z'=>...)
or at least you might forget about some keys

for example if your PC crashes
or you check out your rep on a different computer

if you use a default config with empty values you can simply copy it,
save it as config_private
and you can override the empty strings with the real stuff.
Nothing can be forgotten (and this can easily happen with larger
config files!).

Either way: Find your own style here :) I did it the hard way as well


On 24 Dez., 17:01, John Maxim  wrote:
> Hi AD, Thanks for commenting. It makes it clearer that now your
> suggestion seems to be same as Stephen's. I don't have to fret which
> other methods are better. But thanks too euromark, I'm just not good
> at hacking.
>
> >check the book re useDbConfig; follow a tutorial
> > demonstrating how to use the test suite.
>
> Is the book above the cookbook 1.3 or somewhere else ?
>
> On Dec 24, 9:39 pm, AD7six  wrote:
>
>
>
>
>
>
>
> > On Dec 24, 2:19 pm, euromark  wrote:
>
> > > "but obviously you've already managed to mix your environment's data"
> > > that was before I wrote my little addons :)
>
> > > wrong! i do have different salts.
> > > i just use a specific config_private (as explained somewhere in this
> > > article) which
> > > overrides the defaults.
>
> > I do not think it better or easier to have database (all) + config
> > (all) + config_private (install specific) + bootstrap (all)
>
> > instead of database (install specific) + config (install specific) +
> > bootstrap (all)
>
> > I also don't see how your post is really relevant to John Maxim's
> > question.
>
> > in any event - if you're happy keep doing it, but I would bet over
> > time you conclude as I did it's not a good idea/technique.
>
> > John Maxim:
>
> > create sepearte apps which use seperate dbs, not one app where you
> > test everything; check the book re useDbConfig; follow a tutorial
> > demonstrating how to use the test suite. with that your question
> > regarding db config should be resolved.
>
> > hth,
>
> > AD

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: A Deeper Insights to Database Config Settings

2010-12-24 Thread John Maxim
Hi AD, Thanks for commenting. It makes it clearer that now your
suggestion seems to be same as Stephen's. I don't have to fret which
other methods are better. But thanks too euromark, I'm just not good
at hacking.

>check the book re useDbConfig; follow a tutorial
> demonstrating how to use the test suite.

Is the book above the cookbook 1.3 or somewhere else ?

On Dec 24, 9:39 pm, AD7six  wrote:
> On Dec 24, 2:19 pm, euromark  wrote:
>
> > "but obviously you've already managed to mix your environment's data"
> > that was before I wrote my little addons :)
>
> > wrong! i do have different salts.
> > i just use a specific config_private (as explained somewhere in this
> > article) which
> > overrides the defaults.
>
> I do not think it better or easier to have database (all) + config
> (all) + config_private (install specific) + bootstrap (all)
>
> instead of database (install specific) + config (install specific) +
> bootstrap (all)
>
> I also don't see how your post is really relevant to John Maxim's
> question.
>
> in any event - if you're happy keep doing it, but I would bet over
> time you conclude as I did it's not a good idea/technique.
>
> John Maxim:
>
> create sepearte apps which use seperate dbs, not one app where you
> test everything; check the book re useDbConfig; follow a tutorial
> demonstrating how to use the test suite. with that your question
> regarding db config should be resolved.
>
> hth,
>
> AD

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: A Deeper Insights to Database Config Settings

2010-12-24 Thread AD7six


On Dec 24, 2:19 pm, euromark  wrote:
> "but obviously you've already managed to mix your environment's data"
> that was before I wrote my little addons :)
>
> wrong! i do have different salts.
> i just use a specific config_private (as explained somewhere in this
> article) which
> overrides the defaults.

I do not think it better or easier to have database (all) + config
(all) + config_private (install specific) + bootstrap (all)

instead of database (install specific) + config (install specific) +
bootstrap (all)

I also don't see how your post is really relevant to John Maxim's
question.

in any event - if you're happy keep doing it, but I would bet over
time you conclude as I did it's not a good idea/technique.

John Maxim:

create sepearte apps which use seperate dbs, not one app where you
test everything; check the book re useDbConfig; follow a tutorial
demonstrating how to use the test suite. with that your question
regarding db config should be resolved.

hth,

AD

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: A Deeper Insights to Database Config Settings

2010-12-24 Thread euromark
"but obviously you've already managed to mix your environment's data"
that was before I wrote my little addons :)

wrong! i do have different salts.
i just use a specific config_private (as explained somewhere in this
article) which
overrides the defaults.
this is the only file that is actually unique per setting.
this way you have clean default values and you can override them in
the config_private
i do that with the salt, with my email configuration as well as the
google key or whatever.

in the long run it saves me a lot of trouble you might run into having
multiple files
to take care of.
i only have one (!) for each app (the config_private)

both the config.php and the config_private.php are NOT in svn/git -
all other files, though, are.

way cleaner than any other approach, in my opinion.


On 24 Dez., 09:31, AD7six  wrote:
> PS I don't understand this
>
> "you can also see that i use a special prefix for testing .."
>
> but obviously you've already managed to mix your environment's data -
> so surely you recognise the weakness in the technique.
>
> AD

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: A Deeper Insights to Database Config Settings

2010-12-24 Thread AD7six
PS I don't understand this

"you can also see that i use a special prefix for testing .."

but obviously you've already managed to mix your environment's data -
so surely you recognise the weakness in the technique.

AD

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: A Deeper Insights to Database Config Settings

2010-12-24 Thread AD7six


On Dec 24, 1:15 am, euromark  wrote:
> @AD
> the database.php is never included in any rep
> it is the same for all environments so you can just drag and drop it
> of COURSE this should be handled differently for ONLINE testing
> enviroments, i agree

Why make any excpetion what so ever. Sharing config files leads to
problems, it's about that simple.

>
> but it doesnt hurt to have the same file for local dev and live stage
> and the core is the same as well of course. do you have a custom
> core.php file for each environment?

Yes.

How many times have you accidentally changed your debug setting on
your  setup? Why are the security salts the same in
all environments? Same argument for other settings - such as in my
case: concatenate css/js files, live:yes everywhere else: no but
there's no IF in the core file they're simply not the same contents.

Perhaps this is more of a windows v linux thing, but imo "git pull" is
the only server side upgrade mechanism you really need (whether you
use something else to do it for you like capistrano - is up to you)
and any drag and drop usage means a) manual process b) error prone

hth,

AD

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: A Deeper Insights to Database Config Settings

2010-12-23 Thread euromark
@AD
the database.php is never included in any rep
it is the same for all environments so you can just drag and drop it
of COURSE this should be handled differently for ONLINE testing
enviroments, i agree

but it doesnt hurt to have the same file for local dev and live stage
and the core is the same as well of course. do you have a custom
core.php file for each environment?



On 23 Dez., 19:56, cricket  wrote:
> On Thu, Dec 23, 2010 at 10:40 AM, AD7six  wrote:
>
> > IMO what you're solving in the article is a hack for simply /not/
> > using the same database.php (and core.php for that matter) file in all
> > environments. Just don't add it to your repo, don't send it if you're
> > ftp/rsyncing files around, setup on first use and the problem of "what
> > evironment should I use" goes away.
>
> Also, it's worth changing the owner & permissions on these two files
> so that you can't accidentally overwrite them with rsync/ftp, but only
> directly edit them using sudo in an ssh session.

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: A Deeper Insights to Database Config Settings

2010-12-23 Thread cricket
On Thu, Dec 23, 2010 at 10:40 AM, AD7six  wrote:
>
> IMO what you're solving in the article is a hack for simply /not/
> using the same database.php (and core.php for that matter) file in all
> environments. Just don't add it to your repo, don't send it if you're
> ftp/rsyncing files around, setup on first use and the problem of "what
> evironment should I use" goes away.

Also, it's worth changing the owner & permissions on these two files
so that you can't accidentally overwrite them with rsync/ftp, but only
directly edit them using sudo in an ssh session.

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: A Deeper Insights to Database Config Settings

2010-12-23 Thread AD7six


On Dec 23, 1:50 pm, euromark  wrote:
> http://www.dereuromark.de/2010/08/17/development-vs-productive-setup/

FWIW I used to do the above sort of thing and would say now: bad
idea.

Why should your test/staging/live site know or have you development db
connection data. why should your staging site have your live db
connection settings.

To use a recent and relevant examlpe: Think about what happend to
github recently - through a series of errors the live db got truncated
from running a test on a CI server (https://github.com/blog/744-today-
s-outage) - that's only possible if the CI server has the access to
the live db - which by design you're providing if you provide with the
above example.

IMO what you're solving in the article is a hack for simply /not/
using the same database.php (and core.php for that matter) file in all
environments. Just don't add it to your repo, don't send it if you're
ftp/rsyncing files around, setup on first use and the problem of "what
evironment should I use" goes away.

The technique is certainly useful - but not IMO for the use given.

AD

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: A Deeper Insights to Database Config Settings

2010-12-23 Thread John Maxim
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  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  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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: A Deeper Insights to Database Config Settings

2010-12-23 Thread euromark
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  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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: A Deeper Insights to Database Config Settings

2010-12-23 Thread Stephen
Hi John

You have 2 databases, one is your development/production database
($default), the other is your test environment (For testing your app).

See: http://book.cakephp.org/view/1196/Testing

You can change the driver of your connection, i.e. use sqlite rather than
mysql

As for testing users and then members, it sounds like you're just playing
with the code to become familiar.
This isn't the normal way, I would suggest building a full application and
challenge yourself to overcome obstacles.

-- 
Kind Regards
 Stephen @ NinjaCoderMonkey

 www.ninjacodermonkey.co.uk

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en