symfony is hallucinating connection name [closed]
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
精彩评论