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

Class: PEAR_Registry

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

Class Overview

PEAR
   |
   --PEAR_Registry

Administration class used to 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

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 43]
Administration class used to maintain the installed package database.


[ Top ]


Class Variables

$channels =  ''

[line 49]

File containing all channel information.

Type:   string


[ Top ]

$channelsdir =  ''

[line 64]

Directory where registry files for channels are stored.

Type:   string


[ Top ]

$filemap =  ''

[line 59]

File where the file map is stored

Type:   string


[ Top ]

$filemap_cache = array()

[line 93]

Cache of file map. Structure:

array( '/path/to/file' => 'package', ... )


Type:   array


[ Top ]

$lockfile =  ''

[line 69]

Name of file used for locking the registry

Type:   string


[ Top ]

$lock_fp =  null

[line 74]

File descriptor used during locking

Type:   resource


[ Top ]

$lock_mode =  0

[line 79]

Mode used during locking

Type:   int


[ Top ]

$pkginfo_cache = array()

[line 87]

Cache of package information. Structure:

array( 'package' => array('id' => ... ), ... )


Type:   array


[ Top ]

$statedir =  ''

[line 54]

Directory where registry files are stored.

Type:   string


[ Top ]



Method Detail

__construct (Constructor)   [line 133]

PEAR_Registry __construct( [string $pear_install_dir = PEAR_INSTALL_DIR], [PEAR_ChannelFile $pear_channel = false], [PEAR_ChannelFile $pecl_channel = false], [ $pear_metadata_dir = ''])

PEAR_Registry constructor.
  • Access: public

Overrides PEAR::__construct() (Constructor. Registers this object in $_PEAR_destructor_object_list for destructor emulation if a destructor object exists.)

Parameters:

string   $pear_install_dir   —  (optional) PEAR install directory (for .php files)
PEAR_ChannelFile   $pear_channel   —  PEAR_ChannelFile object representing the PEAR channel, if default values are not desired. Only used the very first time a PEAR repository is initialized
PEAR_ChannelFile   $pecl_channel   —  PEAR_ChannelFile object representing the PECL channel, if default values are not desired. Only used the very first time a PEAR repository is initialized
   $pear_metadata_dir   — 

[ Top ]

addChannel   [line 1833]

boolean|PEAR_Error addChannel( PEAR_ChannelFile $channel, [string $lastmodified = false], [ $update = false])

  • Return: True on creation, false if it already exists

Parameters:

PEAR_ChannelFile   $channel   —  Channel object
string   $lastmodified   —  Last-Modified header from HTTP for caching
   $update   — 

[ Top ]

addPackage   [line 1744]

bool addPackage( string|PEAR_PackageFile_v1|PEAR_PackageFile_v2 $package, array $info)

Add an installed package to the registry
  • Return: success of saving

Parameters:

string|PEAR_PackageFile_v1|PEAR_PackageFile_v2   $package   —  package name or object that will be passed to addPackage2()
array   $info   —  package info (parsed by PEAR_Common::infoFrom*() methods)

[ Top ]

addPackage2   [line 1770]

void addPackage2( $info)


Parameters:

   $info   — 

[ Top ]

apiVersion   [line 2147]

string apiVersion( )

Get the expected API version. Channels API is version 1.1, as it is backwards

compatible with 1.0


[ Top ]

channelAlias   [line 1687]

void channelAlias( string $channel)


Parameters:

string   $channel   — 

[ Top ]

channelExists   [line 1582]

bool channelExists( string $channel, [bool $noaliases = false])


Parameters:

string   $channel   —  channel name
bool   $noaliases   —  if true, then aliases will be ignored

[ Top ]

channelInfo   [line 1659]

array|null|PEAR_Error channelInfo( [string $channel = null], [bool $noaliases = false])

Retrieve a raw array of channel data.

Do not use this, instead use getChannel() for normal operations. Array structure is undefined in this method


Parameters:

string   $channel   —  channel name
bool   $noaliases   —  whether to strictly retrieve information only on non-aliases

[ Top ]

channelName   [line 1674]

void channelName( string $channel)


Parameters:

string   $channel   — 

[ Top ]

checkFileMap   [line 2060]

array|false checkFileMap( string|array $path, [string|array $package = false], [string $api = '1.0'], [array $attrs = false])

Test whether a file or set of files belongs to a package.

If an array is passed in

  • Return: which package and channel the file belongs to, or an empty string if the file does not belong to an installed package, or belongs to the second parameter's package

Parameters:

string|array   $path   —  file path, absolute or relative to the pear install dir
string|array   $package   —  name of PEAR package or array('package' => name, 'channel' => channel) of a package that will be ignored
string   $api   —  API version - 1.1 will exclude any files belonging to a package
array   $attrs   —  private recursion variable

[ Top ]

deleteChannel   [line 1810]

boolean|PEAR_Error deleteChannel( string|PEAR_ChannelFile $channel)

Deletion fails if there are any packages installed from the channel
  • Return: True on deletion, false if it doesn't exist

