ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> php-gtk-general
php-gtk-general
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

Privacy Policy | Email Opt-out | Feedback | Syndication
© 2004 ActiveState, a division of Sophos All rights reserved