This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Home » legacy support » symfony 1.2 » app.yml parameters in Tasks
app.yml parameters in Tasks [message #73129] Sun, 22 February 2009 19:39 Go to next message
onlydust  is currently offline onlydust
Messages: 47
Registered: May 2008
Member
Hello,
I try to sending emails from symfony project with task executed in cron. My problem is, when i try to get some application variables(sender email for example) from app.yml i can not get its value. When i write:
sfConfig::get('app_sender_email')

i get NULL value.
Tasks can not take values from app.yml ?
Sorry for my english.
Re: app.yml parameters in Tasks [message #79260 is a reply to message #73129 ] Tue, 02 June 2009 01:01 Go to previous messageGo to next message
yonialhadeff  is currently offline yonialhadeff
Messages: 37
Registered: February 2008
Member
Hello,

Does anyone find a solution for that ?

Thanks

Yoni
Re: app.yml parameters in Tasks [message #79261 is a reply to message #79260 ] Tue, 02 June 2009 01:08 Go to previous messageGo to next message
yonialhadeff  is currently offline yonialhadeff
Messages: 37
Registered: February 2008
Member
Hello,

I found the answer.

When you load a task, there is no application defined.

so you cannot get any app.yml definition.


for that you need to specify an application when you call the tasks ex:

symfony project:do-nothing --application="frontend"


and then you will be able to get the value of sfConfig::get('app_sender_email')

It should be possible to setup a default application, but i didn't find it out.

Enjoy

Yoni
Re: app.yml parameters in Tasks [message #79265 is a reply to message #79261 ] Tue, 02 June 2009 06:39 Go to previous messageGo to next message
onlydust  is currently offline onlydust
Messages: 47
Registered: May 2008
Member
THANKS!
Re: app.yml parameters in Tasks [message #102377 is a reply to message #73129 ] Mon, 12 July 2010 18:05 Go to previous message
I30bby  is currently offline I30bby
Messages: 1
Registered: July 2010
Location: Montreal, QC, CA
Junior Member
To setup a default application, you can simply modify your 'configure' function like this :

protected function configure()
{
...
...
$this->addOptions(array(
new sfCommandOption('application', null, sfCommandOption::PARAMETER_REQUIRED, 'The application name', 'frontend'),
new sfCommandOption('env', null, sfCommandOption::PARAMETER_REQUIRED, 'The environment', 'dev'),
new sfCommandOption('connection', null, sfCommandOption::PARAMETER_REQUIRED, 'The connection name', 'doctrine'),
// add your own options here
));


Si le problème a une solution, il ne sert à rien de s'inquiéter. Mais s'il n'en a pas, alors s'inquiéter ne change rien.
Previous Topic:propel:insert-sql doesn't work anymore since php 5.3
Next Topic:sfGuard cache problem
Goto Forum:
  

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software