Skip to content

Commit

Permalink
Add second stateless flag for XML toolkit. Check if call is being mad…
Browse files Browse the repository at this point in the history
…e from compatibility wrapper and use appropriate stateless flag.
  • Loading branch information
Scott-Cam committed Aug 8, 2015
1 parent 7fa29cb commit 8cec8ce
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 8 additions & 2 deletions ToolkitApi/ToolkitService.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ class ToolkitService
'sbmjobCommand' => '', // optional complete override of SBMJOB command when new toolkit job is submitted
'prestart' => false,
'stateless' => false, // overriden by value in toolkit.ini if it is present (system section)
'xmlstateless' => true, // add new stateless flag for XML toolkit
'performance' => false, // whether to enable performance collection (not fully implemented)
'idleTimeout' => '', // created for Compat. Wrapper (CW)
'cdata' => true, // whether to ask XMLSERVICE to wrap its output in CDATA to protect reserved XML characters
Expand Down Expand Up @@ -225,7 +226,7 @@ protected function __construct($databaseNameOrResource, $userOrI5NamingFlag = '0
}

// Optional params. Don't specify if not given in INI.
$this->getOptionalParams('system', array('stateless','v5r4', 'ccsidBefore', 'ccsidAfter', 'useHex', 'paseCcsid', 'trace', 'dataStructureIntegrity', 'arrayIntegrity'));
$this->getOptionalParams('system', array('xmlstateless','stateless','v5r4', 'ccsidBefore', 'ccsidAfter', 'useHex', 'paseCcsid', 'trace', 'dataStructureIntegrity', 'arrayIntegrity'));
$this->getOptionalParams('transport', array('httpTransportUrl', 'plugSize'));

// populate serviceParams with $transport, or get it from INI
Expand Down Expand Up @@ -1749,7 +1750,12 @@ public function getInternalKey()
*/
public function isStateless()
{
return $this->getOption('stateless');
if ($this->getIsCw()){
return $this->getOption('stateless');
}
else{
return $this->getOption('xmlstateless');
}
}

/**
Expand Down
4 changes: 4 additions & 0 deletions ToolkitApi/toolkit.ini
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,12 @@ dataStructureIntegrity = true
; For backward compatibility with pre-1.4.0, set to false.
arrayIntegrity = true

; CW stateless flag
; stateless mode is default for i5_connect (though automatically overridden if private conns are used)
stateless = false
; Non-CW Stateless flag - default to true
; This should be overridden if you require stateful connections
xmlstateless = true

[transport]
; transport type allows configuration of transport from this INI.
Expand Down

0 comments on commit 8cec8ce

Please sign in to comment.