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

Class: PEAR_PackageUpdate

Source Location: /PEAR_PackageUpdate-0.4.2/PackageUpdate.php

Class Overview




Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 125]


[ Top ]


Class Variables

$channel =

[line 149]

The channel the package is hosted on.
  • Access: public

Type:   string


[ Top ]

$errors =

[line 181]

A collection of errors that have occurred.
  • Access: public

Type:   object


[ Top ]

$info = array()

[line 165]

Information about the latest version of the package.
  • Access: public

Type:   array


[ Top ]

$instVersion =

[line 173]

The current installed version of the package.
  • Access: public

Type:   string


[ Top ]

$latestVersion =

[line 157]

The latest version available for the given package.
  • Access: public

Type:   string


[ Top ]

$packageName =

[line 141]

The name of the package.
  • Access: public

Type:   string


[ Top ]

$preferences = array()

[line 133]

The user's update preferences.
  • Access: public

Type:   array


[ Top ]



Method Detail

__construct (Constructor)   [line 204]

void __construct( string $packageName, string $channel)

PHP 5 style constructor. Loads the user preferences.
  • Access: public

Parameters:

string   $packageName   —  The package to update.
string   $channel   —  The channel the package resides on.

[ Top ]

PEAR_PackageUpdate (Constructor)   [line 191]

void PEAR_PackageUpdate( string $packageName, string $channel)

PHP 4 style constructor. Calls the PHP 5 style constructor.
  • Access: public

Parameters:

string   $packageName   —  The package to update.
string   $channel   —  The channel the package resides on.

[ Top ]

checkUpdate   [line 366]

boolean checkUpdate( )

Checks to see if an update is available.

Respects the user preferences when determining if an update is avaiable. Returns true if an update is available and the user may want to update the package.

  • Return: true if an update is available.
  • Access: public

[ Top ]

determinePrefFile   [line 340]

string determinePrefFile( )

Returns the path to the preferences file.
  • Access: protected

[ Top ]

factory   [line 227]

object An &factory( string $driver, string $packageName, string $channel)

Creates an instance of the given update class.
  • Return: instance of type PEAR_PackageUpdate_$driver
  • Access: public

Parameters:

string   $driver   —  The type of PPU to create.
string   $packageName   —  The package to update.
string   $channel   —  The channel the package resides on.

[ Top ]

forceRestart   [line 849]

void forceRestart( )

Redirects or exits to force the user to restart the application.
  • Abstract:
  • Access: public

[ Top ]

getPackageInfo   [line 394]

boolean getPackageInfo( )

Returns the latest information about the given package.
  • Return: true on success, false on error
  • Access: protected

[ Top ]

getPackagePreferences   [line 472]

array getPackagePreferences( )

Returns the preferences associated with the given package.

The preferences returned are an array with the folling values:

  • don't ask again
  • don't ask until next version
  • only ask for state x
  • bug/minor/major updates only

  • Access: public

[ Top ]

hasErrors   [line 980]

boolean hasErrors( )

Returns whether or not errors have occurred (and been captured).
  • Access: public

[ Top ]

isIncludable   [line 270]

boolean isIncludable( string $path)

Returns whether or not a path is in the include path.
  • Return: true if the path is in the include path.
  • Access: public

Parameters:

string   $path   — 

[ Top ]

loadPreferences   [line 296]

boolean loadPreferences( )

Loads the user's preferences from a file.

The preferences are stored in the user's home directory as the file .ppurc. The file contains a serialized array of preferences for each package that has been checked for updates so far.

  • Return: true on success, false on error
  • Access: protected

[ Top ]

popError   [line 969]

object A popError( )

Pops an error off the error stack.

This method is just for collecting errors that occur while checking for updates and updating a package. The child class is responsible for displaying all errors and handling them properly. This is because the way errors are handled varies greatly depending on the driver used.

  • Return: PEAR_Error instance or false if no errors exist.
  • Access: public

[ Top ]

preferencesAllowUpdate   [line 538]

boolean preferencesAllowUpdate( )

Returns whether or not the user's preferences will allow an update to take place.

