File: Gtk2.php
Source Location: /PEAR_PackageUpdate_Gtk2-0.3.2/Gtk2.php
Page Details:
A package to make adding self updating functionality to other PHP-GTK 2 packages easy.
This is a PHP-GTK 2 driver for PEAR_PackageUpdate. The interface for this package must allow for the following functionality: - allow user to confirm or cancel upgrade
- download and install the package
- don't ask again
- don't ask until next release
- only ask for state XXXX or higher
- update channel automatically
- PHP-GTK/CLI apps must exit to allow classes to reload
- web front end could send headers to reload certain page
This class is simply a wrapper for PEAR classes that actually do the work.EXAMPLE: <?php
class Goo {
function __construct()
{
// Check for updates...
require_once 'PEAR/PackageUpdate.php';
$ppu =& PEAR_PackageUpdate::factory('Gtk2', '@package@', '@channel@');
if ($ppu !== false) {
if ($ppu->checkUpdate()) {
// Use a dialog window to ask permission to update.
if ($ppu->presentUpdate()) {
if ($ppu->update()) {
// If the update succeeded, the application should
// be restarted.
$ppu->forceRestart();
}
}
}
}
// ...
}
// ...
}
?>
Includes:
require_once('PEAR/PackageUpdate.php') [line 64]
Documentation generated on Mon, 11 Mar 2019 14:44:36 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|