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 » Update YML from php
Update YML from php [message #72220] Thu, 12 February 2009 14:10 Go to next message
yonialhadeff  is currently offline yonialhadeff
Messages: 37
Registered: February 2008
Member
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
Re: Update YML from php [message #72404 is a reply to message #72220 ] Sat, 14 February 2009 10:14 Go to previous messageGo to next message
cokker  is currently offline cokker
Messages: 582
Registered: January 2007
Location: Germany
Faithful Member
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
Re: Update YML from php [message #72446 is a reply to message #72404 ] Sat, 14 February 2009 16:47 Go to previous messageGo to next message
yonialhadeff  is currently offline yonialhadeff
Messages: 37
Registered: February 2008
Member
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
Re: Update YML from php [message #72527 is a reply to message #72446 ] Mon, 16 February 2009 07:35 Go to previous messageGo to next message
cokker  is currently offline cokker
Messages: 582
Registered: January 2007
Location: Germany
Faithful Member
yonialhadeff


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



Have you looked at the function? You would know the answer. Dump only produces a yml-string from an array. You have to put the string into the file yourself.

Quote:


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
Re: Update YML from php [message #72570 is a reply to message #72527 ] Mon, 16 February 2009 13:59 Go to previous messageGo to next message
yonialhadeff  is currently offline yonialhadeff
Messages: 37
Registered: February 2008
Member
Hello,

Thanks for your answers

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

I will manage it

Yoni
Re: Update YML from php [message #103319 is a reply to message #72220 ] Fri, 30 July 2010 18:35 Go to previous message
matz  is currently offline matz
Messages: 32
Registered: March 2010
Member
yonialhadeff you had success?
Previous Topic:Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 19456 bytes) in /hom
Next Topic:[SOLVED] One problem while performing inserts
Goto Forum:
  

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