From: pkiddie <pk...@us...> - 2005-10-27 09:37:40
|
Update of /cvsroot/stack/stack-1-0/other/domit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8829/other/domit Modified Files: changelog.txt php_http_client_generic.php php_http_connector.php php_http_exceptions.php xml_domit_getelementsbypath.php xml_domit_lite_parser.php xml_domit_nodemaps.php xml_domit_parser.php xml_domit_shared.php xml_domit_xpath.php xml_saxy_lite_parser.php xml_saxy_parser.php xml_saxy_shared.php Log Message: Updated DOMIT XML parser library from 1.0->1.1. This solves a known problem with a notice coming up on the import of quizzes/questions Index: xml_saxy_shared.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/other/domit/xml_saxy_shared.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** xml_saxy_shared.php 25 Aug 2005 16:06:17 -0000 1.2 --- xml_saxy_shared.php 27 Oct 2005 09:37:18 -0000 1.3 *************** *** 3,7 **** * SAXY_Parser_Base is a base class for SAXY and SAXY Lite * @package saxy-xmlparser ! * @version 0.87 * @copyright (C) 2004 John Heinstein. All rights reserved * @license http://www.gnu.org/copyleft/lesser.html LGPL License --- 3,7 ---- * SAXY_Parser_Base is a base class for SAXY and SAXY Lite * @package saxy-xmlparser ! * @version 1.0 * @copyright (C) 2004 John Heinstein. All rights reserved * @license http://www.gnu.org/copyleft/lesser.html LGPL License Index: xml_domit_shared.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/other/domit/xml_domit_shared.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** xml_domit_shared.php 25 Aug 2005 16:06:17 -0000 1.2 --- xml_domit_shared.php 27 Oct 2005 09:37:18 -0000 1.3 *************** *** 2,6 **** /** * @package domit-xmlparser ! * @version 0.98 * @copyright (C) 2004 John Heinstein. All rights reserved * @author John Heinstein <joh...@nb...> --- 2,6 ---- /** * @package domit-xmlparser ! * @version 1.01 * @copyright (C) 2004 John Heinstein. All rights reserved * @author John Heinstein <joh...@nb...> *************** *** 82,85 **** --- 82,92 ---- define('DOMIT_DOCUMENT_FRAGMENT_ERR', 102); + //DOMIT! Error Modes + /** continue on error */ + define('DOMIT_ONERROR_CONTINUE', 1); + /** die on error */ + define('DOMIT_ONERROR_DIE', 2); + + /** *@global Object Instance of the UIDGenerator class *************** *** 118,128 **** /** ! * @global object Reference to custom error handler for DOMException class ! * ! * Made global to simulate a static variable in PHP 4 */ - $GLOBALS['DOMIT_DOMException_errorHandler'] = null; /** * A DOMIT! exception handling class * --- 125,141 ---- /** ! * @global object Reference to custom error handler for DOMException class */ $GLOBALS['DOMIT_DOMException_errorHandler'] = null; /** + * @global int Error mode; specifies whether to die on error or simply continue + */ + $GLOBALS['DOMIT_DOMException_mode'] = DOMIT_ONERROR_CONTINUE; + /** + * @global string Log file for errors + */ + $GLOBALS['DOMIT_DOMException_log'] = null; + + /** * A DOMIT! exception handling class * *************** *** 141,152 **** } else { ! $errorMessage = 'Error: ' . $errorNum . "\n " . $errorString; if ((!isset($GLOBALS['DOMIT_ERROR_FORMATTING_HTML'])) || ($GLOBALS['DOMIT_ERROR_FORMATTING_HTML'] == true)) { ! $errorMessage = "<p><pre>" . $errorMessage . "</pre></p>"; } ! ! die($errorMessage); } } //raiseException --- 154,183 ---- } else { ! $errorMessageText = $errorNum . ' ' . $errorString; ! $errorMessage = 'Error: ' . $errorMessageText; if ((!isset($GLOBALS['DOMIT_ERROR_FORMATTING_HTML'])) || ($GLOBALS['DOMIT_ERROR_FORMATTING_HTML'] == true)) { ! $errorMessage = "<p><pre>" . $errorMessage . "</pre></p>"; } ! ! //log error to file ! if ((isset($GLOBALS['DOMIT_DOMException_log'])) && ! ($GLOBALS['DOMIT_DOMException_log'] != null)) { ! require_once(DOMIT_INCLUDE_PATH . 'php_file_utilities.php'); ! $logItem = "\n" . date('Y-m-d H:i:s') . 'DOMIT! Error ' . $errorMessageText; ! php_file_utilities::putDataToFile($GLOBALS['DOMIT_DOMException_log'], ! $logItem, 'a'); ! } ! ! switch ($GLOBALS['DOMIT_DOMException_mode']) { ! case DOMIT_ONERROR_CONTINUE: ! return; ! break; ! ! case DOMIT_ONERROR_DIE: ! die($errorMessage); ! break; ! } } } //raiseException *************** *** 159,162 **** --- 190,215 ---- $GLOBALS['DOMIT_DOMException_errorHandler'] =& $method; } //setErrorHandler + + /** + * Set error mode + * @param int The DOM error mode + */ + function setErrorMode($mode) { + $GLOBALS['DOMIT_DOMException_mode'] = $mode; + } //setErrorMode + + /** + * Set error mode + * @param boolean True if errors should be logged + * @param string Absolute or relative path to log file + */ + function setErrorLog($doLogErrors, $logfile) { + if ($doLogErrors) { + $GLOBALS['DOMIT_DOMException_log'] = $logfile; + } + else { + $GLOBALS['DOMIT_DOMException_log'] = null; + } + } //setErrorLog } //DOMIT_DOMException *************** *** 186,190 **** */ function &createDocument($namespaceURI, $qualifiedName, &$docType) { ! $xmldoc =& new DOMIT_Document(); $documentElement =& $xmldoc->createElementNS($namespaceURI, $qualifiedName); --- 239,243 ---- */ function &createDocument($namespaceURI, $qualifiedName, &$docType) { ! $xmldoc = new DOMIT_Document(); $documentElement =& $xmldoc->createElementNS($namespaceURI, $qualifiedName); Index: xml_domit_parser.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/other/domit/xml_domit_parser.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** xml_domit_parser.php 25 Aug 2005 16:06:17 -0000 1.2 --- xml_domit_parser.php 27 Oct 2005 09:37:18 -0000 1.3 *************** *** 4,8 **** * @package domit-xmlparser * @subpackage domit-xmlparser-main ! * @version 1.0 * @copyright (C) 2004 John Heinstein. All rights reserved * @license http://www.gnu.org/copyleft/lesser.html LGPL License --- 4,8 ---- * @package domit-xmlparser * @subpackage domit-xmlparser-main ! * @version 1.01 * @copyright (C) 2004 John Heinstein. All rights reserved * @license http://www.gnu.org/copyleft/lesser.html LGPL License *************** *** 17,21 **** /** current version of DOMIT! */ ! define ('DOMIT_VERSION', '1.0'); /** XML namespace URI */ --- 17,21 ---- /** current version of DOMIT! */ ! define ('DOMIT_VERSION', '1.01'); /** XML namespace URI */ *************** *** 692,696 **** require_once(DOMIT_INCLUDE_PATH . 'xml_domit_nodemaps.php'); ! $nodelist =& new DOMIT_NodeList(); switch ($this->nodeType) { --- 692,696 ---- require_once(DOMIT_INCLUDE_PATH . 'xml_domit_nodemaps.php'); ! $nodelist = new DOMIT_NodeList(); switch ($this->nodeType) { *************** *** 713,717 **** } else { ! return null; } } --- 713,718 ---- } else { ! $null = null; ! return $null; } } *************** *** 763,767 **** require_once(DOMIT_INCLUDE_PATH . 'xml_domit_xpath.php'); ! $xpParser =& new DOMIT_XPath(); return $xpParser->parsePattern($this, $pattern, $nodeIndex); --- 764,768 ---- require_once(DOMIT_INCLUDE_PATH . 'xml_domit_xpath.php'); ! $xpParser = new DOMIT_XPath(); return $xpParser->parsePattern($this, $pattern, $nodeIndex); *************** *** 774,778 **** function &childNodesAsNodeList() { require_once('xml_domit_nodemaps.php'); ! $myNodeList =& new DOMIT_NodeList(); $total = $this->childCount; --- 775,779 ---- function &childNodesAsNodeList() { require_once('xml_domit_nodemaps.php'); ! $myNodeList = new DOMIT_NodeList(); $total = $this->childCount; *************** *** 841,845 **** $this->ownerDocument =& $this; $this->parser = ''; ! $this->implementation =& new DOMIT_DOMImplementation(); } //DOMIT_Document --- 842,846 ---- $this->ownerDocument =& $this; $this->parser = ''; ! $this->implementation = new DOMIT_DOMImplementation(); } //DOMIT_Document *************** *** 880,884 **** require_once(DOMIT_INCLUDE_PATH . 'php_http_client_generic.php'); ! $this->httpConnection =& new php_http_client_generic($host, $path, $port, $timeout, $user, $password); } //setConnection --- 881,885 ---- require_once(DOMIT_INCLUDE_PATH . 'php_http_client_generic.php'); ! $this->httpConnection = new php_http_client_generic($host, $path, $port, $timeout, $user, $password); } //setConnection *************** *** 904,908 **** require_once(DOMIT_INCLUDE_PATH . 'php_http_proxy.php'); ! $this->httpConnection =& new php_http_proxy($host, $path, $port, $timeout, $user, $password); } //setProxyConnection --- 905,909 ---- require_once(DOMIT_INCLUDE_PATH . 'php_http_proxy.php'); ! $this->httpConnection = new php_http_proxy($host, $path, $port, $timeout, $user, $password); } //setProxyConnection *************** *** 1285,1289 **** */ function &createDocumentFragment() { ! $node =& new DOMIT_DocumentFragment(); $node->ownerDocument =& $this; --- 1286,1290 ---- */ function &createDocumentFragment() { ! $node = new DOMIT_DocumentFragment(); $node->ownerDocument =& $this; *************** *** 1297,1301 **** */ function &createAttribute($name) { ! $node =& new DOMIT_Attr($name); return $node; --- 1298,1302 ---- */ function &createAttribute($name) { ! $node = new DOMIT_Attr($name); return $node; *************** *** 1309,1313 **** */ function &createAttributeNS($namespaceURI, $qualifiedName) { ! $node =& new DOMIT_Attr($qualifiedName); $node->namespaceURI = $namespaceURI; --- 1310,1314 ---- */ function &createAttributeNS($namespaceURI, $qualifiedName) { ! $node = new DOMIT_Attr($qualifiedName); $node->namespaceURI = $namespaceURI; *************** *** 1332,1336 **** */ function &createElement($tagName) { ! $node =& new DOMIT_Element($tagName); $node->ownerDocument =& $this; --- 1333,1337 ---- */ function &createElement($tagName) { ! $node = new DOMIT_Element($tagName); $node->ownerDocument =& $this; *************** *** 1345,1349 **** */ function &createElementNS($namespaceURI, $qualifiedName) { ! $node =& new DOMIT_Element($qualifiedName); $colonIndex = strpos($qualifiedName, ":"); --- 1346,1350 ---- */ function &createElementNS($namespaceURI, $qualifiedName) { ! $node = new DOMIT_Element($qualifiedName); $colonIndex = strpos($qualifiedName, ":"); *************** *** 1371,1375 **** */ function &createTextNode($data) { ! $node =& new DOMIT_TextNode($data); $node->ownerDocument =& $this; --- 1372,1376 ---- */ function &createTextNode($data) { ! $node = new DOMIT_TextNode($data); $node->ownerDocument =& $this; *************** *** 1383,1387 **** */ function &createCDATASection($data) { ! $node =& new DOMIT_CDATASection($data); $node->ownerDocument =& $this; --- 1384,1388 ---- */ function &createCDATASection($data) { ! $node = new DOMIT_CDATASection($data); $node->ownerDocument =& $this; *************** *** 1395,1399 **** */ function &createComment($text) { ! $node =& new DOMIT_Comment($text); $node->ownerDocument =& $this; --- 1396,1400 ---- */ function &createComment($text) { ! $node = new DOMIT_Comment($text); $node->ownerDocument =& $this; *************** *** 1408,1412 **** */ function &createProcessingInstruction($target, $data) { ! $node =& new DOMIT_ProcessingInstruction($target, $data); $node->ownerDocument =& $this; --- 1409,1413 ---- */ function &createProcessingInstruction($target, $data) { ! $node = new DOMIT_ProcessingInstruction($target, $data); $node->ownerDocument =& $this; *************** *** 1420,1424 **** */ function &getElementsByTagName($tagName) { ! $nodeList =& new DOMIT_NodeList(); if ($this->documentElement != null) { --- 1421,1425 ---- */ function &getElementsByTagName($tagName) { ! $nodeList = new DOMIT_NodeList(); if ($this->documentElement != null) { *************** *** 1436,1440 **** */ function &getElementsByTagNameNS($namespaceURI, $localName) { ! $nodeList =& new DOMIT_NodeList(); if ($this->documentElement != null) { --- 1437,1441 ---- */ function &getElementsByTagNameNS($namespaceURI, $localName) { ! $nodeList = new DOMIT_NodeList(); if ($this->documentElement != null) { *************** *** 1458,1462 **** } ! return null; } else { --- 1459,1464 ---- } ! $null = null; ! return $null; } else { *************** *** 1503,1507 **** */ function &getNodesByNodeType($type, &$contextNode) { ! $nodeList =& new DOMIT_NodeList(); if (($type == DOMIT_DOCUMENT_NODE) || ($contextNode->nodeType == DOMIT_DOCUMENT_NODE)){ --- 1505,1509 ---- */ function &getNodesByNodeType($type, &$contextNode) { ! $nodeList = new DOMIT_NodeList(); if (($type == DOMIT_DOCUMENT_NODE) || ($contextNode->nodeType == DOMIT_DOCUMENT_NODE)){ *************** *** 1531,1535 **** */ function &getNodesByNodeValue($value, &$contextNode) { ! $nodeList =& new DOMIT_NodeList(); if ($contextNode->uid == $this->uid) { --- 1533,1537 ---- */ function &getNodesByNodeValue($value, &$contextNode) { ! $nodeList = new DOMIT_NodeList(); if ($contextNode->uid == $this->uid) { *************** *** 1563,1567 **** if (DOMIT_Utilities::validateXML($xmlText)) { ! $domParser =& new DOMIT_Parser(); if ($useSAXY || (!function_exists('xml_parser_create'))) { --- 1565,1569 ---- if (DOMIT_Utilities::validateXML($xmlText)) { ! $domParser = new DOMIT_Parser(); if ($useSAXY || (!function_exists('xml_parser_create'))) { *************** *** 1782,1786 **** function &cloneNode($deep = false) { $className = get_class($this); ! $clone =& new $className($this->nodeName); if ($deep) { --- 1784,1788 ---- function &cloneNode($deep = false) { $className = get_class($this); ! $clone = new $className($this->nodeName); if ($deep) { *************** *** 2029,2033 **** */ function &getElementsByTagName($tagName) { ! $nodeList =& new DOMIT_NodeList(); $this->getNamedElements($nodeList, $tagName); --- 2031,2035 ---- */ function &getElementsByTagName($tagName) { ! $nodeList = new DOMIT_NodeList(); $this->getNamedElements($nodeList, $tagName); *************** *** 2042,2046 **** */ function &getElementsByTagNameNS($namespaceURI, $localName) { ! $nodeList =& new DOMIT_NodeList(); $this->getNamedElementsNS($nodeList, $namespaceURI, $localName); --- 2044,2048 ---- */ function &getElementsByTagNameNS($namespaceURI, $localName) { ! $nodeList = new DOMIT_NodeList(); $this->getNamedElementsNS($nodeList, $namespaceURI, $localName); *************** *** 2079,2083 **** } ! return null; } //_getElementByID --- 2081,2086 ---- } ! $null = null; ! return $null; } //_getElementByID *************** *** 2196,2200 **** if ($returnNode == null) { ! $newAttr =& new DOMIT_Attr($name); $newAttr->setValue($value); $this->attributes->setNamedItem($newAttr); --- 2199,2203 ---- if ($returnNode == null) { ! $newAttr = new DOMIT_Attr($name); $newAttr->setValue($value); $this->attributes->setNamedItem($newAttr); *************** *** 2226,2230 **** if ($returnNode == null) { //create this manually in case element has no ownerDocument to reference ! $newAttr =& new DOMIT_Attr($qualifiedName); $newAttr->prefix = substr($qualifiedName, 0, $colonIndex); $newAttr->localName = $localName; --- 2229,2233 ---- if ($returnNode == null) { //create this manually in case element has no ownerDocument to reference ! $newAttr = new DOMIT_Attr($qualifiedName); $newAttr->prefix = substr($qualifiedName, 0, $colonIndex); $newAttr->localName = $localName; *************** *** 2399,2403 **** function &cloneNode($deep = false) { $className = get_class($this); ! $clone =& new $className($this->nodeName); $clone->attributes =& $this->attributes->createClone($deep); --- 2402,2406 ---- function &cloneNode($deep = false) { $className = get_class($this); ! $clone = new $className($this->nodeName); $clone->attributes =& $this->attributes->createClone($deep); *************** *** 2675,2679 **** //create new text node $className = get_class($this); ! $newTextNode =& new $className($post); $newTextNode->ownerDocument =& $this->ownerDocument; --- 2678,2682 ---- //create new text node $className = get_class($this); ! $newTextNode = new $className($post); $newTextNode->ownerDocument =& $this->ownerDocument; *************** *** 2704,2708 **** function &cloneNode($deep = false) { $className = get_class($this); ! $clone =& new $className($this->nodeValue); return $clone; --- 2707,2711 ---- function &cloneNode($deep = false) { $className = get_class($this); ! $clone = new $className($this->nodeValue); return $clone; *************** *** 2843,2847 **** function &cloneNode($deep = false) { $className = get_class($this); ! $clone =& new $className($this->nodeName); $clone->nodeValue = $this->nodeValue; --- 2846,2850 ---- function &cloneNode($deep = false) { $className = get_class($this); ! $clone = new $className($this->nodeName); $clone->nodeValue = $this->nodeValue; *************** *** 2916,2920 **** function &cloneNode($deep = false) { $className = get_class($this); ! $clone =& new $className(); if ($deep) { --- 2919,2923 ---- function &cloneNode($deep = false) { $className = get_class($this); ! $clone = new $className(); if ($deep) { *************** *** 3004,3008 **** function &cloneNode($deep = false) { $className = get_class($this); ! $clone =& new $className($this->nodeValue); return $clone; --- 3007,3011 ---- function &cloneNode($deep = false) { $className = get_class($this); ! $clone = new $className($this->nodeValue); return $clone; *************** *** 3081,3085 **** function &cloneNode($deep = false) { $className = get_class($this); ! $clone =& new $className($this->nodeName, $this->nodeValue); return $clone; --- 3084,3088 ---- function &cloneNode($deep = false) { $className = get_class($this); ! $clone = new $className($this->nodeName, $this->nodeValue); return $clone; *************** *** 3171,3175 **** function &cloneNode($deep = false) { $className = get_class($this); ! $clone =& new $className($this->nodeName, $this->text); return $clone; --- 3174,3178 ---- function &cloneNode($deep = false) { $className = get_class($this); ! $clone = new $className($this->nodeName, $this->text); return $clone; *************** *** 3323,3327 **** //create instance of SAXY parser ! $parser =& new SAXY_Parser(); $parser->appendEntityTranslationTable($definedEntities); --- 3326,3330 ---- //create instance of SAXY parser ! $parser = new SAXY_Parser(); $parser->appendEntityTranslationTable($definedEntities); *************** *** 3585,3589 **** $name = substr($name, 0, $end); ! $currentNode =& new DOMIT_DocumentType($name, $data); $currentNode->ownerDocument =& $this->xmlDoc; --- 3588,3592 ---- $name = substr($name, 0, $end); ! $currentNode = new DOMIT_DocumentType($name, $data); $currentNode->ownerDocument =& $this->xmlDoc; Index: xml_domit_nodemaps.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/other/domit/xml_domit_nodemaps.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** xml_domit_nodemaps.php 25 Aug 2005 16:06:17 -0000 1.2 --- xml_domit_nodemaps.php 27 Oct 2005 09:37:18 -0000 1.3 *************** *** 33,37 **** return $this->arNodeList[$index]; } ! return null; } //item --- 33,39 ---- return $this->arNodeList[$index]; } ! ! $null = null; ! return $null; } //item *************** *** 110,114 **** function &createClone($deep = false) { $className = get_class($this); ! $clone =& new $className(); foreach ($this->arNodeList as $key => $value) { --- 112,116 ---- function &createClone($deep = false) { $className = get_class($this); ! $clone = new $className(); foreach ($this->arNodeList as $key => $value) { *************** *** 183,187 **** } ! return null; } //getNamedItem --- 185,190 ---- } ! $null = null; ! return $null; } //getNamedItem *************** *** 261,265 **** } ! return null; } //getNamedItemNS --- 264,269 ---- } ! $null = null; ! return $null; } //getNamedItemNS *************** *** 361,365 **** function &createClone($deep = false) { $className = get_class($this); ! $clone =& new $className(); foreach ($this->arNodeMap as $key => $value) { --- 365,369 ---- function &createClone($deep = false) { $className = get_class($this); ! $clone = new $className(); foreach ($this->arNodeMap as $key => $value) { Index: xml_saxy_lite_parser.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/other/domit/xml_saxy_lite_parser.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** xml_saxy_lite_parser.php 25 Aug 2005 16:06:17 -0000 1.2 --- xml_saxy_lite_parser.php 27 Oct 2005 09:37:18 -0000 1.3 *************** *** 4,8 **** * @package saxy-xmlparser * @subpackage saxy-xmlparser-lite ! * @version 0.17 * @copyright (C) 2004 John Heinstein. All rights reserved * @license http://www.gnu.org/copyleft/lesser.html LGPL License --- 4,8 ---- * @package saxy-xmlparser * @subpackage saxy-xmlparser-lite ! * @version 1.0 * @copyright (C) 2004 John Heinstein. All rights reserved * @license http://www.gnu.org/copyleft/lesser.html LGPL License *************** *** 17,21 **** /** current version of SAXY Lite */ ! define ('SAXY_LITE_VERSION', '0.17'); /** initial saxy lite parse state, before anything is encountered */ --- 17,21 ---- /** current version of SAXY Lite */ ! define ('SAXY_LITE_VERSION', '1.0'); /** initial saxy lite parse state, before anything is encountered */ Index: php_http_client_generic.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/other/domit/php_http_client_generic.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** php_http_client_generic.php 25 Aug 2005 16:06:17 -0000 1.2 --- php_http_client_generic.php 27 Oct 2005 09:37:18 -0000 1.3 *************** *** 4,8 **** * php_http_client_generic represents a basic http client * @package php-http-tools ! * @version 0.2-pre * @copyright (C) 2004 John Heinstein. All rights reserved * @license http://www.gnu.org/copyleft/lesser.html LGPL License --- 4,8 ---- * php_http_client_generic represents a basic http client * @package php-http-tools ! * @version 0.3 * @copyright (C) 2004 John Heinstein. All rights reserved * @license http://www.gnu.org/copyleft/lesser.html LGPL License *************** *** 154,161 **** */ function php_http_client_generic($host = '', $path = '/', $port = 80, $timeout = 0) { ! $this->connection =& new php_http_connection($host, $path, $port, $timeout); ! $this->headers =& new php_http_headers(); $this->requestPath = $path; ! $this->response =& new php_http_response(); $this->setHeaders(); } //php_http_client_generic --- 154,161 ---- */ function php_http_client_generic($host = '', $path = '/', $port = 80, $timeout = 0) { ! $this->connection = new php_http_connection($host, $path, $port, $timeout); ! $this->headers = new php_http_headers(); $this->requestPath = $path; ! $this->response = new php_http_response(); $this->setHeaders(); } //php_http_client_generic *************** *** 169,173 **** if ($responseHeadersAsObject) { ! $this->response->headers =& new php_http_headers(); } } //generateResponseHeadersAsObject --- 169,173 ---- if ($responseHeadersAsObject) { ! $this->response->headers = new php_http_headers(); } } //generateResponseHeadersAsObject Index: php_http_connector.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/other/domit/php_http_connector.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** php_http_connector.php 25 Aug 2005 16:06:17 -0000 1.2 --- php_http_connector.php 27 Oct 2005 09:37:18 -0000 1.3 *************** *** 4,8 **** * php_http_connector establishes http connections * @package php-http-tools ! * @version 0.1 * @copyright (C) 2004 John Heinstein. All rights reserved * @license http://www.gnu.org/copyleft/lesser.html LGPL License --- 4,8 ---- * php_http_connector establishes http connections * @package php-http-tools ! * @version 0.3 * @copyright (C) 2004 John Heinstein. All rights reserved * @license http://www.gnu.org/copyleft/lesser.html LGPL License *************** *** 38,42 **** require_once(PHP_HTTP_TOOLS_INCLUDE_PATH . 'php_http_client_generic.php'); ! $this->httpConnection =& new php_http_client_generic($host, $path, $port, $timeout, $user, $password); } //setConnection --- 38,42 ---- require_once(PHP_HTTP_TOOLS_INCLUDE_PATH . 'php_http_client_generic.php'); ! $this->httpConnection = new php_http_client_generic($host, $path, $port, $timeout, $user, $password); } //setConnection *************** *** 62,66 **** require_once(PHP_HTTP_TOOLS_INCLUDE_PATH . 'php_http_proxy.php'); ! $this->httpConnection =& new php_http_proxy($host, $path, $port, $timeout, $user, $password); } //setProxyConnection --- 62,66 ---- require_once(PHP_HTTP_TOOLS_INCLUDE_PATH . 'php_http_proxy.php'); ! $this->httpConnection = new php_http_proxy($host, $path, $port, $timeout, $user, $password); } //setProxyConnection Index: changelog.txt =================================================================== RCS file: /cvsroot/stack/stack-1-0/other/domit/changelog.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** changelog.txt 25 Aug 2005 16:06:17 -0000 1.2 --- changelog.txt 27 Oct 2005 09:37:18 -0000 1.3 *************** *** 193,196 **** - SAXY updated ! --- 193,200 ---- - SAXY updated ! Version 1.1 (2005/09/10) ! - removed ampersands when objects instantiated ! - added to error handling modes: DOMIT_ONERROR_DIE and DOMIT_ONERROR_CONTINUE ! - on errors, DOMIT no longer dies by default ! - added setErrorLog and setErrorMode methods Index: xml_domit_lite_parser.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/other/domit/xml_domit_lite_parser.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** xml_domit_lite_parser.php 25 Aug 2005 16:06:17 -0000 1.2 --- xml_domit_lite_parser.php 27 Oct 2005 09:37:18 -0000 1.3 *************** *** 4,8 **** * @package domit-xmlparser * @subpackage domit-xmlparser-lite ! * @version 0.2 * @copyright (C) 2004 John Heinstein. All rights reserved * @license http://www.gnu.org/copyleft/lesser.html LGPL License --- 4,8 ---- * @package domit-xmlparser * @subpackage domit-xmlparser-lite ! * @version 1.01 * @copyright (C) 2004 John Heinstein. All rights reserved * @license http://www.gnu.org/copyleft/lesser.html LGPL License *************** *** 17,21 **** /** current version of DOMIT! Lite */ ! define ('DOMIT_LITE_VERSION', '0.2'); /** --- 17,21 ---- /** current version of DOMIT! Lite */ ! define ('DOMIT_LITE_VERSION', '1.01'); /** *************** *** 548,552 **** require_once(DOMIT_INCLUDE_PATH . 'xml_domit_nodemaps.php'); ! $nodelist =& new DOMIT_NodeList(); switch ($this->nodeType) { --- 548,552 ---- require_once(DOMIT_INCLUDE_PATH . 'xml_domit_nodemaps.php'); ! $nodelist = new DOMIT_NodeList(); switch ($this->nodeType) { *************** *** 568,572 **** return $nodelist->item(0); } ! return null; } --- 568,574 ---- return $nodelist->item(0); } ! ! $null = null; ! return $null; } *************** *** 657,661 **** $this->ownerDocument =& $this; $this->parser = ''; ! $this->implementation =& new DOMIT_DOMImplementation(); } //DOMIT_Lite_Document --- 659,663 ---- $this->ownerDocument =& $this; $this->parser = ''; ! $this->implementation = new DOMIT_DOMImplementation(); } //DOMIT_Lite_Document *************** *** 680,684 **** require_once(DOMIT_INCLUDE_PATH . 'php_http_client_generic.php'); ! $this->httpConnection =& new php_http_client_generic($host, $path, $port, $timeout, $user, $password); } //setConnection --- 682,686 ---- require_once(DOMIT_INCLUDE_PATH . 'php_http_client_generic.php'); ! $this->httpConnection = new php_http_client_generic($host, $path, $port, $timeout, $user, $password); } //setConnection *************** *** 712,716 **** require_once(DOMIT_INCLUDE_PATH . 'php_http_proxy.php'); ! $this->httpConnection =& new php_http_proxy($host, $path, $port, $timeout, $user, $password); } //setProxyConnection --- 714,718 ---- require_once(DOMIT_INCLUDE_PATH . 'php_http_proxy.php'); ! $this->httpConnection = new php_http_proxy($host, $path, $port, $timeout, $user, $password); } //setProxyConnection *************** *** 898,902 **** */ function &createElement($tagName) { ! $node =& new DOMIT_Lite_Element($tagName); $node->ownerDocument =& $this; --- 900,904 ---- */ function &createElement($tagName) { ! $node = new DOMIT_Lite_Element($tagName); $node->ownerDocument =& $this; *************** *** 910,914 **** */ function &createTextNode($data) { ! $node =& new DOMIT_Lite_TextNode($data); $node->ownerDocument =& $this; --- 912,916 ---- */ function &createTextNode($data) { ! $node = new DOMIT_Lite_TextNode($data); $node->ownerDocument =& $this; *************** *** 922,926 **** */ function &createCDATASection($data) { ! $node =& new DOMIT_Lite_CDATASection($data); $node->ownerDocument =& $this; --- 924,928 ---- */ function &createCDATASection($data) { ! $node = new DOMIT_Lite_CDATASection($data); $node->ownerDocument =& $this; *************** *** 934,938 **** */ function &getElementsByTagName($tagName) { ! $nodeList =& new DOMIT_NodeList(); if ($this->documentElement != null) { --- 936,940 ---- */ function &getElementsByTagName($tagName) { ! $nodeList = new DOMIT_NodeList(); if ($this->documentElement != null) { *************** *** 987,991 **** if (DOMIT_Utilities::validateXML($xmlText)) { ! $domParser =& new DOMIT_Lite_Parser(); if ($useSAXY || (!function_exists('xml_parser_create'))) { --- 989,993 ---- if (DOMIT_Utilities::validateXML($xmlText)) { ! $domParser = new DOMIT_Lite_Parser(); if ($useSAXY || (!function_exists('xml_parser_create'))) { *************** *** 1091,1094 **** --- 1093,1100 ---- } + if ($this->xmlDeclaration) { + $stringRep = $this->xmlDeclaration . "\n" . $stringRep; + } + return $this->saveTextToFile($filename, utf8_encode($stringRep)); } //saveXML_utf8 *************** *** 1167,1170 **** --- 1173,1184 ---- /** + * Sets the xml declaration text + * @param string The xml declaration text + */ + function setXMLDeclaration($decl) { + $this->xmlDeclaration = $decl; + } //setXMLDeclaration + + /** * Returns a reference to the DOMIT_DOMImplementation object * @return Object A reference to the DOMIT_DOMImplementation object *************** *** 1233,1237 **** function &cloneNode($deep = false) { $className = get_class($this); ! $clone =& new $className($this->nodeName); if ($deep) { --- 1247,1251 ---- function &cloneNode($deep = false) { $className = get_class($this); ! $clone = new $className($this->nodeName); if ($deep) { *************** *** 1356,1360 **** */ function &getElementsByTagName($tagName) { ! $nodeList =& new DOMIT_NodeList(); $this->getNamedElements($nodeList, $tagName); --- 1370,1374 ---- */ function &getElementsByTagName($tagName) { ! $nodeList = new DOMIT_NodeList(); $this->getNamedElements($nodeList, $tagName); *************** *** 1468,1472 **** function &cloneNode($deep = false) { $className = get_class($this); ! $clone =& new $className($this->nodeName); $clone->attributes = $this->attributes; --- 1482,1486 ---- function &cloneNode($deep = false) { $className = get_class($this); ! $clone = new $className($this->nodeName); $clone->attributes = $this->attributes; *************** *** 1593,1597 **** function &cloneNode($deep = false) { $className = get_class($this); ! $clone =& new $className($this->nodeValue); return $clone; --- 1607,1611 ---- function &cloneNode($deep = false) { $className = get_class($this); ! $clone = new $className($this->nodeValue); return $clone; *************** *** 1694,1701 **** //create instance of expat parser (should be included in php distro) if (version_compare(phpversion(), '5.0', '<=')) { ! $parser =& xml_parser_create(''); } else { ! $parser =& xml_parser_create(); } --- 1708,1715 ---- //create instance of expat parser (should be included in php distro) if (version_compare(phpversion(), '5.0', '<=')) { ! $parser = xml_parser_create(''); } else { ! $parser = xml_parser_create(); } *************** *** 1744,1748 **** //create instance of SAXY parser ! $parser =& new SAXY_Lite_Parser(); $parser->appendEntityTranslationTable($definedEntities); --- 1758,1762 ---- //create instance of SAXY parser ! $parser = new SAXY_Lite_Parser(); $parser->appendEntityTranslationTable($definedEntities); Index: xml_domit_getelementsbypath.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/other/domit/xml_domit_getelementsbypath.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** xml_domit_getelementsbypath.php 25 Aug 2005 16:06:17 -0000 1.2 --- xml_domit_getelementsbypath.php 27 Oct 2005 09:37:18 -0000 1.3 *************** *** 46,50 **** function DOMIT_GetElementsByPath() { require_once(DOMIT_INCLUDE_PATH . 'xml_domit_nodemaps.php'); ! $this->nodeList =& new DOMIT_NodeList(); } //DOMIT_GetElementsByPath --- 46,50 ---- function DOMIT_GetElementsByPath() { require_once(DOMIT_INCLUDE_PATH . 'xml_domit_nodemaps.php'); ! $this->nodeList = new DOMIT_NodeList(); } //DOMIT_GetElementsByPath *************** *** 98,102 **** } else { ! return null; } } --- 98,103 ---- } else { ! $null = null; ! return $null; } } *************** *** 222,226 **** function DOMIT_GetElementsByAttributePath() { require_once(DOMIT_INCLUDE_PATH . 'xml_domit_nodemaps.php'); ! $this->nodeList =& new DOMIT_NodeList(); } //DOMIT_GetElementsByAttributePath --- 223,227 ---- function DOMIT_GetElementsByAttributePath() { require_once(DOMIT_INCLUDE_PATH . 'xml_domit_nodemaps.php'); ! $this->nodeList = new DOMIT_NodeList(); } //DOMIT_GetElementsByAttributePath Index: xml_domit_xpath.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/other/domit/xml_domit_xpath.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** xml_domit_xpath.php 25 Aug 2005 16:06:17 -0000 1.2 --- xml_domit_xpath.php 27 Oct 2005 09:37:18 -0000 1.3 *************** *** 72,76 **** function DOMIT_XPath() { require_once(DOMIT_INCLUDE_PATH . 'xml_domit_nodemaps.php'); ! $this->nodeList =& new DOMIT_NodeList(); } //DOMIT_XPath --- 72,76 ---- function DOMIT_XPath() { require_once(DOMIT_INCLUDE_PATH . 'xml_domit_nodemaps.php'); ! $this->nodeList = new DOMIT_NodeList(); } //DOMIT_XPath *************** *** 134,138 **** } else { ! return null; } } --- 134,139 ---- } else { ! $null = null; ! return $null; } } Index: xml_saxy_parser.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/other/domit/xml_saxy_parser.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** xml_saxy_parser.php 25 Aug 2005 16:06:17 -0000 1.2 --- xml_saxy_parser.php 27 Oct 2005 09:37:18 -0000 1.3 *************** *** 4,8 **** * @package saxy-xmlparser * @subpackage saxy-xmlparser-main ! * @version 0.87 * @copyright (C) 2004 John Heinstein. All rights reserved * @license http://www.gnu.org/copyleft/lesser.html LGPL License --- 4,8 ---- * @package saxy-xmlparser * @subpackage saxy-xmlparser-main ! * @version 1.0 * @copyright (C) 2004 John Heinstein. All rights reserved * @license http://www.gnu.org/copyleft/lesser.html LGPL License *************** *** 17,21 **** /** current version of SAXY */ ! define ('SAXY_VERSION', '0.87'); /** default XML namespace */ --- 17,21 ---- /** current version of SAXY */ ! define ('SAXY_VERSION', '1.0'); /** default XML namespace */ Index: php_http_exceptions.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/other/domit/php_http_exceptions.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** php_http_exceptions.php 25 Aug 2005 16:06:17 -0000 1.2 --- php_http_exceptions.php 27 Oct 2005 09:37:18 -0000 1.3 *************** *** 16,19 **** --- 16,38 ---- define('HTTP_TRANSPORT_ERR', 2); + //HTTPExceptions Error Modes + /** continue on error */ + define('HTTP_ONERROR_CONTINUE', 1); + /** die on error */ + define('HTTP_ONERROR_DIE', 2); + + /** + * @global object Reference to custom error handler for HTTP Exception class + */ + $GLOBALS['HTTP_Exception_errorHandler'] = null; + /** + * @global int Error mode; specifies whether to die on error or simply return + */ + $GLOBALS['HTTP_Exception_mode'] = HTTP_ONERROR_RETURN; + /** + * @global string Log file for errors + */ + $GLOBALS['HTTP_Exception_log'] = null; + /** * An HTTP Exceptions class (not yet implemented) *************** *** 24,29 **** class HTTPExceptions { function raiseException($errorNum, $errorString) { ! die('HTTP Exception: ' . $errorNum . "\n " . $errorString); } //raiseException } //HTTPExceptions --- 43,110 ---- class HTTPExceptions { function raiseException($errorNum, $errorString) { ! //die('HTTP Exception: ' . $errorNum . "\n " . $errorString); ! ! if ($GLOBALS['HTTP_Exception_errorHandler'] != null) { ! call_user_func($GLOBALS['HTTP_Exception_errorHandler'], $errorNum, $errorString); ! } ! else { ! $errorMessageText = $errorNum . ' ' . $errorString; ! $errorMessage = 'Error: ' . $errorMessageText; ! ! if ((!isset($GLOBALS['HTTP_ERROR_FORMATTING_HTML'])) || ! ($GLOBALS['HTTP_ERROR_FORMATTING_HTML'] == true)) { ! $errorMessage = "<p><pre>" . $errorMessage . "</pre></p>"; ! } ! ! //log error to file ! if ((isset($GLOBALS['HTTP_Exception_log'])) && ! ($GLOBALS['HTTP_Exception_log'] != null)) { ! require_once(PHP_HTTP_TOOLS_INCLUDE_PATH . 'php_file_utilities.php'); ! $logItem = "\n" . date('Y-m-d H:i:s') . ' HTTP Error ' . $errorMessageText; ! php_file_utilities::putDataToFile($GLOBALS['HTTP_Exception_log'], ! $logItem, 'a'); ! } ! ! switch ($GLOBALS['HTTP_Exception_mode']) { ! case HTTP_ONERROR_CONTINUE: ! return; ! break; ! ! case HTTP_ONERROR_DIE: ! die($errorMessage); ! break; ! } ! } } //raiseException + + /** + * custom handler for HTTP errors + * @param object A reference to the custom error handler + */ + function setErrorHandler($method) { + $GLOBALS['HTTP_Exception_errorHandler'] =& $method; + } //setErrorHandler + + /** + * Set error mode + * @param int The HTTP error mode + */ + function setErrorMode($mode) { + $GLOBALS['HTTP_Exception_mode'] = $mode; + } //setErrorMode + + /** + * Set error mode + * @param boolean True if errors should be logged + * @param string Absolute or relative path to log file + */ + function setErrorLog($doLogErrors, $logfile) { + if ($doLogErrors) { + $GLOBALS['HTTP_Exception_log'] = $logfile; + } + else { + $GLOBALS['HTTP_Exception_log'] = null; + } + } //setErrorLog } //HTTPExceptions |