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

Class: PEAR_Installer

Source Location: /PEAR-1.3.5/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):

Variables

Methods


Inherited Variables

Inherited Methods

Class: PEAR_Downloader

PEAR_Downloader::PEAR_Downloader()
PEAR_Downloader::configSet()
PEAR_Downloader::doDownload()
Download any files and their dependencies, if necessary
PEAR_Downloader::download()
Download any files and their dependencies, if necessary
PEAR_Downloader::extractDownloadFileName()
PEAR_Downloader::getDownloadedPackages()
Retrieve a list of downloaded packages after a call to download().
PEAR_Downloader::getErrorMsgs()
PEAR_Downloader::getPackageDownloadUrl()
PEAR_Downloader::pushError()
PEAR_Downloader::setOptions()

Class: PEAR_Common

PEAR_Common::PEAR_Common()
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::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::sortPkgDeps()
Sort a list of arrays of array(downloaded packagefilename) by dependency.
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::PEAR()
Constructor. Registers this object in $_PEAR_destructor_object_list for destructor emulation if a destructor object exists.
PEAR::delExpect()
This method deletes all occurences 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::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 independant PHP extension load. Remember to take care on the correct extension name for case sensitive OSes.
PEAR::popErrorHandling()
Pop the last error handler used
PEAR::popExpect()
This method pops one element off the expected error codes stack.
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::registerShutdownFunc()
Use this function to register a shutdown method for static classes.
PEAR::setErrorHandling()
Sets how errors generated by this object should be handled.
PEAR::staticPopErrorHandling()
PEAR::staticPushErrorHandling()
PEAR::throwError()
Simpler form of raiseError with fewer options. In most cases message, code and userinfo are enough.
PEAR::_PEAR()
Destructor (the emulated type of...). Does nothing right now, but is included for forward compatibility, so subclass destructors should always call it.

Class Details

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

TODO:

  • Check dependencies break on package uninstall (when no force given)
  • add a guessInstallDest() method with the code from _installFile() and use that method in Registry::_rebuildFileMap() & Command_Registry::doList(), others..



[ Top ]


Class Variables

$debug =  1

[line 73]

debug level

Type:   int


[ Top ]

$docdir =

[line 62]

directory where documentation goes

Type:   string


[ Top ]

$extdir =

[line 57]

directory where PHP extension files go

Type:   string


[ Top ]

$file_operations = array()

[line 96]

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 68]

installation root directory (ala PHP's INSTALL_ROOT or

automake's DESTDIR


Type:   string


[ Top ]

$phpdir =

[line 52]

directory where PHP code files go

Type:   string


[ Top ]

$pkgdir =

[line 47]

name of the package directory, for example Foo-1.0

Type:   string


[ Top ]

$registry =

[line 83]

PEAR_Registry object used by the installer

Type:   object


[ Top ]

$tmpdir =

[line 78]

temporary directory

Type:   string


[ Top ]



Method Detail

PEAR_Installer (Constructor)   [line 109]

PEAR_Installer PEAR_Installer( &$ui, object $ui)

PEAR_Installer constructor.
  • Access: public

Parameters:

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

[ Top ]

addFileOperation   [line 371]

void addFileOperation( $type, $data)

Add a file operation to the current file transaction.
  • Var: This can be one of:
    • rename: rename a file ($data has 2 values)
    • 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).
  • See: startFileTransaction()

Parameters:

   $type   — 
   $data   — 

[ Top ]

checkDeps   [line 966]

boolean checkDeps( array &$pkginfo, string &$errors)

Check if the package meets all dependencies
  • Return: False when no error occured, otherwise true

Parameters:

array   &$pkginfo   —  Package information (passed by reference)
string   &$errors   —  Error message (passed by reference)

[ Top ]

commitFileTransaction   [line 400]

void commitFileTransaction( )


[ Top ]

download   [line 563]

void download( array $packages, PEAR_Config $options, array &$config, array &$installpackages, array &$errors, [false $installed = false], [false $willinstall = false], [false $state = false])

Download any files and their dependencies, if necessary
  • Deprecated: in favor of PEAR_Downloader

Overrides PEAR_Downloader::download() (Download any files and their dependencies, if necessary)

Parameters:

array   $packages   —  a mixed list of package names, local files, or package.xml
PEAR_Config   $options   — 
array   &$config   —  options from the command line
array   &$installpackages   — 

this is the array that will be populated with packages to install. Format of each entry:

  1.  array('pkg' => 'package_name''file' => '/path/to/local/file',
  2.     'info' => array(// parsed package.xml
  3.  );

array   &$errors   —  this will be populated with any error messages
false   $installed   —  private recursion variable
false   $willinstall   —  private recursion variable
false   $state   —  private recursion variable

[ Top ]

install   [line 597]

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

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

Parameters:

string   $pkgfile   —  path to the package file
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 534]

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 489]

void rollbackFileTransaction( )


[ Top ]

startFileTransaction   [line 389]

void startFileTransaction( [ $rollback_in_case = false])


Parameters:

   $rollback_in_case   — 

[ Top ]

uninstall   [line 891]

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
  • nodeps: do not process dependencies of other packages to ensure uninstallation does not break things


[ Top ]


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