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

Class: PEAR_Registry

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

Class Overview

PEAR
   |
   --PEAR_Registry

Administration class used to maintain the installed package database.


Author(s):

Version:

  • Release: 1.9.4

Copyright:

  • 1997-2009 The Authors

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


[ Top ]


Class Variables

$channels =  ''

[line 50]

File containing all channel information.

Type:   string


[ Top ]

$channelsdir =  ''

[line 65]

Directory where registry files for channels are stored.

Type:   string


[ Top ]

$filemap =  ''

[line 60]

File where the file map is stored

Type:   string


[ Top ]

$filemap_cache = array()

[line 94]

Cache of file map. Structure:

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


Type:   array


[ Top ]

$lockfile =  ''

[line 70]

Name of file used for locking the registry

Type:   string


[ Top ]

$lock_fp =  null

[line 75]

File descriptor used during locking

Type:   resource


[ Top ]

$lock_mode =  0

[line 80]

Mode used during locking

Type:   int


[ Top ]

$pkginfo_cache = array()

[line 88]

Cache of package information. Structure:

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


Type:   array


[ Top ]

$statedir =  ''

[line 55]

Directory where registry files are stored.

Type:   string


[ Top ]



Method Detail

PEAR_Registry (Constructor)   [line 134]

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

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

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

void addPackage2( $info)


Parameters:

   $info     

[ Top ]

apiVersion   [line 2153]

string apiVersion( )

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

compatible with 1.0


[ Top ]

channelAlias   [line 1693]

void channelAlias( string $channel)


Parameters:

string   $channel     

[ Top ]

channelExists   [line 1588]

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


Parameters:

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

[ Top ]

channelInfo   [line 1665]

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

void channelName( string $channel)


Parameters:

string   $channel     

[ Top ]

checkFileMap   [line 2066]

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

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

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


Parameters:

   $package     
   $channel     

[ Top ]

flushFileMap   [line 2140]

void flushFileMap( )

Force a reload of the filemap
  • Since: 1.5.0RC3

[ Top ]

getChannel   [line 1937]

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

array &getChannels( string 0)

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

Parameters:

string   0     channel name

[ Top ]

getChannelValidator   [line 2017]

PEAR_Validate|false &getChannelValidator( string $channel)


Parameters:

string   $channel     channel name

[ Top ]

getInstalledGroup   [line 1977]

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

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

void hasWriteAccess( )


[ Top ]

isAlias   [line 1624]

bool isAlias( string $alias)

Determines whether the parameter is an alias of a channel

Parameters:

string   $alias     

[ Top ]

listAllPackages   [line 1717]

void listAllPackages( )


[ Top ]

listChannels   [line 1730]

void listChannels( )


[ Top ]

listPackages   [line 1704]

void listPackages( [ $channel = false])


Parameters:

   $channel     

[ Top ]

mirrorExists   [line 1606]

bool mirrorExists( string $channel, string $mirror)


Parameters:

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

[ Top ]

packageExists   [line 1569]

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


Parameters:

string   $package     Package name
string   $channel     Channel name

[ Top ]

packageInfo   [line 1643]

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

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


Parameters:

array   $parsed     
   $brief     

[ Top ]

parsePackageName   [line 2173]

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

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


Parameters:

   &$config     
   $resetInstallDir     

[ Top ]

setInstallDir   [line 144]

void setInstallDir( [ $pear_install_dir = PEAR_INSTALL_DIR])


Parameters:

   $pear_install_dir     

[ Top ]

updateChannel   [line 1800]

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

For future expandibility purposes, separate this

Parameters:

PEAR_ChannelFile   $channel     
   $lastmodified     

[ Top ]

updatePackage   [line 1879]

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


Parameters:

   $package     
   $info     
   $merge     

[ Top ]

updatePackage2   [line 1905]

void updatePackage2( $info)


Parameters:

   $info     

[ Top ]

_channelDirectoryName   [line 624]

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

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 Wed, 06 Jul 2011 23:31:13 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.