diff options
author | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2013-03-30 17:31:50 (GMT) |
---|---|---|
committer | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2013-03-30 17:31:50 (GMT) |
commit | 5cdc1f8ec070fc3b8d03bde36a1854e7291790a2 (patch) | |
tree | a13531d9ce29693e5c3b4c8f6396dfac4bbf4290 /src/bindings/swig | |
parent | c8f8923484cbc99eff1e3c0b703568b243f3728b (diff) | |
download | uscxml-5cdc1f8ec070fc3b8d03bde36a1854e7291790a2.zip uscxml-5cdc1f8ec070fc3b8d03bde36a1854e7291790a2.tar.gz uscxml-5cdc1f8ec070fc3b8d03bde36a1854e7291790a2.tar.bz2 |
Interpreter cannot be abstract for PHP wrappers to work
Diffstat (limited to 'src/bindings/swig')
-rw-r--r-- | src/bindings/swig/php/uscxmlNativePHP.php | 58 |
1 files changed, 33 insertions, 25 deletions
diff --git a/src/bindings/swig/php/uscxmlNativePHP.php b/src/bindings/swig/php/uscxmlNativePHP.php index 85cef6c..7a1b9f8 100644 --- a/src/bindings/swig/php/uscxmlNativePHP.php +++ b/src/bindings/swig/php/uscxmlNativePHP.php @@ -210,6 +210,14 @@ class Event { Event_setDOM($this->_cPtr,$dom); } + function getContent() { + return Event_getContent($this->_cPtr); + } + + function setContent($content) { + Event_setContent($this->_cPtr,$content); + } + function getSendId() { return Event_getSendId($this->_cPtr); } @@ -310,14 +318,6 @@ class InvokeRequest extends Event { InvokeRequest_setSource($this->_cPtr,$src); } - function getContent() { - return InvokeRequest_getContent($this->_cPtr); - } - - function setContent($content) { - InvokeRequest_setContent($this->_cPtr,$content); - } - function isAutoForwarded() { return InvokeRequest_isAutoForwarded($this->_cPtr); } @@ -444,14 +444,6 @@ class SendRequest extends Event { SendRequest_setDelayMs($this->_cPtr,$delayMs); } - function getContent() { - return SendRequest_getContent($this->_cPtr); - } - - function setContent($content) { - SendRequest_setContent($this->_cPtr,$content); - } - function getNameList() { $r=SendRequest_getNameList($this->_cPtr); if (is_resource($r)) { @@ -580,7 +572,7 @@ class InterpreterMonitor { } } -abstract class Interpreter { +class Interpreter { public $_cPtr=null; protected $_pData=array(); @@ -614,26 +606,42 @@ abstract class Interpreter { static function fromDOM($node) { $r=Interpreter_fromDOM($node); - $this->_cPtr = $r; - return $this; + if (is_resource($r)) { + $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); + if (class_exists($c)) return new $c($r); + return new Interpreter($r); + } + return $r; } static function fromXML($xml) { $r=Interpreter_fromXML($xml); - $this->_cPtr = $r; - return $this; + if (is_resource($r)) { + $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); + if (class_exists($c)) return new $c($r); + return new Interpreter($r); + } + return $r; } static function fromURI($uri) { $r=Interpreter_fromURI($uri); - $this->_cPtr = $r; - return $this; + if (is_resource($r)) { + $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); + if (class_exists($c)) return new $c($r); + return new Interpreter($r); + } + return $r; } static function fromInputSource($source) { $r=Interpreter_fromInputSource($source); - $this->_cPtr = $r; - return $this; + if (is_resource($r)) { + $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); + if (class_exists($c)) return new $c($r); + return new Interpreter($r); + } + return $r; } function start() { |