Re: Howto implement atomical actions
| From: | Richard Lynch | Date: | Sun, 12 Jun 2005 01:14:05 +0000 |
| Subject: | Re: Howto implement atomical actions | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-216853@lists.php.net to get a copy of this message | ||
On Sat, June 11, 2005 6:46 am, Andy Pieters said:
> I am developing a web interface to patch a program. The user uploads the
> patch and after uncompressing and verification of signature, the update
> should take place. However I do not want users to be able to start an
> update
> and then abort the process by stopping to load the page.
>
> I imagine that by calling a program externally from php that it would be
> possible but there are limitations because of the distribution. The
> systems
> are installed on php+mysql+apache servers but no shell access is granted.
Perhaps it would be best to take PHP out of the picture entirely after the
upload.
For example, upload to a temporary directory, and, as your last PHP step,
use http://php.net/rename to move the uploaded file to a
"to_be_installed"
directory.
Then you can have cron job 2 minutes that installs anything it finds in
that directory.
At that point, nothing the user can do can interfere.
That wouldn't necessarily make the operation atomic...
What makes a "patch" atomic?...
You'd be looking at something like subversion for that, I should think...
I don't think even tar -xzf guarantees atomicity, but I dunno.
--
Like Music?
http://l-i-e.com/artists.htm