The user's preferences may define restrictions such as:

  • don't update
  • don't ask until next version (remembers last version asked)
  • only ask for state XXXX or higher
  • minor or higher (no bug fix)
  • major only

  • Return: true if the preferences will allow an update for the latest version.
  • Access: public

[ Top ]

presentUpdate   [line 862]

boolean presentUpdate( )

Presents the user with the option to update.
  • Return: true if the user wants to update
  • Abstract:
  • Access: public

[ Top ]

pushError   [line 896]

PEAR_Error|array|Exception pushError( int $code, [string $level = 'error'], [array $params = array()], [string $msg = false], [array $repackage = false], [array $backtrace = false])

Pushes an error onto an error stack.

This method is just for collecting errors that occur while checking for updates and updating a package. The child class is responsible for displaying all errors and handling them properly. This is because the way errors are handled varies greatly depending on the driver used.

  • Return: if compatibility mode is on, a PEAR_Error is also thrown. If the class Exception exists, then one is returned.
  • Access: public

Parameters:

int   $code   —  Package-specific error code
string   $level   —  Error level. This is NOT spell-checked
array   $params   —  associative array of error parameters
string   $msg   —  Error message, or a portion of it if the message is to be generated
array   $repackage   —  If this error re-packages an error pushed by another package, place the array returned from pop() in this parameter
array   $backtrace   —  Protected parameter: use this to pass in the debug_backtrace() that should be used to find error context

[ Top ]

releaseType   [line 599]

string releaseType( )

Returns the type of release. (bug|minor|major);
  • Access: protected

[ Top ]

repackagePEAR_Error   [line 927]

mixed repackagePEAR_Error( &$error, object $error)

Repackages PEAR_Errors for use with ErrorStack.
  • Return: The return from PEAR::ErrorStack::push()
  • Author: Ian Eure
  • Access: public

Parameters:

object   $error   —  A PEAR_Error
   &$error   — 

[ Top ]

savePreferences   [line 487]

boolean savePreferences( )

Saves the current prefernces to the RC file.
  • Return: true on success, false on error
  • Access: public

[ Top ]

setDontAskAgain   [line 624]

boolean setDontAskAgain( boolean $dontAsk)

Sets the user's preference for asking about all updates for this package.
  • Return: true on success, false on failure
  • Access: public

Parameters:

boolean   $dontAsk   — 

[ Top ]

setDontAskUntilNextRelease   [line 641]

boolean setDontAskUntilNextRelease( boolean $nextrelease)

Sets the user's preference for asking about updates again until the next release.
  • Return: true on success, false on failure
  • Access: public

Parameters:

boolean   $nextrelease   — 

[ Top ]

setMinimumRleaseType   [line 666]

boolean setMinimumRleaseType( string $minType)

Sets the user's preference for asking about release types.
  • Return: true on success, false on failure
  • Access: public

Parameters:

string   $minType   —  The minimum release type to allow.

[ Top ]

setMinimumState   [line 690]

boolean setMinimumState( string $minState)

Sets the user's preference for asking about release states.
  • Return: true on success, false on failure
  • Access: public

Parameters:

string   $minState   —  The minimum release state to allow.

[ Top ]

setPreference   [line 719]

boolean setPreference( integer $pref, mixed $value)

Sets the given preference to the given value.

Don't take any chances. Anytime a preference is set, the preferences are saved. We can't rely on the developer to call savePreferences.

  • Return: true if the preference was set and saved properly.
  • Access: protected

Parameters:

integer   $pref   —  One of the preference constants.
mixed   $value   —  The value of the preference.

[ Top ]

setPreferences   [line 758]

boolean setPreferences( array $preferences)

Sets all preferences at once.
  • Return: true if the preferences were set and saved.
  • Access: public

Parameters:

array   $preferences   — 

[ Top ]

update   [line 800]

boolean update( )

Updates the source for the package.

We have to update required dependencies automatically to make sure that everything still works properly.

It is the developers responsibility to make sure the user is given the option to update any optional dependencies if needed. This can be done by creating a new instance of PEAR_PackageUpdate for the optional dependency.

  • Return: true if the update was successful.
  • Access: public

[ Top ]


Documentation generated on Mon, 11 Mar 2019 14:39:30 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.