blueshoes php application framework and cms            packageless
[ class tree: packageless ] [ index: packageless ] [ all elements ]

Class: XPathBase

Source Location: /lib/XPath/XPath.class.php

Class Overview


**********************************************************************************************


Variables

Methods


Child classes:

XPathEngine
**********************************************************************************************

Inherited Variables

Inherited Methods


Class Details

[line 168]
**********************************************************************************************

=============================================================================================== X P a t h B a s e - Class =============================================================================================== **********************************************************************************************




[ Top ]


Class Variables

$aDebugOpenLinks = array()

[line 176]


Type:   mixed


[ Top ]

$bDebugXmlParse =  FALSE

[line 172]


Type:   mixed


[ Top ]

$iDebugNextLinkNumber =  1

[line 175]


Type:   mixed


[ Top ]

$_lastError =

[line 169]


Type:   mixed


[ Top ]



Class Methods


constructor XPathBase [line 181]

XPathBase XPathBase( )

Constructor



[ Top ]

method getLastError [line 537]

string getLastError( )

Returns the last occured error message.



Tags:

return:  (may be empty if there was no error at all)
see:  XPathBase::_setLastError(), XPathBase::$_lastError
access:  public


[ Top ]

method reset [line 214]

void reset( )

Resets the object so it's able to take a new xml sting/file

Constructing objects is slow. If you can, reuse ones that you have used already by using this reset() function.




Overridden in child classes as:

XPathEngine::reset()
Resets the object so it's able to take a new xml sting/file
XPath::reset()
Resets the object so it's able to take a new xml sting/file

[ Top ]

method setVerbose [line 518]

void setVerbose( [$levelOfVerbosity $levelOfVerbosity = 1])

Alter the verbose (error) level reporting.

Pass an int. >0 to turn on, 0 to turn off. The higher the number, the higher the level of verbosity. By default, the class has a verbose level of 1.




Parameters:

$levelOfVerbosity   $levelOfVerbosity   (int) default is 1 = on

[ Top ]

method _afterstr [line 499]

(string) _afterstr( $string $string, $delimiter $delimiter, [mixed $offset = 0])

Retrieves a substring after a delimiter.

This method retrieves everything from a string after a given delimiter, not including the delimiter.




Tags:

return:  Substring from the original string after the delimiter.
see:  XPathBase::_prestr()


Parameters:

$string   $string   (string) String, from which the substring should be extracted.
$delimiter   $delimiter   (string) String containing the delimiter to use.

[ Top ]

method _beginDebugFunction [line 609]

(array) _beginDebugFunction( $functionName $functionName)

Called to begin the debug run of a function.

This method starts a <DIV>




Tags:

return:  the output from the microtime() function.
see:  XPathBase::_closeDebugFunction()
author:  Sam Blum <mailto:bs_php@infeer.com>
author:  Nigel Swinson <mailto:nigelswinson@users.sourceforge.net>


Parameters:

$functionName   $functionName   (string) the name of the function we are beginning to debug

[ Top ]

method _bracketExplode [line 317]

(array) _bracketExplode( $separator $separator, $term $term)

Split a string by a searator-string -- BUT the separator-string must be located *outside* of any brackets.

Returns an array of strings, each of which is a substring of string formed by splitting it on boundaries formed by the string separator.




Tags:

return:  see above


Parameters:

$separator   $separator   (string) String that should be searched.
$term   $term   (string) String in which the search shall take place.

[ Top ]

method _bracketsCheck [line 228]

(bool) _bracketsCheck( $term $term)

This method checks the right amount and match of brackets



Tags:

return:  TRUE: OK / FALSE: KO


Parameters:

$term   $term   (string) String in which is checked.

[ Top ]

method _closeDebugFunction [line 635]

void _closeDebugFunction( $aStartTime $aStartTime, [$return_value $returnValue = ""])

Called to end the debug run of a function.

This method ends a <DIV>




Tags:

author:  Nigel Swinson <mailto:nigelswinson@users.sourceforge.net>


Parameters:

$aStartTime   $aStartTime   (array) the time that the function call was started.
$return_value   $returnValue   (mixed) the return value from the function call that we are debugging

