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

Class: PEAR_ChannelFile

Source Location: /PEAR-1.9.5/PEAR/ChannelFile.php

Class Overview


The Channel handling class


Author(s):

Version:

  • Release: 1.9.5

Copyright:

  • 1997-2009 The Authors

Methods


Inherited Variables

Inherited Methods


Class Details

[line 153]
The Channel handling class


[ Top ]


Method Detail

PEAR_ChannelFile (Constructor)   [line 197]

PEAR_ChannelFile PEAR_ChannelFile( )


[ Top ]

addFunction   [line 1301]

bool addFunction( string $type, string $version, [string $name = ''], [string $mirror = false])

Add a protocol to the provides section

Parameters:

string   $type     protocol type
string   $version     protocol version
string   $name     protocol name, if any
string   $mirror     mirror name, if this is a mirror's protocol

[ Top ]

addMirror   [line 1438]

boolean addMirror( string $server, [int $port = null])


Parameters:

string   $server     mirror server
int   $port     mirror http port

[ Top ]

addMirrorFunction   [line 1334]

void addMirrorFunction( string $mirror, string $type, string $version, [string $name = ''])

Add a protocol to a mirror's provides section

Parameters:

string   $mirror     mirror name (server)
string   $type     protocol type
string   $version     protocol version
string   $name     protocol name, if any

[ Top ]

fromAny   [line 412]

bool fromAny( string $info)

Parse channel information from different sources

This method is able to extract information about a channel from an .xml file or a string

  • Access: public

Parameters:

string   $info     Filename of the source or the source itself

[ Top ]

fromArray   [line 312]

PEAR_ChannelFile|false &fromArray( array $data, [ $compatibility = false], [ $stackClass = 'PEAR_ErrorStack'])

  • Return: false if invalid

Parameters:

array   $data     
   $compatibility     
   $stackClass     

[ Top ]

fromArrayWithErrors   [line 329]

PEAR_ChannelFile &fromArrayWithErrors( array $data, [ $compatibility = false], [ $stackClass = 'PEAR_ErrorStack'])

Unlike fromArray() this does not do any validation

Parameters:

array   $data     
   $compatibility     
   $stackClass     

[ Top ]

fromXmlFile   [line 387]

bool fromXmlFile( string $descfile)

Parse a channel.xml file. Expects the name of a channel xml file as input.
  • Return: success of parsing

Parameters:

string   $descfile     name of channel xml file

[ Top ]

fromXmlString   [line 269]

bool fromXmlString( string $data)

  • Return: success of parsing

Parameters:

string   $data     contents of package.xml file

[ Top ]

getAlias   [line 1263]

string getAlias( )


[ Top ]

getBaseURL   [line 942]

void getBaseURL( string $resourceType, [ $mirror = false])

Get the URL to access a base resource.

Hyperlinks in the returned xml will be used to retrieve the proper information needed. This allows extreme extensibility and flexibility in implementation


Parameters:

string   $resourceType     Resource Type to retrieve
   $mirror     

[ Top ]

getErrors   [line 351]

array getErrors( [boolean $purge = false])

Wrapper to PEAR_ErrorStack::getErrors()

Parameters:

boolean   $purge     determines whether to purge the error stack after retrieving

[ Top ]

getFunction   [line 857]

array getFunction( string $type, [string $name = null], [string $mirror = false])


Parameters:

string   $type     Protocol type
string   $name     Function name (null to return the first protocol of the type requested)
string   $mirror     Mirror name, if any

[ Top ]

getFunctions   [line 826]

array|false getFunctions( string $protocol, [string $mirror = false])


Parameters:

string   $protocol     protocol type
string   $mirror     Mirror name

[ Top ]

getMirror   [line 1064]

array|false getMirror( $server)

Get the unserialized XML representing a mirror

Parameters:

   $server     

[ Top ]

getMirrors   [line 1046]

array getMirrors( )


[ Top ]

getName   [line 732]

string|false getName( )


[ Top ]

getPort   [line 756]

int|80 getPort( [ $mirror = false])

  • Return: port number to connect to

Parameters:

   $mirror     

[ Top ]

getServer   [line 744]

string|false getServer( )


[ Top ]

getSSL   [line 788]

bool getSSL( [ $mirror = false])

  • Return: Determines whether secure sockets layer (SSL) is used to connect to this channel

Parameters:

   $mirror     

[ Top ]

getSummary   [line 812]

