The "database name" you put as the argument of getDatabase method has to be the name in the database.yml file, not the actual database name.
By default, it's "doctrine" or "propel" depending of the ORM you're using. 2010/11/16 man mixi <[email protected]> > When there is access to external systems, using a task that I want to > log SymfonyDB access. > > When I execute "There is no open connection" that would have errors. > What did you do wrong? > > > $databaseManager = new sfDatabaseManager($this->configuration); > > $connection = $databaseManager->getDatabase('links')- > >getConnection(); > I tried to add code. > But still error occurs. > > 「 Database "links" does not exist.」 > "links" is correct DB name. > > > > C:\MyProject\link>php symfony link:access user01 111.111.111.111 > > #accessTask.class.php > <?php > > class accessTask extends sfBaseTask > { > public function configure() > { > $this->namespace = 'link'; > $this->name = 'access'; > $this->addArgument('username', sfCommandArgument::OPTIONAL); > $this->addArgument('ip', sfCommandArgument::OPTIONAL); > } > > public function execute($arguments = array(), $options = array()) > { > > $access = new Accesslog(); > $access->setUsername($arguments['username']); > $access->setIp($arguments['ip']); > $access->save(); > $this->log('access from '. $arguments['ip']); > } > } > > -- > If you want to report a vulnerability issue on symfony, please send it to > security at symfony-project.com > > You received this message because you are subscribed to the Google > Groups "symfony users" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected]<symfony-users%[email protected]> > For more options, visit this group at > http://groups.google.com/group/symfony-users?hl=en > -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
