![]() |
Bearsampp 2026.9.23
|
Public Member Functions | |
| __construct () | |
| _fromArray ($data) | |
| _getErrorMessage () | |
| _makeFunctionsXml ($functions, $indent, $rest=false) | |
| _makeMirrorsXml ($channelInfo) | |
| _makeRestXml ($info, $indent) | |
| _unIndent ($str) | |
| _validateError ($code, $params=array()) | |
| _validateFunctions ($protocol, $functions, $parent='') | |
| _validateWarning ($code, $params=array()) | |
| addFunction ($type, $version, $name='', $mirror=false) | |
| addMirror ($server, $port=null) | |
| addMirrorFunction ($mirror, $type, $version, $name='') | |
| fromAny ($info) | |
| fromXmlFile ($descfile) | |
| fromXmlString ($data) | |
| getAlias () | |
| getBaseURL ($resourceType, $mirror=false) | |
| getErrors ($purge=false) | |
| getFunction ($type, $name=null, $mirror=false) | |
| getFunctions ($protocol, $mirror=false) | |
| getMirror ($server) | |
| getMirrors () | |
| getName () | |
| getPort ($mirror=false) | |
| getServer () | |
| getSSL ($mirror=false) | |
| getSummary () | |
| & | getValidationObject ($package=false) |
| getValidationPackage () | |
| isIncludeable ($path) | |
| lastModified () | |
| resetFunctions ($type, $mirror=false) | |
| resetREST ($mirror=false) | |
| setAlias ($alias, $local=false) | |
| setBaseURL ($resourceType, $url, $mirror=false) | |
| setDefaultPEARProtocols ($version='1.0', $mirror=false) | |
| setName ($name) | |
| setPort ($port, $mirror=false) | |
| setServer ($server, $mirror=false) | |
| setSSL ($ssl=true, $mirror=false) | |
| setSummary ($summary) | |
| setValidationPackage ($validateclass, $version) | |
| supports ($type, $name=null, $mirror=false, $version='1.0') | |
| supportsREST ($mirror=false) | |
| toArray () | |
| toXml () | |
| validate () | |
| validChannelServer ($server) | |
Static Public Member Functions | |
| static & | fromArray ( $data, $compatibility=false, $stackClass='PEAR_ErrorStack') |
| static & | fromArrayWithErrors ( $data, $compatibility=false, $stackClass='PEAR_ErrorStack') |
Data Fields | |
| $_channelInfo | |
| $_isValid = false | |
| $_mirrorIndex | |
| $_stack | |
| $_subchannelIndex | |
| $_supportedVersions = array('1.0') | |
Definition at line 152 of file ChannelFile.php.
| __construct | ( | ) |
Definition at line 196 of file ChannelFile.php.
References _getErrorMessage().
| _fromArray | ( | $data | ) |
| array | @access private |
Definition at line 342 of file ChannelFile.php.
| _getErrorMessage | ( | ) |
Definition at line 207 of file ChannelFile.php.
References PEAR_CHANNELFILE_ERROR_CANT_MAKE_PARSER, PEAR_CHANNELFILE_ERROR_EMPTY_REGEX, PEAR_CHANNELFILE_ERROR_INVALID, PEAR_CHANNELFILE_ERROR_INVALID_HOST, PEAR_CHANNELFILE_ERROR_INVALID_MIRROR, PEAR_CHANNELFILE_ERROR_INVALID_MIRRORTYPE, PEAR_CHANNELFILE_ERROR_INVALID_NAME, PEAR_CHANNELFILE_ERROR_INVALID_PORT, PEAR_CHANNELFILE_ERROR_INVALID_SSL, PEAR_CHANNELFILE_ERROR_INVALID_VERSION, PEAR_CHANNELFILE_ERROR_MIRROR_NOT_FOUND, PEAR_CHANNELFILE_ERROR_MULTILINE_SUMMARY, PEAR_CHANNELFILE_ERROR_NO_FUNCTIONNAME, PEAR_CHANNELFILE_ERROR_NO_FUNCTIONVERSION, PEAR_CHANNELFILE_ERROR_NO_HOST, PEAR_CHANNELFILE_ERROR_NO_NAME, PEAR_CHANNELFILE_ERROR_NO_STATICVERSION, PEAR_CHANNELFILE_ERROR_NO_SUMMARY, PEAR_CHANNELFILE_ERROR_NO_VERSION, PEAR_CHANNELFILE_ERROR_NO_XML_EXT, PEAR_CHANNELFILE_ERROR_NOBASEURLTYPE, PEAR_CHANNELFILE_ERROR_NOVALIDATE_NAME, PEAR_CHANNELFILE_ERROR_NOVALIDATE_VERSION, PEAR_CHANNELFILE_ERROR_PARSER_ERROR, and PEAR_CHANNELFILE_URI_CANT_MIRROR.
Referenced by __construct().
| _makeFunctionsXml | ( | $functions, | |
| $indent, | |||
| $rest = false ) |
Generate the <functions> tag @access private
Definition at line 551 of file ChannelFile.php.
| _makeMirrorsXml | ( | $channelInfo | ) |
Generate the <mirrors> tag @access private
Definition at line 520 of file ChannelFile.php.
References _makeRestXml().
Referenced by toXml().
| _makeRestXml | ( | $info, | |
| $indent ) |
Generate the <rest> tag @access private
Definition at line 499 of file ChannelFile.php.
Referenced by _makeMirrorsXml(), and toXml().
| _unIndent | ( | $str | ) |
Unindent given string (?)
| string | $str | The string that has to be unindented. |
Definition at line 364 of file ChannelFile.php.
| _validateError | ( | $code, | |
| $params = array() ) |
Validation error. Also marks the object contents as invalid
| error | code |
| array | error information @access private |
Definition at line 573 of file ChannelFile.php.
Referenced by _validateFunctions(), addMirrorFunction(), setAlias(), setBaseURL(), setPort(), setServer(), setSSL(), setSummary(), toXml(), and validate().
| _validateFunctions | ( | $protocol, | |
| $functions, | |||
| $parent = '' ) |
| string | rest - protocol name this function applies to |
| array | the functions |
| string | the name of the parent element (mirror name, for instance) |
Definition at line 689 of file ChannelFile.php.
References _validateError(), PEAR_CHANNELFILE_ERROR_NO_FUNCTIONNAME, PEAR_CHANNELFILE_ERROR_NO_FUNCTIONVERSION, and PEAR_CHANNELFILE_ERROR_NOBASEURLTYPE.
Referenced by validate().
| _validateWarning | ( | $code, | |
| $params = array() ) |
Validation warning. Does not mark the object contents invalid.
| error | code |
| array | error information @access private |
Definition at line 585 of file ChannelFile.php.
Referenced by setSummary(), and validate().
| addFunction | ( | $type, | |
| $version, | |||
| $name = '', | |||
| $mirror = false ) |
Add a protocol to the provides section
| string | protocol type |
| string | protocol version |
| string | protocol name, if any |
| string | mirror name, if this is a mirror's protocol |
Definition at line 1302 of file ChannelFile.php.
References addMirrorFunction().
| addMirror | ( | $server, | |
| $port = null ) |
| string | mirror server |
| int | mirror http port |
Definition at line 1439 of file ChannelFile.php.
References $port.
| addMirrorFunction | ( | $mirror, | |
| $type, | |||
| $version, | |||
| $name = '' ) |
Add a protocol to a mirror's provides section
| string | mirror name (server) |
| string | protocol type |
| string | protocol version |
| string | protocol name, if any |
Definition at line 1335 of file ChannelFile.php.
References _validateError(), and PEAR_CHANNELFILE_ERROR_MIRROR_NOT_FOUND.
Referenced by addFunction().
| fromAny | ( | $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
| string | Filename of the source or the source itself |
Definition at line 413 of file ChannelFile.php.
References fromXmlFile(), and fromXmlString().
|
static |
| array |
Definition at line 311 of file ChannelFile.php.
Referenced by PEAR_ChannelFile_Parser\parse().
|
static |
Unlike fromArray() this does not do any validation
| array |
Definition at line 330 of file ChannelFile.php.
Referenced by PEAR_Registry\_getChannel().
| fromXmlFile | ( | $descfile | ) |
Parse a channel.xml file. Expects the name of a channel xml file as input.
| string | $descfile | name of channel xml file |
Definition at line 388 of file ChannelFile.php.
References fromXmlString().
Referenced by fromAny().
| fromXmlString | ( | $data | ) |
| string | contents of package.xml file |
Definition at line 268 of file ChannelFile.php.
References $result, PEAR_CHANNELFILE_ERROR_CANT_MAKE_PARSER, PEAR_CHANNELFILE_ERROR_INVALID_VERSION, PEAR_CHANNELFILE_ERROR_NO_VERSION, and PEAR_CHANNELFILE_ERROR_NO_XML_EXT.
Referenced by PEAR_Command_Channels\doInfo(), PEAR_Command_Channels\doUpdate(), fromAny(), and fromXmlFile().
| getAlias | ( | ) |
Definition at line 1264 of file ChannelFile.php.
| getBaseURL | ( | $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
| string | Resource Type to retrieve |
Definition at line 943 of file ChannelFile.php.
References getMirror().
| getErrors | ( | $purge = false | ) |
Wrapper to PEAR_ErrorStack::getErrors()
| boolean | determines whether to purge the error stack after retrieving |
Definition at line 352 of file ChannelFile.php.
| getFunction | ( | $type, | |
| $name = null, | |||
| $mirror = false ) |
| string | Protocol type |
| string | Function name (null to return the first protocol of the type requested) |
| string | Mirror name, if any |
Definition at line 858 of file ChannelFile.php.
References getFunctions().
| getFunctions | ( | $protocol, | |
| $mirror = false ) |
| string | protocol type |
| string | Mirror name |
Definition at line 827 of file ChannelFile.php.
References getMirror(), and getName().
Referenced by getFunction(), and supports().
| getMirror | ( | $server | ) |
Get the unserialized XML representing a mirror
Definition at line 1065 of file ChannelFile.php.
References getMirrors().
Referenced by getBaseURL(), getFunctions(), getPort(), getSSL(), and supportsREST().
| getMirrors | ( | ) |
Definition at line 1047 of file ChannelFile.php.
Referenced by getMirror().
| getName | ( | ) |
Definition at line 733 of file ChannelFile.php.
Referenced by getFunctions().
| getPort | ( | $mirror = false | ) |
Definition at line 757 of file ChannelFile.php.
References getMirror(), and getSSL().
| getServer | ( | ) |
Definition at line 745 of file ChannelFile.php.
| getSSL | ( | $mirror = false | ) |
Definition at line 789 of file ChannelFile.php.
References getMirror().
Referenced by getPort().
| getSummary | ( | ) |
Definition at line 813 of file ChannelFile.php.
| & getValidationObject | ( | $package = false | ) |
Retrieve the object that can be used for custom validation
| string|false | the name of the package to validate. If the package is the channel validation package, PEAR_Validate is returned |
Definition at line 1489 of file ChannelFile.php.
References isIncludeable(), and validate().
| getValidationPackage | ( | ) |
Retrieve the name of the validation package for this channel
Definition at line 1468 of file ChannelFile.php.
References validate().
| isIncludeable | ( | $path | ) |
Definition at line 1534 of file ChannelFile.php.
Referenced by getValidationObject().
| 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
Definition at line 1552 of file ChannelFile.php.
| resetFunctions | ( | $type, | |
| $mirror = false ) |
Empty all protocol definitions
| string | protocol type |
| string|false | mirror name, if any |
Definition at line 988 of file ChannelFile.php.
Referenced by resetREST().
| resetREST | ( | $mirror = false | ) |
Since REST does not implement RPC, provide this as a logical wrapper around resetFunctions for REST
| string|false | mirror name, if any |
Definition at line 978 of file ChannelFile.php.
References resetFunctions().
Referenced by setDefaultPEARProtocols().
| setAlias | ( | $alias, | |
| $local = false ) |
| string | |
| boolean | determines whether the alias is in channel.xml or local |
Definition at line 1244 of file ChannelFile.php.
References _validateError(), PEAR_CHANNELFILE_ERROR_INVALID_NAME, and validChannelServer().
Referenced by PEAR_Registry\_initializeChannelDirs().
| setBaseURL | ( | $resourceType, | |
| $url, | |||
| $mirror = false ) |
| string | Resource Type this url links to |
| string | URL |
| string|false | mirror name, if this is not a primary server REST base URL |
Definition at line 1382 of file ChannelFile.php.
References _validateError(), and PEAR_CHANNELFILE_ERROR_MIRROR_NOT_FOUND.
| setDefaultPEARProtocols | ( | $version = '1.0', | |
| $mirror = false ) |
Set a channel's protocols to the protocols supported by pearweb
Definition at line 1023 of file ChannelFile.php.
References resetREST().
| setName | ( | $name | ) |
| string |
Definition at line 1082 of file ChannelFile.php.
References setServer().
Referenced by PEAR_Registry\_getChannel(), and PEAR_Registry\_initializeChannelDirs().
| setPort | ( | $port, | |
| $mirror = false ) |
Set the socket number (port) that is used to connect to this channel
| integer | |
| string|false | name of the mirror server, or false for the primary |
Definition at line 1092 of file ChannelFile.php.
References $port, _validateError(), and PEAR_CHANNELFILE_ERROR_MIRROR_NOT_FOUND.
| setServer | ( | $server, | |
| $mirror = false ) |
| string |
Definition at line 1185 of file ChannelFile.php.
References _validateError(), PEAR_CHANNELFILE_ERROR_INVALID_NAME, PEAR_CHANNELFILE_ERROR_MIRROR_NOT_FOUND, and validChannelServer().
Referenced by PEAR_Registry\_getChannel(), and setName().
| setSSL | ( | $ssl = true, | |
| $mirror = false ) |
Set the socket number (port) that is used to connect to this channel
| bool | Determines whether to turn on SSL support or turn it off |
| string|false | name of the mirror server, or false for the primary |
Definition at line 1127 of file ChannelFile.php.
References _validateError(), and PEAR_CHANNELFILE_ERROR_MIRROR_NOT_FOUND.
| setSummary | ( | $summary | ) |
| string |
Definition at line 1225 of file ChannelFile.php.
References _validateError(), _validateWarning(), PEAR_CHANNELFILE_ERROR_MULTILINE_SUMMARY, and PEAR_CHANNELFILE_ERROR_NO_SUMMARY.
| setValidationPackage | ( | $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.
| string|false | pass in false to reset to the default packagename regex |
Definition at line 1285 of file ChannelFile.php.
| supports | ( | $type, | |
| $name = null, | |||
| $mirror = false, | |||
| $version = '1.0' ) |
| string | protocol type |
| string | protocol name |
| string | version |
| string | mirror name |
Definition at line 887 of file ChannelFile.php.
References getFunctions().
| supportsREST | ( | $mirror = false | ) |
Determines whether a channel supports Representational State Transfer (REST) protocols for retrieving channel information
| string |
Definition at line 919 of file ChannelFile.php.
References getMirror().
| toArray | ( | ) |
Definition at line 298 of file ChannelFile.php.
References $_channelInfo, and validate().
| toXml | ( | ) |
Return an XML document based on previous parsing and modifications
@access public
Definition at line 445 of file ChannelFile.php.
References $_channelInfo, _makeMirrorsXml(), _makeRestXml(), _validateError(), PEAR_CHANNELFILE_ERROR_INVALID, and validate().
| validate | ( | ) |
Validate parsed file.
@access public
Definition at line 596 of file ChannelFile.php.
References $_channelInfo, $_isValid, _validateError(), _validateFunctions(), _validateWarning(), PEAR_CHANNELFILE_ERROR_INVALID_HOST, PEAR_CHANNELFILE_ERROR_INVALID_NAME, PEAR_CHANNELFILE_ERROR_INVALID_PORT, PEAR_CHANNELFILE_ERROR_INVALID_SSL, PEAR_CHANNELFILE_ERROR_MULTILINE_SUMMARY, PEAR_CHANNELFILE_ERROR_NO_HOST, PEAR_CHANNELFILE_ERROR_NO_NAME, PEAR_CHANNELFILE_ERROR_NO_SUMMARY, PEAR_CHANNELFILE_ERROR_NOVALIDATE_NAME, PEAR_CHANNELFILE_ERROR_NOVALIDATE_VERSION, PEAR_CHANNELFILE_URI_CANT_MIRROR, and validChannelServer().
Referenced by getValidationObject(), getValidationPackage(), toArray(), and toXml().
| validChannelServer | ( | $server | ) |
Test whether a string contains a valid channel server.
| string | $ver | the package version to test |
Definition at line 722 of file ChannelFile.php.
References PEAR_CHANNELS_SERVER_PREG.
Referenced by setAlias(), setServer(), and validate().
| $_channelInfo |
Definition at line 173 of file ChannelFile.php.
Referenced by toArray(), toXml(), and validate().
| $_isValid = false |
Definition at line 194 of file ChannelFile.php.
Referenced by validate().
| $_mirrorIndex |
Definition at line 187 of file ChannelFile.php.
| $_stack |
Definition at line 159 of file ChannelFile.php.
| $_subchannelIndex |
Definition at line 180 of file ChannelFile.php.
| $_supportedVersions = array('1.0') |
Definition at line 166 of file ChannelFile.php.