Proposal for "PEAR_PackageUpdate"

» Metadata » Status
» Description
Summary
PEAR_PackageUpdate (PPU) is designed to allow developers to easily include auto-updating features for other packages and PEAR installable applications. PPU will check to see if a new version of a package is available and then ask the user if they would like to update the package. PPU uses PEAR to communicate with the channel server and to execute the update.

PPU is just an engine for package updating. It should not be used directly. Instead one of the driver packages such as PEAR_PackageUpdate_Gtk2 should be used depending on the application/package.

Preferences
PPU allows the end user to take some control over when they are notified about new releases. The PPU Preferences allow a user to tell PPU not to ask about certain types of releases (bug fixes, minor releases, etc.), not to ask about certain release states (devel, alpha, etc.), not to ask until the next release or not to ask again.

User preferences are saved in ~/.ppurc (or an equivilent file on Windows).

Example

<?php
class Goo {
function __construct()
{
// Check for updates...
require_once 'PEAR/PackageUpdate.php';
$ppu =& PEAR_PackageUpdate::factory('Gtk2', 'Goo', 'pear');
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->forceExit();
}
}
}
}
// ...
}
// ...
}
?>


Note: Please see PEAR_PackageUpdate_Gtk2.
» Dependencies » Links
  • PEAR >= 1.4.8
» Timeline » Changelog
  • First Draft: 2006-03-07
  • Proposal: 2006-03-07
  • Call for Votes: 2006-03-20
  • Scott Mattocks
    [2006-03-08 14:31 UTC]

    Removed PHP 5 public tokens from method signatures.
  • Scott Mattocks
    [2006-03-08 19:46 UTC]

    Updates based on Laurent's comments.
    - Add error constants.
    - Allow error codes and PEAR_Error instances to be passed to pushError.
    - Update return values and docblocks.
    - Fix Windows preference file name.
    - Fix example in opening doc block.
  • Scott Mattocks
    [2006-03-17 00:20 UTC]

    Updated to use PEAR::ErrorStack.