Class XPathBase

Description

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

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

Located in /web/phpsysinfo/includes/XPath.class.php (line 174)


	
			
Direct descendents
Class Description
 class XPathEngine **********************************************************************************************
Variable Summary
Method Summary
 XPathBase XPathBase ()
 string getLastError ()
 void reset ()
 void setVerbose ([$levelOfVerbosity $levelOfVerbosity = 1])
 (string) _afterstr ($string $string, $delimiter $delimiter, [ $offset = 0])
 (array) _beginDebugFunction ($functionName $functionName, $bDebugFlag $bDebugFlag)
 (array) _bracketExplode ($separator $separator, $term $term)
 (bool) _bracketsCheck ($term $term)
 void _closeDebugFunction ($functionName $functionName, [$return_value $returnValue = ""], $bDebugFlag $bDebugFlag)
 void _displayError ($message $message, [$lineNumber $lineNumber = '-'], [$terminate $file = '-'], [ $terminate = TRUE])
 void _displayMessage ($message $message, [$lineNumber $lineNumber = '-'], [ $file = '-'])
 (array) _getEndGroups ($string $string, [$open $open = '['], [$close $close = ']'])
 (string) _prestr ($string &$string, $delimiter $delimiter, [ $offset = 0])
 void _printContext ($context $context)
 void _ProfBegin ( $sonFuncName)
 void _ProfEnd ( $sonFuncName)
 void _ProfileToHtml ()
 (int) _searchString ($term $term, $expression $expression)
 void _setLastError ([$message $message = ''], [$line $line = '-'], [ $file = '-'])
 void _treeDump ($node $node, [$indent $indent = ''])
Variables
mixed $aDebugFunctions = array(
//'_evaluatePrimaryExpr',
//'_evaluateExpr',
//'_evaluateStep',
//'_checkPredicates',
//'_evaluateFunction',
//'_evaluateOperator',
//'_evaluatePathExpr',
)
(line 186)
mixed $aDebugOpenLinks = array() (line 185)
mixed $bClassProfiling = FALSE (line 181)
mixed $bDebugXmlParse = FALSE (line 178)
mixed $iDebugNextLinkNumber = 1 (line 184)
mixed $_lastError (line 175)
Methods
Constructor XPathBase (line 199)

Constructor

XPathBase XPathBase ()
getLastError (line 561)

Returns the last occured error message.

string getLastError ()
reset (line 238)

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.

void reset ()

Redefined in descendants as:
setVerbose (line 542)

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.

void setVerbose ([$levelOfVerbosity $levelOfVerbosity = 1])
  • $levelOfVerbosity $levelOfVerbosity: (int) default is 1 = on
_afterstr (line 523)

Retrieves a substring after a delimiter.

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

(string) _afterstr ($string $string, $delimiter $delimiter, [ $offset = 0])
  • $string $string: (string) String, from which the substring should be extracted.
  • $delimiter $delimiter: (string) String containing the delimiter to use.
  • $offset
_beginDebugFunction (line 634)

Called to begin the debug run of a function.

This method starts a <DIV>

(array) _beginDebugFunction ($functionName $functionName, $bDebugFlag $bDebugFlag)
  • $functionName $functionName: (string) the name of the function we are beginning to debug
  • $bDebugFlag $bDebugFlag: (bool) TRUE if we are to draw a call stack, FALSE otherwise
_bracketExplode (line 341)

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.

  • return: see above
(array) _bracketExplode ($separator $separator, $term $term)
  • $separator $separator: (string) String that should be searched.
  • $term $term: (string) String in which the search shall take place.
_bracketsCheck (line 252)

This method checks the right amount and match of brackets

  • return: TRUE: OK / FALSE: KO
(bool) _bracketsCheck ($term $term)
  • $term $term: (string) String in which is checked.
_closeDebugFunction (line 667)

Called to end the debug run of a function.

This method ends a <DIV>

void _closeDebugFunction ($functionName $functionName, [$return_value $returnValue = ""], $bDebugFlag $bDebugFlag)
  • $functionName $functionName: (string) the name of the function we are beginning to debug
  • $return_value $returnValue: (mixed) the return value from the function call that we are debugging
  • $bDebugFlag $bDebugFlag: (bool) TRUE if we are to draw a call stack, FALSE otherwise
_displayError (line 597)

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.

void _displayError ($message $message, [$lineNumber $lineNumber = '-'], [$terminate $file = '-'], [ $terminate = TRUE])
  • $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.
  • $terminate
_displayMessage (line 614)

Displays a diagnostic message

This method displays an error messages

void _displayMessage ($message $message, [$lineNumber $lineNumber = '-'], [ $file = '-'])
  • $message $message: (string) Error message to be displayed.
  • $lineNumber $lineNumber: (int) line number given by __LINE__
  • $file
_getEndGroups (line 419)

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)')

  • return: The parsed string, see above
(array) _getEndGroups ($string $string, [$open $open = '['], [$close $close = ']'])
  • $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
_prestr (line 505)

Retrieves a substring before a delimiter.

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

(string) _prestr ($string &$string, $delimiter $delimiter, [ $offset = 0])
  • $string &$string: (string) String, from which the substring should be extracted.
  • $delimiter $delimiter: (string) String containing the delimiter to use.
  • $offset
_printContext (line 802)

Echo an XPath context for diagnostic purposes

void _printContext ($context $context)
  • $context $context: (array) An XPath context
_ProfBegin (line 695)

Profile begin call

void _ProfBegin ( $sonFuncName)
  • $sonFuncName
_ProfEnd (line 732)

Profile end call

void _ProfEnd ( $sonFuncName)
  • $sonFuncName
_ProfileToHtml (line 757)

Show profile gathered so far as HTML table

void _ProfileToHtml ()
_searchString (line 309)

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.

  • return: This method returns -1 if no string was found, otherwise the offset at which the string was found.
(int) _searchString ($term $term, $expression $expression)
  • $term $term: (string) String in which the search shall take place.
  • $expression $expression: (string) String that should be searched.
_setLastError (line 580)

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.

void _setLastError ([$message $message = ''], [$line $line = '-'], [ $file = '-'])
  • $message $message: (string) a textual error message default is ''
  • $line $line: (int) the line number where the error occured, use __LINE__
  • $file
_treeDump (line 814)

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

*QUICK AND DIRTY*. Needs some polishing.

void _treeDump ($node $node, [$indent $indent = ''])
  • $node $node: (array) A node
  • $indent $indent: (string) (optional, default=''). For internal recursive calls.

Documentation generated on Mon, 06 Oct 2008 01:10:55 +0200 by phpDocumentor 1.4.0