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

Class: PEAR_Registry

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

Class Overview

PEAR
   |
   --PEAR_Registry

Administration class used to maintain the installed package database.


Author(s):

Version:

  • Release: 1.6.2

Copyright:

  • 1997-2006 The PHP Group

Variables

Methods


Inherited Variables

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


[ Top ]


Class Variables

$channels =  ''

[line 58]

File containing all channel information.

Type:   string


[ Top ]

$channelsdir =  ''

[line 73]

Directory where registry files for channels are stored.

Type:   string


[ Top ]

$filemap =  ''

[line 68]

File where the file map is stored

Type:   string


[ Top ]

$filemap_cache = array()

[line 102]

Cache of file map. Structure:

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


Type:   array


[ Top ]

$lockfile =  ''

[line 78]

Name of file used for locking the registry

Type:   string


[ Top ]

$lock_fp =  null

[line 83]

File descriptor used during locking

Type:   resource


[ Top ]

$lock_mode =  0

[line 88]

Mode used during locking

Type:   int


[ Top ]

$pkginfo_cache = array()

[line 96]

Cache of package information. Structure:

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


Type:   array


[ Top ]

$statedir =  ''

[line 63]

Directory where registry files are stored.

Type:   string


[ Top ]



Method Detail

PEAR_Registry (Constructor)   [line 140]

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

PEAR_Registry constructor.
  • Access: public

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

[ Top ]

addChannel   [line 1672]

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

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

void addPackage2( $info)


Parameters:

   $info   — 

[ Top ]

apiVersion   [line 1984]

string apiVersion( )

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

compatible with 1.0


[ Top ]

channelAlias   [line 1528]

void channelAlias( string $channel)


Parameters:

string   $channel   — 

[ Top ]

channelExists   [line 1440]

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


Parameters:

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

[ Top ]

channelInfo   [line 1500]

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

void channelName( string $channel)


Parameters:

string   $channel   — 

[ Top ]

checkFileMap   [line 1897]

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

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

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


Parameters:

   $package   — 
   $channel   — 

[ Top ]

flushFileMap   [line 1971]

void flushFileMap( )

Force a reload of the filemap
  • Since: 1.5.0RC3

[ Top ]

getChannel   [line 1768]

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

array &getChannels( string 0)

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

Parameters:

string   0   —  channel name

[ Top ]

getChannelValidator   [line 1848]

PEAR_Validate|false &getChannelValidator( string $channel)


Parameters:

string   $channel   —  channel name

[ Top ]

getInstalledGroup   [line 1808]

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

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

void hasWriteAccess( )


[ Top ]

isAlias   [line 1459]

bool isAlias( string $alias)

Determines whether the parameter is an alias of a channel

Parameters:

string   $alias   — 

[ Top ]

listAllPackages   [line 1552]

void listAllPackages( )


[ Top ]

listChannels   [line 1565]

void listChannels( )


[ Top ]

listPackages   [line 1539]

void listPackages( [ $channel = false])


Parameters:

   $channel   — 

[ Top ]

packageExists   [line 1421]

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


Parameters:

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

[ Top ]

packageInfo   [line 1478]

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

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


Parameters:

array   $parsed   — 
   $brief   — 

[ Top ]

parsePackageName   [line 2004]

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

void setConfig( &$config)


Parameters:

   &$config   — 

[ Top ]

updateChannel   [line 1635]

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

For future expandibility purposes, separate this

Parameters:

PEAR_ChannelFile   $channel   — 
   $lastmodified   — 

[ Top ]

updatePackage   [line 1715]

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


Parameters:

   $package   — 
   $info   — 
   $merge   — 

[ Top ]

updatePackage2   [line 1741]

void updatePackage2( $info)


Parameters:

   $info   — 

[ Top ]

_channelDirectoryName   [line 584]

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

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 Mon, 11 Mar 2019 15:09:37 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.