Re: [PHP-GTK] Reload/restart php-gtk program
by Elizabeth Smith other posts by this author
Aug 8 2007 5:54AM messages near this date
Re: [PHP-GTK] Reload/restart php-gtk program
|
Re: [PHP-GTK] Reload/restart php-gtk program
> 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.
--
PHP-GTK General Mailing List (http://gtk.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Thread:
Peter Smith
sebastianmarconi
Adrian Snyman
Marc Quinton
Elizabeth Smith
Bob Majdak Jr
Peter Smith
Bernard Fouche
Bob Majdak Jr
Bernard Fouche
|