string|false getSummary( )


[ Top ]

getValidationObject   [line 1488]

PEAR_Validate|false &getValidationObject( [string|false $package = false])

Retrieve the object that can be used for custom validation
  • Return: false is returned if the validation package cannot be located

Parameters:

string|false   $package     the name of the package to validate. If the package is the channel validation package, PEAR_Validate is returned

[ Top ]

getValidationPackage   [line 1467]

string|false getValidationPackage( )

Retrieve the name of the validation package for this channel

[ Top ]

isIncludeable   [line 1533]

void isIncludeable( $path)


Parameters:

   $path     

[ Top ]

lastModified   [line 1551]

string lastModified( )

This function is used by the channel updater and retrieves a value set by

the registry, or the current time if it has not been set


[ Top ]

resetFunctions   [line 987]

void resetFunctions( string $type, [string|false $mirror = false])

Empty all protocol definitions

Parameters:

string   $type     protocol type
string|false   $mirror     mirror name, if any

[ Top ]

resetREST   [line 977]

void resetREST( [string|false $mirror = false])

Since REST does not implement RPC, provide this as a logical wrapper around

resetFunctions for REST


Parameters:

string|false   $mirror     mirror name, if any

[ Top ]

setAlias   [line 1243]

boolean setAlias( string $alias, [boolean $local = false])

  • Return: success

Parameters:

string   $alias     
boolean   $local     determines whether the alias is in channel.xml or local

[ Top ]

setBaseURL   [line 1381]

void setBaseURL( string $resourceType, string $url, [string|false $mirror = false])


Parameters:

string   $resourceType     Resource Type this url links to
string   $url     URL
string|false   $mirror     mirror name, if this is not a primary server REST base URL

[ Top ]

setDefaultPEARProtocols   [line 1022]

void setDefaultPEARProtocols( [ $version = '1.0'], [ $mirror = false])

Set a channel's protocols to the protocols supported by pearweb

Parameters:

   $version     
   $mirror     

[ Top ]

setName   [line 1081]

string|false setName( string $name)


Parameters:

string   $name     

[ Top ]

setPort   [line 1091]

void setPort( integer $port, [string|false $mirror = false])

Set the socket number (port) that is used to connect to this channel

Parameters:

integer   $port     
string|false   $mirror     name of the mirror server, or false for the primary

[ Top ]

setServer   [line 1184]

string|false setServer( string $server, [ $mirror = false])


Parameters:

string   $server     
   $mirror     

[ Top ]

setSSL   [line 1126]

void setSSL( [bool $ssl = true], [string|false $mirror = false])

Set the socket number (port) that is used to connect to this channel

Parameters:

bool   $ssl     Determines whether to turn on SSL support or turn it off
string|false   $mirror     name of the mirror server, or false for the primary

[ Top ]

setSummary   [line 1224]

boolean setSummary( string $summary)

  • Return: success

Parameters:

string   $summary     

[ Top ]

setValidationPackage   [line 1284]

boolean setValidationPackage( string|false $validateclass, $version)

Set the package validation object if it differs from PEAR's default The class must be includeable via changing _ in the classname to path separator, but no checking of this is made.
  • Return: success

Parameters:

string|false   $validateclass     pass in false to reset to the default packagename regex
   $version     

[ Top ]

supports   [line 886]

boolean supports( string $type, [string $name = null], [string $mirror = false], [string $version = '1.0'])


Parameters:

string   $type     protocol type
string   $name     protocol name
string   $mirror     version
string   $version     mirror name

[ Top ]

supportsREST   [line 918]

bool supportsREST( [string $mirror = false])

Determines whether a channel supports Representational State Transfer (REST) protocols

for retrieving channel information


Parameters:

string   $mirror     

[ Top ]

toArray   [line 299]

array toArray( )


[ Top ]

toXml   [line 444]

string toXml( )

Return an XML document based on previous parsing and modifications
  • Return: XML data
  • Access: public

[ Top ]

validate   [line 595]

boolean validate( )

Validate parsed file.
  • Access: public

[ Top ]

validChannelServer   [line 721]

bool validChannelServer( $server, string $ver)

Test whether a string contains a valid channel server.

Parameters:

string   $ver     the package version to test
   $server     

[ Top ]

_getErrorMessage   [line 208]

array _getErrorMessage( )

  • Access: protected

[ Top ]


Documentation generated on Sat, 12 Jul 2014 14:00:25 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.