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

Class: PEAR_Installer

Source Location: /PEAR-1.10.12/PEAR/Installer.php

Class Overview

PEAR
   |
   --PEAR_Common
      |
      --PEAR_Downloader
         |
         --PEAR_Installer

Administration class used to install PEAR packages and maintain the installed package database.


Author(s):

Version:

  • Release: 1.10.12

Copyright:

  • 1997-2009 The Authors

Variables

Methods


Inherited Variables

Inherited Methods

Class: PEAR_Downloader

PEAR_Downloader::__construct()
PEAR_Downloader::analyzeDependencies()
PEAR_Downloader::configSet()
PEAR_Downloader::discover()
Attempt to discover a channel's remote capabilities from
PEAR_Downloader::download()
PEAR_Downloader::getDependency2Object()
For simpler unit-testing
PEAR_Downloader::getDownloadedPackages()
Retrieve a list of downloaded packages after a call to download().
PEAR_Downloader::getErrorMsgs()
PEAR_Downloader::getOptions()
PEAR_Downloader::getPackageDownloadUrl()
PEAR_Downloader::newDownloaderPackage()
For simpler unit-testing
PEAR_Downloader::pushError()
PEAR_Downloader::setDownloadDir()
PEAR_Downloader::setOptions()
PEAR_Downloader::sortPackagesForInstall()
Sort a list of arrays of array(downloaded packagefilename) by dependency.
PEAR_Downloader::sortPkgDeps()
for BC
PEAR_Downloader::_downloadHttp()
Download a file through HTTP. Considers suggested file name in

Class: PEAR_Common

PEAR_Common::__construct()
PEAR_Common constructor
PEAR_Common::addTempFile()
Register a temporary file or directory. When the destructor is executed, all registered temporary files and directories are removed.
PEAR_Common::analyzeSourceCode()
Analyze the source code of the given PHP file
PEAR_Common::betterStates()
Return an array containing all of the states that are more stable than or equal to the passed in state
PEAR_Common::buildProvidesArray()
Build a "provides" array from data returned by analyzeSourceCode(). The format of the built array is like this:
PEAR_Common::detectDependencies()
PEAR_Common::downloadHttp()
Download a file through HTTP. Considers suggested file name in
PEAR_Common::getDependencyRelations()
Get the implemented dependency relations (has, lt, ge etc.)
PEAR_Common::getDependencyTypes()
Get the implemented dependency types (php, ext, pkg etc.)
PEAR_Common::getFileRoles()
Get the implemented file roles
PEAR_Common::getProvideTypes()
Get the implemented file replacement types in
PEAR_Common::getReleaseStates()
Get the valid package release states of packages
PEAR_Common::getReplacementTypes()
Get the implemented file replacement types in
PEAR_Common::getScriptPhases()
Get the implemented file replacement types in
PEAR_Common::getUserRoles()
Get the valid roles for a PEAR package maintainer
PEAR_Common::infoFromAny()
Returns package information from different sources
PEAR_Common::infoFromDescriptionFile()
Returns information about a package file. Expects the name of a package xml file as input.
PEAR_Common::infoFromString()
Returns information about a package file. Expects the contents of a package xml file as input.
PEAR_Common::infoFromTgzFile()
Returns information about a package file. Expects the name of a gzipped tar file as input.
PEAR_Common::isIncludeable()
PEAR_Common::log()
Logging method.
PEAR_Common::mkDirHier()
Wrapper to System::mkDir(), creates a directory as well as any necessary parent directories.
PEAR_Common::mkTempDir()
Create and register a temporary directory.
PEAR_Common::setFrontendObject()
Set object that represents the frontend to be used.
PEAR_Common::validatePackageInfo()
Validate XML package definition file.
PEAR_Common::validPackageName()
Test whether a string contains a valid package name.
PEAR_Common::validPackageVersion()
Test whether a string contains a valid package version.
PEAR_Common::xmlFromInfo()
Return an XML document based on the package info (as returned by the PEAR_Common::infoFrom* methods).