Parameters:

string|PEAR_ChannelFile   $channel   —  channel name

[ Top ]

deletePackage   [line 1855]

void deletePackage( $package, [ $channel = 'pear.php.net'])


Parameters:

   $package   — 
   $channel   — 

[ Top ]

flushFileMap   [line 2134]

void flushFileMap( )

Force a reload of the filemap
  • Since: 1.5.0RC3

[ Top ]

getChannel   [line 1931]

PEAR_ChannelFile|PEAR_Error getChannel( string $channel, [bool $noaliases = false])


Parameters:

string   $channel   —  channel name
bool   $noaliases   —  whether to strictly return raw channels (no aliases)

[ Top ]

getChannels   [line 2026]

array &getChannels( string 0)

  • Return: an array of PEAR_ChannelFile objects representing every installed channel

Parameters:

string   0   —  channel name

[ Top ]

getChannelValidator   [line 2011]

PEAR_Validate|false &getChannelValidator( string $channel)


Parameters:

string   $channel   —  channel name

[ Top ]

getInstalledGroup   [line 1971]

array|false getInstalledGroup( array $group)

Get PEAR_PackageFile_v[1/2] objects representing the contents of a dependency group that are installed.

This is used at uninstall-time


Parameters:

array   $group   — 

[ Top ]

getPackage   [line 1951]

PEAR_PackageFile_v1|PEAR_PackageFile_v2|null &getPackage( string $package, [string $channel = 'pear.php.net'])


Parameters:

string   $package   —  package name
string   $channel   —  channel name

[ Top ]

hasWriteAccess   [line 156]

void hasWriteAccess( )


[ Top ]

isAlias   [line 1618]

bool isAlias( string $alias)

Determines whether the parameter is an alias of a channel

Parameters:

string   $alias   — 

[ Top ]

listAllPackages   [line 1711]

void listAllPackages( )


[ Top ]

listChannels   [line 1724]

void listChannels( )


[ Top ]

listPackages   [line 1698]

void listPackages( [ $channel = false])


Parameters:

   $channel   — 

[ Top ]

mirrorExists   [line 1600]

bool mirrorExists( string $channel, string $mirror)


Parameters:

string   $channel   —  channel name mirror is in
string   $mirror   —  mirror name

[ Top ]

packageExists   [line 1563]

bool packageExists( string $package, [string $channel = 'pear.php.net'])


Parameters:

string   $package   —  Package name
string   $channel   —  Channel name

[ Top ]

packageInfo   [line 1637]

array|null packageInfo( [string|null $package = null], [string|null $key = null], [string $channel = 'pear.php.net'])


Parameters:

string|null   $package   — 
string|null   $key   — 
string   $channel   — 

[ Top ]

parsedPackageNameToString   [line 2339]

string parsedPackageNameToString( array $parsed, [ $brief = false])


Parameters:

array   $parsed   — 
   $brief   — 

[ Top ]

parsePackageName   [line 2167]

array|PEAR_Error parsePackageName( string|array $param, [ $defaultchannel = 'pear.php.net'])

Parse a package name, or validate a parsed package name array

Parameters:

string|array   $param   —  pass in an array of format array( 'package' => 'pname', ['channel' => 'channame',] ['version' => 'version',] ['state' => 'state',] ['group' => 'groupname']) or a string of format [channel://][channame/]pname[-version|-state][/group=groupname]
   $defaultchannel   — 

[ Top ]

setConfig   [line 182]

void setConfig( &$config, [ $resetInstallDir = true])


Parameters:

   &$config   — 
   $resetInstallDir   — 

[ Top ]

setInstallDir   [line 143]

void setInstallDir( [ $pear_install_dir = PEAR_INSTALL_DIR], [ $pear_metadata_dir = ''])


Parameters:

   $pear_install_dir   — 
   $pear_metadata_dir   — 

[ Top ]

updateChannel   [line 1794]

void updateChannel( PEAR_ChannelFile $channel, [ $lastmodified = null])

For future expandibility purposes, separate this

Parameters:

PEAR_ChannelFile   $channel   — 
   $lastmodified   — 

[ Top ]

updatePackage   [line 1873]

void updatePackage( $package, $info, [ $merge = true])


Parameters:

   $package   — 
   $info   — 
   $merge   — 

[ Top ]

updatePackage2   [line 1899]

void updatePackage2( $info)


Parameters:

   $info   — 

[ Top ]

_channelDirectoryName   [line 626]

string _channelDirectoryName( string $channel, string 1)

Get the name of the file where data for a given package is stored.
  • Return: registry file name
  • Access: public

Parameters:

string   1   —  package name
string   $channel   —  channel name, or false if this is a PEAR package

[ Top ]

_packageFileName   [line 517]

string _packageFileName( string $package, [string $channel = false])

Get the name of the file where data for a given package is stored.
  • Return: registry file name
  • Access: public

Parameters:

string   $package   —  channel name, or false if this is a PEAR package
string   $channel   —  package name

[ Top ]


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