Update YML from php

Discussion relating to version 1.2.x stable

Update YML from php

Postby yonialhadeff » Thu Feb 12, 2009 3:10 pm

Hello,

is there a way to update in the daily way the file app.YML

I have some variable that has to be change each days, like a sessionId that i use for a webservice,

I though to put this information into the app.yml, but how can i change it through batch php file ?

Thanks

Yoni
yonialhadeff
Member
 
Posts: 38
Joined: Thu Feb 21, 2008 1:21 pm

Re: Update YML from php

Postby cokker » Sat Feb 14, 2009 11:14 am

Have a look at sfYaml.php. There you have a dump and a load function. So in your batch you could load current app.yml, change the value and dump it back into file.

Alternatively you could simply change the content of the file. Just like you want.

If you put this as a cron job it also works daily.

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

Re: Update YML from php

Postby yonialhadeff » Sat Feb 14, 2009 5:47 pm

Hello,

So the dump method, will overwrite the app.yml file, and will also put the new version in the cache ?

because the problem is not really to update the app.yml, it's to put the new version in the cache, if the cache has already been created!

Thanks

Yoni
yonialhadeff
Member
 
Posts: 38
Joined: Thu Feb 21, 2008 1:21 pm

Re: Update YML from php

Postby cokker » Mon Feb 16, 2009 8:35 am


because the problem is not really to update the app.yml, it's to put the new version in the cache, if the cache has already been created!


Have you tried to clear the cache manually? Use the symfony command or delete it yourself. The cache is rebuild automatically.

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

Re: Update YML from php

Postby yonialhadeff » Mon Feb 16, 2009 2:59 pm

Hello,

Thanks for your answers

I though it will be any function that will delete the cache by itself.

I will manage it

Yoni
yonialhadeff
Member
 
Posts: 38
Joined: Thu Feb 21, 2008 1:21 pm

Re: Update YML from php

Postby matz » Fri Jul 30, 2010 6:35 pm

yonialhadeff you had success?
matz
Member
 
Posts: 32
Joined: Tue Mar 16, 2010 6:54 pm


Return to symfony 1.2

Who is online

Users browsing this forum: No registered users and 0 guests