Re: [PHP-GTK] Reload/restart php-gtk program
[email protected] (Elizabeth Smith)
| Newsgroups | php.gtk.general |
|---|---|
| Message-ID | <[email protected]> |
> the interesting part is method lib/FreeTunesGui.php
>
> # just after update, reload a new process (just like shell
> exec) ; current process give up, a new one is created
> protected function reload(){
> $this->main_quit();
> $cmd = DIR . '/easy-tunes';
> $args = array();
> pcntl_exec($cmd ,$args, $_ENV);
> }
>
> here, we restart a new process (with GUI) ; this is the shell
> equivalent of : exec $cmd
Except for the fact that this requires pcntl which is not available on
windows (and never will be) which kills the "cross platform" magic
You can do the same thing by using popen followed immediately by pclose
(spawns the process just as well) and die and add a lock check when
writing files to make sure the original process has shut down.