开发者

symfony is hallucinating connection name [closed]

开发者_JS百科 This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 9 years ago.

Here is my config/databases.yml:

all:
  galapagos:
    class: sfDoctrineDatabase
    param:
      dsn:      mysql:host=localhost;dbname=galapagos
      username: galapagos
      password: U88rnh9#g
#  survey:
#    class: sfDoctrineDatabase
#    param:
#      dsn:      mysql:host=localhost;dbname=survey
#      username: survey
#      password: U88rnh9#s

As you can see, there's just one connection that's not commented out.

If I delete everything in cache/ and log/ and then run symfony doctrine:build-schema and symfony doctrine:build --all-classes, I get this error:

Unknown connection: survey

But I'm not mentioning survey anywhere!

My schema doesn't mention survey:

$ cat config/doctrine/schema.yml | grep survey
$

Interestingly, I don't get the error if I only run build-model. The error apparently only happens for build-forms and build-filters.

Why is this happening?


You need to remove corresponding doctrine_schema_xxxx.yml files in /tmp directory as well.


Got "Unknown connection: web" whenever I ran symfony doctrine:build-sql

Following on Anthony Martin, I perused my model doctrine classes and found at line 1 of one of them :

Doctrine_Manager::getInstance()->bindComponent('WsSessions', 'web');

Changing web into doctrine which was the actual name of db connection entered inside config/databases.yml, solved the problem !

[why on earth 'web' ever happened to be written there, don't ask me ;-)]


Went away on its own. Stupid problem, stupid solution.


I had a similar issue. To solve it I got rid of the doctrine classes for any tables I had created in the schema which were at one point using the connection. Then I ran php symfony doctrine:clean

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