Re: local configuration file
Now it's working! Here is my code: /myconfig.php: /app/config/bootstrap.php: if (file_exists(ROOT.'/myconfig.php')) { include_once ROOT.'/myconfig.php'; } Now I can use my defines everywhere in the app. For example in the database.php: var $default = array('driver' => 'mysql', 'connect' => 'mysql_connect', 'host' => MYSQL_HOST, 'login' => MYSQL_LOGIN, 'password' => MYSQL_PASSWORD, 'database' => MYSQL_DATABASE, 'prefix' => ''); Thanks for the help! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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 -~--~~~~--~~--~--~---
Re: local configuration file
> But this doesn't work. All I get is a blank page. This blank page was in debug level 0. With debug level 3 I get the message: Parse error: parse error in /app/config/database.php on line 60 Missing Database Connection: ConnectionManager requires a database connection Seems like the vars are not working in the database.php --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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 -~--~~~~--~~--~--~---
Re: local configuration file
> But this doesn't work. All I get is a blank page. This blank page was in debug level 0. With debug level 3 I get the message: Parse error: parse error in /bild/adjust/asw/kora/app/config/database.php on line 60 Missing Database Connection: ConnectionManager requires a database connection Seems like the vars are not working in the database.php --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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 -~--~~~~--~~--~--~---
Re: local configuration file
Hi, thanks for the hint! > if (file_exists(ROOT . 'myconfig.php')) { > include_once ROOT . 'myconfig.php'; The only problem I have right now is, that I want to all the database settings in my own config file. And the database.php in /app/config uses the vars in my config file. I would like to have it like that: /myconfig.php: $host='localhost'; $login='user'; $password='password'; $database='database'; /app/config/database.php: var $default = array('driver' => 'mysql', 'connect' => 'mysql_connect', 'host' => $host, 'login' => $login, 'password' => $password, 'database' => $database, 'prefix' => ''); But this doesn't work. All I get is a blank page. Thanks, Felix --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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 -~--~~~~--~~--~--~---
Re: local configuration file
Hi Felix, Take a look at app/config/bootstrap.php. This is the application specific bootstrap that gets called after cake's own bootstrap (it's all in the comments) so you can use it to include everything you need. You'll probably do something like: if (file_exists(ROOT . 'myconfig.php')) { include_once ROOT . 'myconfig.php'; } Btw, if you want to use other config files that you can place in app/config you can use the config() function from cake/basics.php Cheers! On Dec 7, 7:46 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi there, > > The filter or config table idea sounds good, but I need it very simple! > > My folder structure looks like this: > > >app > >cake > >vendorsindex.php > myconfig.php > > In the "myconfig.php" I want to put all variables, including the > Database connection in the /app/config/database.php. The customer needs > a file, which he can find very fast. And all the important variables > are in there. > > Could I maybe include the myconfig.php in the bootstrap.php? > > Can someone give me a hint? > > Thanks Felix --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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 -~--~~~~--~~--~--~---
Re: local configuration file
Hi there, The filter or config table idea sounds good, but I need it very simple! My folder structure looks like this: >app >cake >vendors index.php myconfig.php In the "myconfig.php" I want to put all variables, including the Database connection in the /app/config/database.php. The customer needs a file, which he can find very fast. And all the important variables are in there. Could I maybe include the myconfig.php in the bootstrap.php? Can someone give me a hint? Thanks Felix --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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 -~--~~~~--~~--~--~---
Re: local configuration file
hey Felix, I actually have included some config tables (config groups, config options, and config choices) in my installation that I have given my users access to. I define what values they can configure and then I include my ConfigOption model in any controller that I might require it. this way I allow my users to change certain values that i then use throughout my application. for the moment it is purely including those models which makes it possible, but down the track it would be cool to turn it in to a plugin. i haven't broached that area yet so look forward to it. this might be something you could do if you would like configuration values that are modifiable by your end user. HTH mikee On 04/11/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > I would like to have the config file toplevel, so that the user can > access the variables very easily in that config file. > > Is it possible to put a config file ito that folder and does that make > sense thinking about the cakePHP idea? > > Thanks, > Felix > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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 -~--~~~~--~~--~--~---
Re: local configuration file
I would like to have the config file toplevel, so that the user can access the variables very easily in that config file. Is it possible to put a config file ito that folder and does that make sense thinking about the cakePHP idea? Thanks, Felix --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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 -~--~~~~--~~--~--~---
Re: local configuration file
hey felix, i believe the bootstrap.php file is commonly used for this kind of function. outside of the CakePHP global variables already in place of course. cheers, mikee On 23/10/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Hi there, > > where should I save a local config-file, in which I save all the global > vars and so on? > > Thanks > > Felix > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
local configuration file
Hi there, where should I save a local config-file, in which I save all the global vars and so on? Thanks Felix --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---