Re: [PHP-GTK] Reload/restart php-gtk program
by Marc Quinton other posts by this author
Aug 8 2007 2:59AM messages near this date
Re: [PHP-GTK] Reload/restart php-gtk program
|
Re: [PHP-GTK] Reload/restart php-gtk program
On 8/7/07, Peter Smith <smithpdo@[...].com> wrote:
>
> I would like to reload and restart a php-gtk program after the program has
> downloaded an updated version of itself. I visualise a dialog informing the
> user that an updated version has been installed and inviting him to click on
> a button to restart with the updated version of the program.
> How would you do this? I have a feeling the answer is painfully obvious but
> I can't see it.
> Peter.
I have a fully functionnal php-gtk application doing that task :
- check for updates in background,
- if update is available, notify user with a message in statusbar,
- then user only has to click Update button.
- this software is locate here : http://php.classes.free.fr/php/gtk/EasyTunes/
- there is a screenshot but not some showing updates.
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
for your information, update checking is done with lib/Update.php
class. We just need to compare
a file containing local version against latest version available on
remote site. Software version is
handled in a pure text file.
--
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
|