Class: PEAR

PEAR::__construct()
Constructor. Registers this object in $_PEAR_destructor_object_list for destructor emulation if a destructor object exists.
PEAR::PEAR()
Only here for backwards compatibility.
PEAR::delExpect()
This method deletes all occurrences of the specified element from the expected error codes stack.
PEAR::expectError()
This method is used to tell which errors you expect to get.
PEAR::getSourceDateEpoch()
Get SOURCE_DATE_EPOCH environment variable See https://reproducible-builds.org/specs/source-date-epoch/
PEAR::getStaticProperty()
If you have a class that's mostly/entirely static, and you need static
PEAR::isError()
Tell whether a value is a PEAR error.
PEAR::loadExtension()
OS independent PHP extension load. Remember to take care on the correct extension name for case sensitive OSes.
PEAR::popExpect()
This method pops one element off the expected error codes stack.
PEAR::registerShutdownFunc()
Use this function to register a shutdown method for static classes.
PEAR::staticPopErrorHandling()
PEAR::staticPushErrorHandling()
PEAR::_PEAR()
Destructor (the emulated type of...). Does nothing right now, but is included for forward compatibility, so subclass destructors should always call it.
PEAR::_popErrorHandling()
Pop the last error handler used
PEAR::_pushErrorHandling()
Push a new error handler on top of the error handler options stack. With this you can easily override the actual error handler for some code and restore it later with popErrorHandling.
PEAR::_raiseError()
This method is a wrapper that returns an instance of the configured error class with this object's default error handling applied. If the $mode and $options parameters are not specified, the object's defaults are used.
PEAR::_setErrorHandling()
Sets how errors generated by this object should be handled.
PEAR::_throwError()
Simpler form of raiseError with fewer options. In most cases message, code and userinfo are enough.
PEAR::__call()
PEAR::__callStatic()

Class Details

[line 42]
Administration class used to install PEAR packages and maintain the installed package database.


[ Top ]


Class Variables

$debug =  1

[line 75]

debug level

Type:   int


[ Top ]

$docdir =

[line 64]

directory where documentation goes

Type:   string


[ Top ]

$extdir =

[line 59]

directory where PHP extension files go

Type:   string


[ Top ]

$file_operations = array()

[line 105]

List of file transactions queued for an install/upgrade/uninstall.

