This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use Stack Overflow.

No connection params set for symfony in Propel.php line 476

Discussion around this tutorial for symfony 1.0.x

No connection params set for symfony in Propel.php line 476

by tm1978 » Wed Mar 18, 2009 9:21 pm

I have already look through similiar topics on the forum, but they are all not applicable for my case here.

What are the files that are used by Propel.php

So far I have changed all files in apps/frontend/config and in the config directory at the top level.

Thanks!
tm1978
Junior Member
 
Posts: 24
Joined: Wed Mar 18, 2009 11:54 am

Re: No connection params set for symfony in Propel.php line 476

by tm1978 » Wed Mar 18, 2009 10:13 pm

Code: Select all
   */
  public static function getConnection($name = null) {

          if ($name === null) {
                  $name = self::getDefaultDB();
          }

          $con = isset(self::$connectionMap[$name]) ? self::$connectionMap[$name] : null;


          if ($con === null) {


                  $dsn = isset(self::$configuration['datasources'][$name]['connection']) ? self::$configuration['datasources'][$name]['connection'] : null;

                  print_r(self::$configuration['datasources']);

                  if ($dsn === null) {
                          throw new PropelException("No connection params set for " . $name);
                  }




Some lines before the output is:

Array ( [propel] => Array ( [adapter] => mysql [connection] => Array ( [phptype] => mysql [hostspec] => localhost [database] => askeet [username] => root [password] => [port] => [encoding] => [persistent] => [protocol] => [socket] => [compat_assoc_lower] => 1 [compat_rtrim_string] => 1 ) ) [default] => propel )

Although I have set it to other mysql details.
tm1978
Junior Member
 
Posts: 24
Joined: Wed Mar 18, 2009 11:54 am

Re: No connection params set for symfony in Propel.php line 476

by tm1978 » Wed Mar 18, 2009 10:20 pm

config/propel.ini

propel.database.createUrl = mysql://mysql5.hosting.com/
propel.database.url = mysql://db228544_11@mysql5.hosting.com

apps/frontend/config/databases.yml
/db228544_11

all:
propel:
class: sfPropelDatabase
param:
phptype: mysql
hostspec: mysql5.hosting.com
database: db228544_11
username: db228544_11
password: password
compat_assoc_lower: true
compat_rtrim_string: true
tm1978
Junior Member
 
Posts: 24
Joined: Wed Mar 18, 2009 11:54 am

Re: No connection params set for symfony in Propel.php line 476

by cokker » Thu Mar 19, 2009 10:37 am

Nice that you provided an error message and it obviously has to do with propel, but what do you tried to do?

create model?
have this error during usage?

greets
Sven
cokker
Faithful Member
 
Posts: 591
Joined: Mon Jan 15, 2007 10:43 am
Location: Germany

Re: No connection params set for symfony in Propel.php line 476

by tm1978 » Thu Mar 19, 2009 12:10 pm

I have checked out the Askeet project and try to get it to work.....that's all :)~ :-)~ :smile: But turns out to be tricky...

My question would be....where does Propel.php load the config files from? Then I just look for the file and change it.

Or is there a hard-coded overrwrite with default values that are in no properties file?

I also can not access www.domain.com/askeet, only www.domain.com/askeet/index.php then comes an error and the erroa above is from the log file...so I try to find out why askeet can not find/pass the connection parameters correctly...
tm1978
Junior Member
 
Posts: 24
Joined: Wed Mar 18, 2009 11:54 am

Re: No connection params set for symfony in Propel.php line 476

by cokker » Thu Mar 19, 2009 12:51 pm

Somehow I don't get it.

How do you try to get it work? Which commands are you running? What error messages do you get? How looks your config/databases.yml?

greets
Sven
cokker
Faithful Member
 
Posts: 591
Joined: Mon Jan 15, 2007 10:43 am
Location: Germany

Re: No connection params set for symfony in Propel.php line 476

by tm1978 » Thu Mar 19, 2009 1:37 pm

I just downloaded it...I did not run any commands.

First I changed the database settings in the files.

Then I even run the build-all command to generate the databse tables.
tm1978
Junior Member
 
Posts: 24
Joined: Wed Mar 18, 2009 11:54 am

Re: No connection params set for symfony in Propel.php line 476

by cokker » Thu Mar 19, 2009 1:53 pm

And no errors to this point right?

Now you are trying to access the page and get the error.Do you have in your database.yml a connection "symfony" defined?

greets
Sven
cokker
Faithful Member
 
Posts: 591
Joined: Mon Jan 15, 2007 10:43 am
Location: Germany

Re: No connection params set for symfony in Propel.php line 476

by tm1978 » Thu Mar 19, 2009 8:02 pm

See above:

config/propel.ini

propel.database.createUrl = mysql://mysql5.hosting.com/
propel.database.url = mysql://db228544_11@mysql5.hosting.com

apps/frontend/config/databases.yml
/db228544_11

all:
propel:
class: sfPropelDatabase
param:
phptype: mysql
hostspec: mysql5.hosting.com
database: db228544_11
username: db228544_11
password: password
compat_assoc_lower: true
compat_rtrim_string: true
tm1978
Junior Member
 
Posts: 24
Joined: Wed Mar 18, 2009 11:54 am

Re: No connection params set for symfony in Propel.php line 476

by tm1978 » Thu Mar 19, 2009 8:14 pm

{sfException} No connection params set for symfony in /kunden/228544_80469/webseiten/askeet/lib/vendor/symfony/lib /vendor/propel/Propel.php line 483
tm1978
Junior Member
 
Posts: 24
Joined: Wed Mar 18, 2009 11:54 am

Re: No connection params set for symfony in Propel.php line 476

by cokker » Fri Mar 20, 2009 8:11 am

Have you read my question? Have you a connection named "symfony" ?
Obviously not.

so try to add the following under all:

Code: Select all
symfony:
  class: sfPropelDatabase
  param:
    phptype: mysql
    hostspec: mysql5.hosting.com
    database: db228544_11
    username: db228544_11
    password: password


I would prefer the following:
Code: Select all
symfony:
  class: sfPropelDatabase
  param:
    class:          sfPropelDatabase
    param:
      dsn:          mysql://username:pw@localhost/dbname


greets
Sven
cokker
Faithful Member
 
Posts: 591
Joined: Mon Jan 15, 2007 10:43 am
Location: Germany

Re: No connection params set for symfony in Propel.php line 476

by tm1978 » Fri Mar 20, 2009 12:22 pm

Thanks, it is working now after clearing the cache.

However, I have not changed this and it is still propel and not symfony at this line!
tm1978
Junior Member
 
Posts: 24
Joined: Wed Mar 18, 2009 11:54 am