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

Class: PEAR_PackageUpdate_Cli

Source Location: /PEAR_PackageUpdate-1.1.0RC1/Cli.php

Class Overview

PEAR_PackageUpdate
   |
   --PEAR_PackageUpdate_Cli

This is the default CLI driver for PEAR_PackageUpdate.


Author(s):

Version:

  • Release: 1.1.0RC1

Copyright:

  • 2006-2009 Scott Mattocks, Laurent Laville

Methods


Inherited Variables

Inherited Methods

Class: PEAR_PackageUpdate

PEAR_PackageUpdate::__construct()
PHP 5 style constructor. Loads the user preferences.
PEAR_PackageUpdate::PEAR_PackageUpdate()
PHP 4 style constructor. Calls the PHP 5 style constructor.
PEAR_PackageUpdate::addAdapter()
Add an interface adapter
PEAR_PackageUpdate::checkUpdate()
Checks to see if an update is available.
PEAR_PackageUpdate::determinePrefFile()
Returns the path to the preferences file.
PEAR_PackageUpdate::factory()
Creates an instance of the given update class.
PEAR_PackageUpdate::forceRestart()
Redirects or exits to force the user to restart the application.
PEAR_PackageUpdate::getInstalledRelease()
Returns informations about current installed version of the package
PEAR_PackageUpdate::getLatestRelease()
Returns information on latest version available
PEAR_PackageUpdate::getPackageInfo()
Returns the latest information about the given package.
PEAR_PackageUpdate::getPackagePreferences()
Returns the preferences associated with the given package.
PEAR_PackageUpdate::hasErrors()
Returns whether or not errors have occurred (and been captured).
PEAR_PackageUpdate::isIncludable()
Returns whether or not a path is in the include path.
PEAR_PackageUpdate::loadPreferences()
Loads the user's preferences from a file.
PEAR_PackageUpdate::popError()
Pops an error off the error stack.
PEAR_PackageUpdate::preferencesAllowUpdate()
Returns whether or not the user's preferences will allow an update to take place.
PEAR_PackageUpdate::presentUpdate()
Presents the user with the option to update.
PEAR_PackageUpdate::pushError()
Pushes an error onto an error stack.
PEAR_PackageUpdate::releaseType()
Returns the type of release. (bug|minor|major);
PEAR_PackageUpdate::repackagePEARError()
Repackages PEAR_Errors for use with ErrorStack.
PEAR_PackageUpdate::savePreferences()
Saves the current preferences to the RC file.
PEAR_PackageUpdate::setDontAskAgain()
Sets the user's preference for asking about all updates for this package.
PEAR_PackageUpdate::setDontAskUntilNextRelease()
Sets the user's preference for asking about updates again until the next release.
PEAR_PackageUpdate::setMinimumReleaseType()
Sets the user's preference for asking about release types.
PEAR_PackageUpdate::setMinimumState()
Sets the user's preference for asking about release states.
PEAR_PackageUpdate::setPreference()
Sets the given preference to the given value.
PEAR_PackageUpdate::setPreferences()
Sets all preferences at once.
PEAR_PackageUpdate::update()
Updates the source for the package.

Class Details

[line 52]
This is the default CLI driver for PEAR_PackageUpdate.

A package to make adding self updating functionality to other packages easy.

EXAMPLE:

  1.  <?php
  2.      require_once 'PEAR/PackageUpdate.php';
  3.      // check for updates of PEAR::Config package
  4.      $ppu =PEAR_PackageUpdate::factory('Cli''Config''pear');
  5.      if ($ppu !== false{
  6.          // Check for new stable and minor changes version
  7.          if ($ppu->checkUpdate()) {
  8.              // Update your local copy
  9.              if ($ppu->update()) {
  10.                  include_once 'Config.php';
  11.              }
  12.          }
  13.      }
  14.  ?>



[ Top ]


Method Detail

PEAR_PackageUpdate_Cli (Constructor)   [line 70]

void PEAR_PackageUpdate_Cli( string $packageName, string $channel, [string $user_file = ''], [string $system_file = ''], [string $pref_file = ''])

Cli driver class constructor
  • Since: 0.6.0
  • Access: public

Parameters:

string   $packageName     The package to update.
string   $channel     The channel the package resides on.
string   $user_file     (optional) file to read PEAR user-defined options from
string   $system_file     (optional) file to read PEAR system-wide defaults from
string   $pref_file     (optional) file to read PPU user-defined options from

[ Top ]

forceRestart   [line 85]

void forceRestart( )

Cli driver does not redirects or exits to force the user to restart the application.
  • Since: 0.6.0
  • Access: public

Overrides PEAR_PackageUpdate::forceRestart() (Redirects or exits to force the user to restart the application.)
[ Top ]

presentUpdate   [line 96]

boolean presentUpdate( )

Cli driver does not present any frontend when an update is needed
  • Return: Always true
  • Since: 0.6.0
  • Access: public

Overrides PEAR_PackageUpdate::presentUpdate() (Presents the user with the option to update.)
[ Top ]


Documentation generated on Thu, 07 May 2009 22:00:02 +0000 by phpDocumentor 1.4.2. PEAR Logo Copyright © PHP Group 2004.