PEAR_PackageUpdate_Gtk2
[ class tree: PEAR_PackageUpdate_Gtk2 ] [ index: PEAR_PackageUpdate_Gtk2 ] [ all elements ]

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:

          1.  <?php
          2.   class Goo {
          3.       function __construct()
          4.       {
          5.           // Check for updates...
          6.           require_once 'PEAR/PackageUpdate.php';
          7.           $ppu =PEAR_PackageUpdate::factory('Gtk2''@package@''@channel@');
          8.           if ($ppu !== false{
          9.               if ($ppu->checkUpdate()) {
          10.                   // Use a dialog window to ask permission to update.
          11.                   if ($ppu->presentUpdate()) {
          12.                       if ($ppu->update()) {
          13.                           // If the update succeeded, the application should
          14.                           // be restarted.
          15.                           $ppu->forceRestart();
          16.                       }
          17.                   }
          18.               }
          19.           }
          20.           // ...
          21.       }
          22.       // ...
          23.   }
          24.  ?>

          • Author: Scott Mattocks
          • Version: 0.3.2
          • Copyright: Copyright 2006 Scott Mattocks
          • License: PHP

          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.