|
1 | 1 | <?php |
2 | 2 | namespace ToolkitApi; |
3 | 3 |
|
4 | | -use ToolkitApi\DateTimeApi; |
5 | | - |
6 | 4 | /** |
7 | 5 | * Class XMLWrapper |
8 | 6 | * |
@@ -36,7 +34,7 @@ class XMLWrapper |
36 | 34 | * @param string $options |
37 | 35 | * @param ToolkitService $ToolkitSrvObj |
38 | 36 | */ |
39 | | - function __construct($options ='', ToolkitService $ToolkitSrvObj = null) |
| 37 | + public function __construct($options ='', ToolkitService $ToolkitSrvObj = null) |
40 | 38 | { |
41 | 39 | if (is_string($options)) { |
42 | 40 | // $options is a string so it must be encoding (assumption for backwards compatibility) |
@@ -244,7 +242,7 @@ protected function xmlToObj($xml) |
244 | 242 | { |
245 | 243 | $xmlobj = simplexml_load_string($xml); |
246 | 244 |
|
247 | | - if (!$xmlobj instanceof SimpleXMLElement) { |
| 245 | + if (!$xmlobj instanceof \SimpleXMLElement) { |
248 | 246 | $badXmlLog = '/tmp/bad.xml'; |
249 | 247 | $this->error = "Unable to parse output XML, which has been logged in $badXmlLog. Possible problems: CCSID, encoding, binary data in an alpha field (use binary/BYTE type instead); if < or > are the problem, consider using CDATA tags."; |
250 | 248 | error_log($xml, 3, $badXmlLog); |
@@ -442,6 +440,7 @@ public function buildXmlIn($inputOutputParams = NULL, array $returnParams = NULL |
442 | 440 | protected function buildParamXml(ProgramParameter $paramElement) |
443 | 441 | { |
444 | 442 | $paramXml = ''; |
| 443 | + $specialOuterDsName = ''; |
445 | 444 |
|
446 | 445 | // build start ds tag |
447 | 446 | $props = $paramElement->getParamProperties(); |
@@ -630,7 +629,6 @@ protected function getSingleParamFromXml(\SimpleXMLElement $simpleXmlElement) |
630 | 629 |
|
631 | 630 | // is this a parm, or perhaps a DS?? |
632 | 631 | $elementType = $simpleXmlElement->getName(); // "name" of the XML tag is element type |
633 | | - $elementAttrs = $simpleXmlElement->attributes(); |
634 | 632 |
|
635 | 633 | // if this is the outer (parm or return) element, go down one level to either ds or data. |
636 | 634 | if ($elementType == 'parm' || $elementType == 'return') { |
@@ -810,7 +808,7 @@ public function getParamsFromXml($xml) |
810 | 808 | // or <report> (if unsuccessful) |
811 | 809 | // Outer node is discarded in parsed XML objects. |
812 | 810 |
|
813 | | - if (!$xmlobj instanceof SimpleXMLElement) { |
| 811 | + if (!$xmlobj instanceof \SimpleXMLElement) { |
814 | 812 | $badXmlLog = '/tmp/bad.xml'; |
815 | 813 | $this->error = "Unable to parse output XML, which has been logged in $badXmlLog. Possible problems: CCSID, encoding, binary data in an alpha field (use binary/BYTE type instead); if < or > are the problem, consider using CDATA tags."; |
816 | 814 | error_log($xml, 3, $badXmlLog); |
@@ -947,7 +945,7 @@ public function getCmdResultFromXml($xml, $parentTag = 'sh') { |
947 | 945 | $this->error = ''; |
948 | 946 |
|
949 | 947 | $xmlobj = simplexml_load_string($xml); |
950 | | - if (!$xmlobj instanceof SimpleXMLElement) { |
| 948 | + if (!$xmlobj instanceof \SimpleXMLElement) { |
951 | 949 | /*bad xml returned*/ |
952 | 950 | $this->error = "Can't read output xml"; |
953 | 951 | error_log($xml, 3, '/tmp/bad.xml'); |
@@ -1058,7 +1056,7 @@ public function getRowsFromXml($xml, $parent = 'sh') |
1058 | 1056 | $values = array(); |
1059 | 1057 |
|
1060 | 1058 | $xmlobj = @simplexml_load_string($xml); |
1061 | | - if (!$xmlobj instanceof SimpleXMLElement) { |
| 1059 | + if (!$xmlobj instanceof \SimpleXMLElement) { |
1062 | 1060 | /* bad xml returned*/ |
1063 | 1061 | $this->error = "Can't read output xml"; |
1064 | 1062 | return false; |
|
0 commit comments