Forum Moderators: coopster

Message Too Old, No Replies

PHP file modifying itself or open files?

         

benj0323

7:15 am on Sep 1, 2005 (gmt 0)

10+ Year Member



Thanks for your time in advance. Any help I can get on this issue is greatly appreciated.

I spent a few months writing software for my company and now its all said and done. This software is going to be on servers all over the world. So in order to keep my software up to date I wrote an update system for it. Each copy of my software will communicate back to our update server to check for updates. If there are updates, the update server will send back php code for it to parse/evaluate. This code is what performs the updates.

So lets say I want to update the file thats evaluating the code and performing the updates.

Is this possible?

I heard that files are loaded into the RAM upon execution and therefore you are able to edit the file. I'm pretty sure this is true in linux machines, but I wasnt sure if it was true for windows or other server OS's.

Thanks a lot.

mcibor

7:38 am on Sep 1, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It's possible on every machine, because every one uses RAM or virtual RAM.

But if it won't work you can have a go around - create a new file that will update everything, then execute it (eg. by redirection) and delete it (unlink [php.net])

Hope this helps
Michal Cibor