diff options
author | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2013-03-27 16:23:58 (GMT) |
---|---|---|
committer | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2013-03-27 16:23:58 (GMT) |
commit | f11664454a92cd6df193f665fa8d7f2f81d2e06d (patch) | |
tree | fcc04bc9f43daac54a95e9dc8942262b995689f9 /src/bindings | |
parent | c0e29f9d4574be340d23c88605bf8868b166f718 (diff) | |
download | uscxml-f11664454a92cd6df193f665fa8d7f2f81d2e06d.zip uscxml-f11664454a92cd6df193f665fa8d7f2f81d2e06d.tar.gz uscxml-f11664454a92cd6df193f665fa8d7f2f81d2e06d.tar.bz2 |
Some final touches on PHP API
Diffstat (limited to 'src/bindings')
-rw-r--r-- | src/bindings/swig/php/test.php | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/src/bindings/swig/php/test.php b/src/bindings/swig/php/test.php index 6896ab0..d87856f 100644 --- a/src/bindings/swig/php/test.php +++ b/src/bindings/swig/php/test.php @@ -41,16 +41,17 @@ class MyMonitor extends InterpreterMonitor { $monitor = new MyMonitor(); -// $interpreter = Interpreter::fromURI('https://raw.github.com/tklab-tud/uscxml/master/test/samples/uscxml/test-ecmascript.scxml'); -// $interpreter->addMonitor($monitor); -// $interpreter->interpret(); +// run interpreter in blocking mode +$interpreter = Interpreter::fromURI('https://raw.github.com/tklab-tud/uscxml/master/test/samples/uscxml/test-ecmascript.scxml'); +$interpreter->addMonitor($monitor); +$interpreter->interpret(); -$interpreter = Interpreter::fromURI('/Users/sradomski/Documents/TK/Code/uscxml/test/samples/uscxml/test-invoked.scxml'); +// start interpreter as a thread +$interpreter = Interpreter::fromURI('https://raw.github.com/tklab-tud/uscxml/master/test/samples/uscxml/test-invoked.scxml'); $parentQueue = new ParentQueue(); $interpreter->setParentQueue($parentQueue); -//$interpreter->start(); -$interpreter->interpret(); -exit(); +$interpreter->start(); + while($interpreter->isRunning()) { $event = $parentQueue->pop(); print("Name: " . $event->getName() . "\n"); @@ -59,12 +60,21 @@ while($interpreter->isRunning()) { print("Namelist: \n"); $namelist = $event->getNameList(); print("\tSize: ". $namelist->size() ."\n"); - $keys = $event->getNameListKeys(); - for ($i = 0; $i < $keys->size(); $i++) { print("\t" . $namelist->get($keys->get($i)) . "\n"); } + + print("Params: \n"); + $params = $event->getParams(); + print("\tSize: ". $params->size() ."\n"); + $keys = $event->getParamKeys(); + for ($i = 0; $i < $keys->size(); $i++) { + $paramList = $params->get($keys->get($i)); + for ($j = 0; $j < $paramList->size(); $j++) { + print("\t" . $paramList->get($i) . "\n"); + } + } } |