Version 3.2.3
This commit is contained in:
1 parent
ae5c01cc78
commit
78706903a2
2641 files changed
+228363
-201264
No files matched your search
@@ -3,19 +3,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* XML Handler: Can use PHP's internal XML handler, or a lite hand-rolled parser, to create and read XML files
|
||||
* Last Updated: $Date: 2010-01-15 10:18:25 -0500 (Fri, 15 Jan 2010) $
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Kernel
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since 25th February 2004
|
||||
* @version $Revision: 370 $
|
||||
* @version $Revision: 8644 $
|
||||
*
|
||||
*
|
||||
* Example Usage:
|
||||
@@ -196,7 +196,7 @@ class class_xml
|
||||
*
|
||||
* @access public
|
||||
* @param string Raw XML Data
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function xml_parse_document( $xml )
|
||||
{
|
||||
@@ -257,7 +257,7 @@ class class_xml
|
||||
*
|
||||
* @access public
|
||||
* @param array Entry array
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function xml_format_document( $entry=array() )
|
||||
{
|
||||
@@ -280,7 +280,7 @@ class class_xml
|
||||
* @access public
|
||||
* @param string Root tag name
|
||||
* @param array Root tag attributes
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function xml_set_root($tag, $attributes=array() )
|
||||
{
|
||||
@@ -294,7 +294,7 @@ class class_xml
|
||||
* @access public
|
||||
* @param string Tag name
|
||||
* @param array Entry values
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function xml_add_entry_to_group($tag, $entry=array() )
|
||||
{
|
||||
@@ -368,14 +368,14 @@ class class_xml
|
||||
* Build tree node
|
||||
* Adapted from http://eric.pollmann.net/work/public_domain/
|
||||
*
|
||||
* @access private
|
||||
* @access protected
|
||||
* @param array Values
|
||||
* @param array Values
|
||||
* @param string Counter
|
||||
* @param string Tag type
|
||||
* @return array
|
||||
*/
|
||||
private function _xmlBuildTag( $thisvals, $vals, &$i, $type )
|
||||
protected function _xmlBuildTag( $thisvals, $vals, &$i, $type )
|
||||
{
|
||||
$tag = array();
|
||||
|
||||
@@ -407,12 +407,12 @@ class class_xml
|
||||
* Build a nested array of children
|
||||
* Adapted from http://eric.pollmann.net/work/public_domain/
|
||||
*
|
||||
* @access private
|
||||
* @access protected
|
||||
* @param array Values
|
||||
* @param string Counter
|
||||
* @return array
|
||||
*/
|
||||
private function _xmlGetChildren($vals, &$i)
|
||||
protected function _xmlGetChildren($vals, &$i)
|
||||
{
|
||||
$children = array();
|
||||
|
||||
@@ -489,11 +489,11 @@ class class_xml
|
||||
/**
|
||||
* Builds attribute string
|
||||
*
|
||||
* @access private
|
||||
* @access protected
|
||||
* @param array Values
|
||||
* @return string
|
||||
*/
|
||||
private function _xmlBuildAttributeString( $array = array() )
|
||||
protected function _xmlBuildAttributeString( $array = array() )
|
||||
{
|
||||
if ( is_array( $array ) and count( $array ) )
|
||||
{
|
||||
@@ -513,11 +513,11 @@ class class_xml
|
||||
/**
|
||||
* Encode XML attribute (Make safe for transport)
|
||||
*
|
||||
* @access private
|
||||
* @access protected
|
||||
* @param string Raw data
|
||||
* @return string Converted Data
|
||||
*/
|
||||
private function _xmlEncodeAttribute( $t )
|
||||
protected function _xmlEncodeAttribute( $t )
|
||||
{
|
||||
$t = preg_replace("/&(?!#[0-9]+;)/s", '&', $t );
|
||||
$t = str_replace( "<", "<" , $t );
|
||||
@@ -531,11 +531,11 @@ class class_xml
|
||||
/**
|
||||
* Decode XML attribute (Make safe for transport)
|
||||
*
|
||||
* @access private
|
||||
* @access protected
|
||||
* @param string Raw data
|
||||
* @return string Converted Data
|
||||
*/
|
||||
private function _xmlDecodeAttribute( $t )
|
||||
protected function _xmlDecodeAttribute( $t )
|
||||
{
|
||||
$t = str_replace( "&" , "&", $t );
|
||||
$t = str_replace( "<" , "<", $t );
|
||||
@@ -549,11 +549,11 @@ class class_xml
|
||||
/**
|
||||
* Encode XML attribute (Make safe for transport)
|
||||
*
|
||||
* @access private
|
||||
* @access protected
|
||||
* @param string Raw data
|
||||
* @return string Converted Data
|
||||
*/
|
||||
private function _xmlEncodeString( $v )
|
||||
protected function _xmlEncodeString( $v )
|
||||
{
|
||||
if ( preg_match( "/['\"\[\]<>&]/", $v ) )
|
||||
{
|
||||
@@ -571,11 +571,11 @@ class class_xml
|
||||
/**
|
||||
* Encode CDATA XML attribute (Make safe for transport)
|
||||
*
|
||||
* @access private
|
||||
* @access protected
|
||||
* @param string Raw data
|
||||
* @return string Converted Data
|
||||
*/
|
||||
private function _xmlConvertSafecdata( $v )
|
||||
protected function _xmlConvertSafecdata( $v )
|
||||
{
|
||||
# Legacy
|
||||
//$v = str_replace( "<![CDATA[", "<!ᄁ|CDATA|", $v );
|
||||
@@ -622,9 +622,9 @@ class class_xml
|
||||
*
|
||||
* @package IP.Board
|
||||
* @subpackage Kernel
|
||||
* @author $Author: bfarber $
|
||||
* @author $Author: ips_terabyte $
|
||||
* @since 25th February 2004
|
||||
* @version $Revision: 370 $
|
||||
* @version $Revision: 8644 $
|
||||
*/
|
||||
|
||||
class xml_lite_parse
|
||||
@@ -656,10 +656,10 @@ class xml_lite_parse
|
||||
/**
|
||||
* Internal: stack management
|
||||
*
|
||||
* @access private
|
||||
* @access protected
|
||||
* @var array
|
||||
*/
|
||||
private $stack = array();
|
||||
protected $stack = array();
|
||||
|
||||
/**
|
||||
* Depth level
|
||||
@@ -714,7 +714,7 @@ class xml_lite_parse
|
||||
*
|
||||
* @access public
|
||||
* @param string Raw xml document
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function xml_parse_it( $xmldoc )
|
||||
{
|
||||
@@ -742,13 +742,13 @@ class xml_lite_parse
|
||||
/**
|
||||
* Start element callback
|
||||
*
|
||||
* @access private
|
||||
* @access protected
|
||||
* @param object Parser ref
|
||||
* @param string Tag name
|
||||
* @param array Attributes
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
private function _myStartElement( &$parser_obj, $name, $attr )
|
||||
protected function _myStartElement( &$parser_obj, $name, $attr )
|
||||
{
|
||||
//-------------------------------
|
||||
// Add to stack
|
||||
@@ -807,12 +807,12 @@ class xml_lite_parse
|
||||
/**
|
||||
* End element callback
|
||||
*
|
||||
* @access private
|
||||
* @access protected
|
||||
* @param object Parser ref
|
||||
* @param string Tag name
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
private function _myEndElement( &$parser_obj, $name )
|
||||
protected function _myEndElement( &$parser_obj, $name )
|
||||
{
|
||||
$this->stack[ $this->array_id ] = array( 'tag' => $name,
|
||||
'type' => 'close',
|
||||
@@ -851,12 +851,12 @@ class xml_lite_parse
|
||||
/**
|
||||
* Parse data
|
||||
*
|
||||
* @access private
|
||||
* @access protected
|
||||
* @param object Parser ref
|
||||
* @param string Tag name
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
private function _myDataElement( &$parser_obj, $data )
|
||||
protected function _myDataElement( &$parser_obj, $data )
|
||||
{
|
||||
if ( $this->tagname )
|
||||
{
|
||||
@@ -878,12 +878,12 @@ class xml_lite_parse
|
||||
/**
|
||||
* Parse CDATA
|
||||
*
|
||||
* @access private
|
||||
* @access protected
|
||||
* @param object Parser ref
|
||||
* @param string Tag name
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
private function _myCdataElement( &$parser_obj, $data )
|
||||
protected function _myCdataElement( &$parser_obj, $data )
|
||||
{
|
||||
$this->_myDataElement( $parser_obj, $data );
|
||||
}
|
||||
@@ -892,7 +892,7 @@ class xml_lite_parse
|
||||
* Garbage collection
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function garbage_collect()
|
||||
{
|
||||
@@ -916,9 +916,9 @@ class xml_lite_parse
|
||||
*
|
||||
* @package IP.Board
|
||||
* @subpackage Kernel
|
||||
* @author $Author: bfarber $
|
||||
* @author $Author: ips_terabyte $
|
||||
* @since 25th February 2004
|
||||
* @version $Revision: 370 $
|
||||
* @version $Revision: 8644 $
|
||||
*/
|
||||
class xml_extract
|
||||
{
|
||||
@@ -988,7 +988,7 @@ class xml_extract
|
||||
*
|
||||
* @access public
|
||||
* @param string XML Document
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function xml_parse_document( $xml )
|
||||
{
|
||||
@@ -1063,11 +1063,11 @@ class xml_extract
|
||||
/**
|
||||
* Parse a tag
|
||||
*
|
||||
* @access private
|
||||
* @access protected
|
||||
* @param string Text
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
private function _parseTag( $text )
|
||||
protected function _parseTag( $text )
|
||||
{
|
||||
$attr = array();
|
||||
$text = trim($text);
|
||||
@@ -1223,11 +1223,11 @@ class xml_extract
|
||||
/**
|
||||
* Parse an attribute
|
||||
*
|
||||
* @access private
|
||||
* @access protected
|
||||
* @param string Text
|
||||
* @return array Attributes
|
||||
*/
|
||||
private function _parseAttr( $text )
|
||||
protected function _parseAttr( $text )
|
||||
{
|
||||
$text = trim($text);
|
||||
$attr_array = array();
|
||||
@@ -1364,11 +1364,11 @@ class xml_extract
|
||||
/**
|
||||
* Parse between element tags
|
||||
*
|
||||
* @access private
|
||||
* @access protected
|
||||
* @param string Text
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
private function _parseBetweenTags( $t )
|
||||
protected function _parseBetweenTags( $t )
|
||||
{
|
||||
if ( trim($t ) != '')
|
||||
{
|
||||
@@ -1379,11 +1379,11 @@ class xml_extract
|
||||
/**
|
||||
* Exec character callback
|
||||
*
|
||||
* @access private
|
||||
* @access protected
|
||||
* @param string Data
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
private function _execCharacterData( $data )
|
||||
protected function _execCharacterData( $data )
|
||||
{
|
||||
call_user_func( $this->handler_character_data, $this, $data );
|
||||
}
|
||||
@@ -1391,11 +1391,11 @@ class xml_extract
|
||||
/**
|
||||
* Exec start callback
|
||||
*
|
||||
* @access private
|
||||
* @access protected
|
||||
* @param string Data
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
private function _execStartElement( $tagname, $attr )
|
||||
protected function _execStartElement( $tagname, $attr )
|
||||
{
|
||||
call_user_func( $this->handler_start_element, $this, $tagname, $attr );
|
||||
}
|
||||
@@ -1403,11 +1403,11 @@ class xml_extract
|
||||
/**
|
||||
* Exec end callback
|
||||
*
|
||||
* @access private
|
||||
* @access protected
|
||||
* @param string Data
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
private function _execEndElement( $tagname )
|
||||
protected function _execEndElement( $tagname )
|
||||
{
|
||||
call_user_func( $this->handler_end_element, $this, $tagname );
|
||||
}
|
||||
@@ -1415,11 +1415,11 @@ class xml_extract
|
||||
/**
|
||||
* Exec cdata callback
|
||||
*
|
||||
* @access private
|
||||
* @access protected
|
||||
* @param string Data
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
private function _execCdataElement( $data )
|
||||
protected function _execCdataElement( $data )
|
||||
{
|
||||
call_user_func( $this->handler_cdata_handler, $this, $data );
|
||||
}
|
||||
@@ -1427,12 +1427,12 @@ class xml_extract
|
||||
/**
|
||||
* Set the element handler
|
||||
*
|
||||
* @access private
|
||||
* @access protected
|
||||
* @param string start handler
|
||||
* @param string end handler
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
private function _myXmlSetElementHandler($startHandler, $endHandler)
|
||||
protected function _myXmlSetElementHandler($startHandler, $endHandler)
|
||||
{
|
||||
$this->handler_start_element = $startHandler;
|
||||
$this->handler_end_element = $endHandler;
|
||||
@@ -1441,12 +1441,12 @@ class xml_extract
|
||||
/**
|
||||
* Set the data handler
|
||||
*
|
||||
* @access private
|
||||
* @access protected
|
||||
* @param string start handler
|
||||
* @param string end handler
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
private function _myXmlSetCharacterDataHandler($handler)
|
||||
protected function _myXmlSetCharacterDataHandler($handler)
|
||||
{
|
||||
$this->handler_character_data = &$handler;
|
||||
}
|
||||
@@ -1454,12 +1454,12 @@ class xml_extract
|
||||
/**
|
||||
* Set the cdata handler
|
||||
*
|
||||
* @access private
|
||||
* @access protected
|
||||
* @param string start handler
|
||||
* @param string end handler
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
private function _myXmlSetCdataSectionHandler($handler)
|
||||
protected function _myXmlSetCdataSectionHandler($handler)
|
||||
{
|
||||
$this->handler_cdata_handler = &$handler;
|
||||
}
|
||||
@@ -1467,12 +1467,12 @@ class xml_extract
|
||||
/**
|
||||
* Get nth character of text
|
||||
*
|
||||
* @access private
|
||||
* @access protected
|
||||
* @param string Text
|
||||
* @param integer Position to get
|
||||
* @return string Character
|
||||
*/
|
||||
private function _getNthCharFromEnd( $t, $i )
|
||||
protected function _getNthCharFromEnd( $t, $i )
|
||||
{
|
||||
return $t{ ( strlen( $t ) - 1 - $i ) };
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user