Re: PHP-Gtk use in companies
| From: | Benjamin Smith | Date: | Wed, 17 Nov 2004 04:10:17 +0000 |
| Subject: | Re: PHP-Gtk use in companies | ||
| References: | 1 2 3 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-5245@lists.php.net to get a copy of this message | ||
On Sunday 14 November 2004 05:00, Jeremy Johnstone wrote:
> > > 1.) Automatic Live Update via Internet. This allows the application to
> > > be updated via the web similar to how WindowsUpdate does for Windows.
> > > I also have a PHP shell script which automates the transfer of files
> > > from CVS, builds the update information package, and stores them on
> > > the update server for usage by the app.
> >
> > Which protocol do you use resp. which file format to discover if new
> > versions are available and where to download them?
Geez - I did it stupid-simple. I wrote two NSIS installers, a
"software-version.exe" and a "software-version-update.exe".
In the PHP code is a simple variable, called $version. EG:
$version="4.1.27";
I have a stupid-simple web-page of just the version number. A few lines of
code is all it takes to download the 8-byte webpage (or fail quietly) and
prompt to update if appropriate.
Something like
If (!$fp=fsockopen("http://server.com/path/to/webpage.html"))
return true;
$serverversion=trim(fgets($fp, 1024));
if ($serverversion && $serverversion!=$version)
return Prompt2update();
When it updates, it downloads the "update" installer from the same website.
The update script ONLY contains the PHP code, not the php.exe binary or dll
files, all of which rarely change. This makes an average update take around a
MB.
-Ben
--
"I kept looking around for somebody to solve the problem.
Then I realized I am somebody"
-Anonymous