Format: array(

  1. => array("rename => array("from-file", "to-file")),
  2. => array("delete" => array("file-to-delete")),
... )


Type:   array


[ Top ]

$installroot =  ''

[line 70]

installation root directory (ala PHP's INSTALL_ROOT or

automake's DESTDIR


Type:   string


[ Top ]

$phpdir =

[line 54]

directory where PHP code files go

Type:   string


[ Top ]

$pkgdir =

[line 49]

name of the package directory, for example Foo-1.0

Type:   string


[ Top ]

$registry =

[line 86]

PEAR_Registry object used by the installer

Type:   PEAR_Registry


[ Top ]

$tmpdir =

[line 80]

temporary directory

Type:   string


[ Top ]



Method Detail

__construct (Constructor)   [line 118]

PEAR_Installer __construct( &$ui, object $ui)

PEAR_Installer constructor.
  • Access: public

Overrides PEAR_Downloader::__construct() (parent method not documented)

Parameters:

object   $ui   —  user interface object (instance of PEAR_Frontend_*)
   &$ui   — 

[ Top ]

addFileOperation   [line 732]

void addFileOperation( string $type, array $data)

Add a file operation to the current file transaction.

Parameters:

string   $type   —  This can be one of:
  • rename: rename a file ($data has 3 values)
  • backup: backup an existing file ($data has 1 value)
  • removebackup: clean up backups created during install ($data has 1 value)
  • chmod: change permissions on a file ($data has 2 values)
  • delete: delete a file ($data has 1 value)
  • rmdir: delete a directory if empty ($data has 1 value)
  • installed_as: mark a file as installed ($data has 4 values).
array   $data   — 

For all file operations, this array must contain the full path to the file or directory that is being operated on. For the rename command, the first parameter must be the file to rename, the second its new name, the third whether this is a PHP extension.

The installed_as operation contains 4 elements in this order:

  1. Filename as listed in the filelist element from package.xml
  2. Full path to the installed file
  3. Full path from the php_dir configuration variable used in this installation
  4. Relative path from the php_dir that this file is installed in


[ Top ]

commitFileTransaction   [line 762]

void commitFileTransaction( )


[ Top ]

getInstallPackages   [line 1083]

void getInstallPackages( )


[ Top ]

getUninstallPackages   [line 1602]

void &getUninstallPackages( )


[ Top ]

install   [line 1108]

array|PEAR_Error install( string|PEAR_Downloader_Package $pkgfile, [array $options = array()])

Installs the files within the package file specified.
  • Return: package info if successful

Parameters:

string|PEAR_Downloader_Package   $pkgfile   —  path to the package file, or a pre-initialized packagefile object
array   $options   —  recognized options:
  • installroot : optional prefix directory for installation
  • force : force installation
  • register-only : update registry but don't install files
  • upgrade : upgrade existing install
  • soft : fail silently
  • nodeps : ignore dependency conflicts/missing dependencies
  • alldeps : install all dependencies
  • onlyreqdeps : install only required dependencies

[ Top ]

mkDirHier   [line 1024]

void mkDirHier( $dir)


Overrides PEAR_Common::mkDirHier() (Wrapper to System::mkDir(), creates a directory as well as any necessary parent directories.)

Parameters:

   $dir   — 

[ Top ]

rollbackFileTransaction   [line 978]

void rollbackFileTransaction( )


[ Top ]

setConfig   [line 130]

void setConfig( &$config)


Parameters:

   &$config   — 

[ Top ]

setDownloadedPackages   [line 1062]

void setDownloadedPackages( array &$pkgs)

Set the list of PEAR_Downloader_Package objects to allow more sane

dependency validation


Parameters:

array   &$pkgs   — 

[ Top ]

setOptions   [line 125]

void setOptions( $options)


Overrides PEAR_Downloader::setOptions() (parent method not documented)

Parameters:

   $options   — 

[ Top ]

setUninstallPackages   [line 1078]

void setUninstallPackages( array &$pkgs)

Set the list of PEAR_Downloader_Package objects to allow more sane

dependency validation


Parameters:

array   &$pkgs   — 

[ Top ]

sortPackagesForUninstall   [line 1755]

array|PEAR_Error sortPackagesForUninstall( array &$packages)

Sort a list of arrays of array(downloaded packagefilename) by dependency.

It also removes duplicate dependencies

  • Return: array of array(packagefilename, package.xml contents)

Parameters:

array   &$packages   —  an array of PEAR_PackageFile_v[1/2] objects

[ Top ]

startFileTransaction   [line 751]

void startFileTransaction( [ $rollback_in_case = false])


Parameters:

   $rollback_in_case   — 

[ Top ]

uninstall   [line 1621]

void uninstall( string $package, [array $options = array()])

Uninstall a package

This method removes all files installed by the application, and then removes any empty directories.


Parameters:

string   $package   —  package name
array   $options   — 

Command-line options. Possibilities include:

  • installroot: base installation dir, if not the default
  • register-only : update registry but don't remove files
  • nodeps: do not process dependencies of other packages to ensure uninstallation does not break things


[ Top ]

_deletePackageFiles   [line 156]

bool _deletePackageFiles( string $package, [string $channel = false], [bool $backup = false])

Delete a package's installed files, does not remove empty directories.
  • Return: TRUE on success, or a PEAR error on failure
  • Access: protected

Parameters:

string   $package   —  package name
string   $channel   —  channel name
bool   $backup   —  if true, then files are backed up first

[ Top ]


Documentation generated on Sun, 19 Apr 2020 14:22:13 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.