[ Top ]

method _displayError [line 573]

void _displayError( $message $message, [$lineNumber $lineNumber = '-'], [$terminate $file = '-'], [mixed $terminate = TRUE])

Displays an error message.

This method displays an error messages depending on the users verbose settings and sets the last error message.

If also possibly stops the execution of the script. ### Terminate should not be allowed --fab. Should it?? N.S.




Parameters:

$message   $message   (string) Error message to be displayed.
$lineNumber   $lineNumber   (int) line number given by __LINE__
$terminate   $file   (bool) (default TURE) End the execution of this script.

[ Top ]

method _displayMessage [line 590]

void _displayMessage( $message $message, [$lineNumber $lineNumber = '-'], [mixed $file = '-'])

Displays a diagnostic message

This method displays an error messages




Parameters:

$message   $message   (string) Error message to be displayed.
$lineNumber   $lineNumber   (int) line number given by __LINE__

[ Top ]

method _getEndGroups [line 395]

(array) _getEndGroups( $string $string, [$open $open = '['], [$close $close = ']'])

Split a string at it's groups, ie bracketed expressions

Returns an array of strings, when concatenated together would produce the original string. ie a(b)cde(f)(g) would map to: array ('a', '(b)', cde', '(f)', '(g)')




Tags:

return:  The parsed string, see above


Parameters:

$string   $string   (string) The string to process
$open   $open   (string) The substring for the open of a group
$close   $close   (string) The substring for the close of a group

[ Top ]

method _prestr [line 481]

(string) _prestr( $string &$string, $delimiter $delimiter, [mixed $offset = 0])

Retrieves a substring before a delimiter.

This method retrieves everything from a string before a given delimiter, not including the delimiter.




Tags:

return:  Substring from the original string before the delimiter.
see:  XPathBase::_afterstr()


Parameters:

$string   &$string   (string) String, from which the substring should be extracted.
$delimiter   $delimiter   (string) String containing the delimiter to use.

[ Top ]

method _printContext [line 673]

void _printContext( $context $context)

Echo an XPath context for diagnostic purposes



Parameters:

$context   $context   (array) An XPath context

[ Top ]

method _profileFunction [line 660]

void _profileFunction( $aStartTime $aStartTime, $alertString $alertString)

Call to return time since start of function for Profiling



Parameters:

$aStartTime   $aStartTime   (array) the time that the function call was started.
$alertString   $alertString   (string) the string to describe what has just finished happening

[ Top ]

method _searchString [line 285]

(int) _searchString( $term $term, $expression $expression)

Looks for a string within another string -- BUT the search-string must be located *outside* of any brackets.

This method looks for a string within another string. Brackets in the string the method is looking through will be respected, which means that only if the string the method is looking for is located outside of brackets, the search will be successful.




Tags:

return:  This method returns -1 if no string was found, otherwise the offset at which the string was found.


Parameters:

$term   $term   (string) String in which the search shall take place.
$expression   $expression   (string) String that should be searched.

[ Top ]

method _setLastError [line 556]

void _setLastError( [$message $message = ''], [$line $line = '-'], [mixed $file = '-'])

Creates a textual error message and sets it.

example: 'XPath error in THIS_FILE_NAME:LINE. Message: YOUR_MESSAGE';

I don't think the message should include any markup because not everyone wants to debug into the browser window.

You should call _displayError() rather than _setLastError() if you would like the message, dependant on their verbose settings, echoed to the screen.




Tags:



Parameters:

$message   $message   (string) a textual error message default is ''
$line   $line   (int) the line number where the error occured, use __LINE__

[ Top ]

method _treeDump [line 685]

void _treeDump( $node $node, [$indent $indent = ''])

This is a debug helper function. It dumps the node-tree as HTML

*QUICK AND DIRTY*. Needs some polishing.




Parameters:

$node   $node   (array) A node
$indent   $indent   (string) (optional, default=''). For internal recursive calls.

[ Top ]


Documentation generated on Mon, 29 Dec 2003 21:16:30 +0100 by phpDocumentor 1.2.3