Merge lp:~zorba-coders/zorba/bug918592 into lp:zorba

Proposed by William Candillon
Status: Merged
Approved by: Chris Hillery
Approved revision: 10623
Merged at revision: 10643
Proposed branch: lp:~zorba-coders/zorba/bug918592
Merge into: lp:zorba
Diff against target: 1502 lines (+1220/-246)
4 files modified
doc/php/examples/CMakeLists.txt (+0/-2)
swig/php/CMakeLists.txt (+5/-32)
swig/php/generate_proxy.php.in (+0/-212)
swig/php/zorba_api_wrapper.php (+1215/-0)
To merge this branch: bzr merge lp:~zorba-coders/zorba/bug918592
Reviewer Review Type Date Requested Status
Chris Hillery Approve
Rodolfo Ochoa Approve
Review via email: mp+89398@code.launchpad.net

Commit message

Fix for bug #918592

Description of the change

This patch is removing the generation of the PHP wrapper API.
It fixes bug #918592 and enable developers to download the wrapper API without building zorba.

To post a comment you must log in.
Revision history for this message
Rodolfo Ochoa (rodolfo-ochoa) :
review: Approve
Revision history for this message
Chris Hillery (ceejatec) wrote :

I'm afraid I don't know much about php or swig, but could you briefly explain what this change does? How was the old generation supposed to work, and why didn't it?

Revision history for this message
William Candillon (wcandillon) wrote :

SWIG is generating a proxy file to use the extension it generates.
However, depending on the version of swig your using this proxy is broken.
As it turns out, all other projects depending on swig are experiencing the same issue:
http://grokbase.com/p/lists.xapian.org/xapian-discuss/2011/06/xapian-discuss-revision-15699-tg-index-text-text-weight-fails-with-no-matching-function-for-overloaded-termgenerator-index-text/21wgj7ioezj74qycl3vcjsojomvi

http://jira.freeswitch.org/browse/ESL-20

Since we agreed on a stable API for PHP (which was the merge that caused php2 to fail), I decided to remove this proxy generation process.
Does it make sense?

Revision history for this message
Chris Hillery (ceejatec) wrote :

I see. Pretty ugly, and I'm worried that this means we'll need to update the PHP API manually if we change the SWIG API... but I'll bow to yours and Rodolfo's expertise that this is the best solution for now.

review: Approve
Revision history for this message
William Candillon (wcandillon) wrote :

The issue you mentioned is orthogonal to this merge proposal.
There is a stable PHP API which implementation needs to be updated if the SWIG API change.
It's the same for XQJ I assume?

But again, this is not related to the merge proposal.

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue job bug918592-2012-02-02T15-13-56.111Z is finished. The final status was:

All tests succeeded!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'doc/php/examples/CMakeLists.txt'
--- doc/php/examples/CMakeLists.txt 2012-01-19 09:35:40 +0000
+++ doc/php/examples/CMakeLists.txt 2012-01-20 08:46:25 +0000
@@ -32,8 +32,6 @@
32 MESSAGE(STATUS "Installing: " ${CMAKE_CURRENT_BINARY_DIR}/simple.php)32 MESSAGE(STATUS "Installing: " ${CMAKE_CURRENT_BINARY_DIR}/simple.php)
33 ADD_TEST("php2" ${PHP5_EXECUTABLE} -c ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/test.php)33 ADD_TEST("php2" ${PHP5_EXECUTABLE} -c ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/test.php)
3434
35 EXPECTED_FAILURE(php2 918592)
36
37 MESSAGE(STATUS "Installing: " ${CMAKE_CURRENT_BINARY_DIR}/test.php)35 MESSAGE(STATUS "Installing: " ${CMAKE_CURRENT_BINARY_DIR}/test.php)
38 36
39 37
4038
=== modified file 'swig/php/CMakeLists.txt'
--- swig/php/CMakeLists.txt 2012-01-11 08:15:08 +0000
+++ swig/php/CMakeLists.txt 2012-01-20 08:46:25 +0000
@@ -39,7 +39,11 @@
39 ENDIF (WIN32)39 ENDIF (WIN32)
4040
41 #Copy test to the build folder41 #Copy test to the build folder
42 CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/test.xq" "${CMAKE_CURRENT_BINARY_DIR}/test.xq")42 CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/test.xq" "${CMAKE_CURRENT_BINARY_DIR}/test.xq" COPYONLY)
43
44 #Copy
45 CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/XQueryProcessor.php" "${CMAKE_CURRENT_BINARY_DIR}/Zorba/XQueryProcessor.php" COPYONLY)
46 CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/zorba_api_wrapper.php" "${CMAKE_CURRENT_BINARY_DIR}/Zorba/zorba_api_wrapper.php" COPYONLY)
4347
44 CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/../StaticContext.h" "${CMAKE_CURRENT_BINARY_DIR}/StaticContext.h")48 CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/../StaticContext.h" "${CMAKE_CURRENT_BINARY_DIR}/StaticContext.h")
45 CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/../ItemFactory.h" "${CMAKE_CURRENT_BINARY_DIR}/ItemFactory.h")49 CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/../ItemFactory.h" "${CMAKE_CURRENT_BINARY_DIR}/ItemFactory.h")
@@ -80,35 +84,4 @@
80 DESTINATION share/php )84 DESTINATION share/php )
81 ENDIF (MSVC_IDE)85 ENDIF (MSVC_IDE)
82 ENDIF (NOT WIN32 OR CYGWIN)86 ENDIF (NOT WIN32 OR CYGWIN)
83
84 ### Start PHP proxy generation
85 # Configure the test file
86 SET (phpLibPrefix ${ZORBA_SWIG_LIB_PREFIX})
87 SET (phpAPIPath ${CMAKE_CURRENT_BINARY_DIR})
88 SET (phpLibPrefix ${ZORBA_SWIG_LIB_PREFIX})
89 CONFIGURE_FILE (
90 ${CMAKE_CURRENT_SOURCE_DIR}/generate_proxy.php.in
91 ${CMAKE_CURRENT_BINARY_DIR}/generate_proxy.php
92 )
93
94 CONFIGURE_FILE (
95 ${CMAKE_CURRENT_SOURCE_DIR}/XQueryProcessor.php
96 ${CMAKE_CURRENT_BINARY_DIR}/Zorba/XQueryProcessor.php
97 )
98
99 ADD_CUSTOM_COMMAND (
100 OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Zorba/zorba_api_wrapper.php
101 # the following addes a dependency to the *.cxx file that is generated by swig
102 DEPENDS ${swig_generated_file_fullname}
103 DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/generate_proxy.php.in
104 COMMAND ${PHP5_EXECUTABLE}
105 ARGS generate_proxy.php
106 )
107 ADD_CUSTOM_TARGET (
108 Api_PHP_Wrapper ALL
109 DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/Zorba/zorba_api_wrapper.php
110 DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/Zorba/XQueryProcessor.php
111 )
112 ### End PHP proxy generation
113
114ENDIF (NOT PHP5_FOUND)87ENDIF (NOT PHP5_FOUND)
11588
=== removed file 'swig/php/generate_proxy.php.in'
--- swig/php/generate_proxy.php.in 2012-01-18 08:39:16 +0000
+++ swig/php/generate_proxy.php.in 1970-01-01 00:00:00 +0000
@@ -1,212 +0,0 @@
1<?php
2$libPrefix = '@phpLibPrefix@';
3$file = file_get_contents('@phpAPIPath@/zorba_api.php');
4$file = str_replace('class Iterator {', 'class IteratorImpl {', $file);
5$file = str_replace('extends Iterator {', 'extends IteratorImpl {', $file);
6$file = str_replace('new Iterator(', 'new IteratorImpl(', $file);
7$file = str_replace('!dl(', '!noop(', $file);
8file_put_contents('@phpAPIPath@/zorba_api.php', $file);
9$tokens = token_get_all($file);
10
11require_once '@phpAPIPath@/zorba_api.php';
12
13$wrapper = <<<PHP
14<?php
15//Try to load the extension if it's not already loaded.
16if(!extension_loaded('zorba_api') && function_exists('dl')) {
17 if(strtolower(substr(PHP_OS, 0, 3)) === 'win') {
18 if(!dl('php_zorba_api.dll')) return;
19 } else {
20 if(PHP_SHLIB_SUFFIX === 'PHP_SHLIB_SUFFIX' || PHP_SHLIB_SUFFIX === 'dylib') {
21 if(!dl('$libPrefix'.'zorba_api.so')) return;
22 } else {
23 if(!dl('$libPrefix'.'zorba_api.' . PHP_SHLIB_SUFFIX)) return;
24 }
25 }
26} else if(!extension_loaded('zorba_api')) {
27 throw new Exception('Zorba extension is not loaded');
28}
29PHP;
30
31$classes = get_declared_classes();
32
33function noop($string){ return true; }
34
35class ReturnType {
36
37 private $class;
38 private $method;
39 private $type;
40
41 public function __construct($class, $method, $type) {
42 $this->class = $class;
43 $this->method = $method;
44 $this->type = $type;
45 }
46
47 public function getClass() { return $this->class; }
48 public function getMethod(){ return $this->method; }
49 public function getType(){ return $this->type; }
50}
51
52class Indexer {
53
54 private $returnTypes = array();
55
56 const CLAZZ = 1;
57 const METHOD = 2;
58 const TYPE = 3;
59
60 public function __construct(array $tokens) {
61 $state = null;
62 $class = null;
63 $method = null;
64 foreach($tokens as $token) {
65 if(is_string($token)) continue;
66 list($name, $value) = array(token_name($token[0]), $token[1]);
67 if($name == 'T_CLASS') {
68 $state = self::CLAZZ;
69 } else if($name == 'T_FUNCTION'){// && $class != null) {
70 $state = self::METHOD;
71 } else if($name == 'T_NEW'){// && $class != null && $method != null) {
72 $state = self::TYPE;
73 }
74 if($name == "T_STRING") {
75 switch($state) {
76 case self::CLAZZ:
77 $class = $value;
78 break;
79 case self::METHOD:
80 $method = $value;
81 break;
82 case self::TYPE:
83 $this->returnTypes[] = new ReturnType($class, $method, $value);
84 }
85 $state = null;
86 }
87 }
88 }
89
90 public function getType($class, $method) {
91 foreach($this->returnTypes as $r) {
92 if($r->getClass() == $class && $r->getMethod() == $method) {
93 return $r->getType();
94 }
95 }
96 return null;
97 }
98}
99
100$indexer = new Indexer($tokens);
101
102foreach($classes as $className) {
103 $class = new ReflectionClass($className);
104 if($class->isUserDefined() && $class->getName() != "Indexer" && $class->getName() != "ReturnType") {
105 $wrapper .= "\nclass $className";
106 $parent = $class->getParentClass();
107 if($parent != null) {
108 $wrapper .= " extends ".$parent->getName();
109 }
110 $wrapper .= "{\n";
111 $contants = $class->getConstants();
112 foreach($contants as $constant => $value) {
113 $value = is_string($value)?"\"$value\"":$value;
114 $wrapper .= " const $constant = $value;\n";
115 }
116 $methods = $class->getMethods();
117 if(count($methods)) {
118 $wrapper .= " public \$_cPtr=null;\n\n";
119 }
120 foreach($methods as $method){
121 if(isInHerited($class, $method)) continue;
122 if($method->isConstructor()) {
123 $wrapper .= <<<PHP
124 public function __construct(\$ptr) {
125 \$this->_cPtr = \$ptr;
126 }\n\n
127PHP;
128 } else {
129 $name = $method->getName();
130 $params = $method->getParameters();
131 if($method->isStatic()) {
132 $wrapper .= " static";
133 }
134 $wrapper .= " public function $name(".getParameters($params).") {\n";
135 $funcName = $className=='IteratorImpl'?'Iterator':$className;
136 if(hasOverloading($params)) {
137 $wrapper .= " switch(func_num_args()) {\n";
138 $i = 1;
139 foreach($params as $key=>$param) {
140 if($param->isOptional()) {
141 $i++;
142 if($i==2) {
143 $first = false;
144 $wrapper .= " case 1: \$r = {$className}_$name(".getRefParameters($method, array_slice($params, 0, $key)).");break;\n";
145 }
146 $wrapper .= " case $i: \$r = {$className}_$name(".getRefParameters($method, array_slice($params, 0, $key+1)).");break;\n";
147
148 }
149 }
150 $wrapper .= " default: \$r = {$className}_$name(".getRefParameters($method, $params).");\n";
151 $wrapper .= " }\n";
152 } else {
153 $wrapper .= " \$r = {$funcName}_$name(".getRefParameters($method, $params).");\n";
154 }
155 $returnType = $indexer->getType($className, $method->getName());
156 if($returnType) {
157 $wrapper .= " return is_resource(\$r) ? new ".$returnType."(\$r) : \$r;\n";
158 } else {
159 $wrapper .= " return \$r;\n";
160 }
161 $wrapper .= "\n }\n\n";
162 }
163 }
164 $wrapper .= "}\n";
165 $methods = $class->getConstants();
166 }
167}
168
169file_put_contents('Zorba/zorba_api_wrapper.php', $wrapper);
170
171function getRefParameters(ReflectionMethod $method, array $params) {
172 $result = "";
173 if(!$method->isStatic()) {
174 $result .= "\$this->_cPtr";
175 if(count($params)) $result .= ", ";
176 }
177 foreach($params as $key=>$param) {
178 if($key!=0) $result .= ', ';
179 $result .= '$'.$param->getName();
180 }
181 return $result;
182}
183
184function getParameters(array $params) {
185 $result = "";
186 foreach($params as $key=>$param) {
187 if($key!=0) $result .= ', ';
188 $result .= '$'.$param->getName();
189 if($param->isOptional()) {
190 $result .= '=null';
191 }
192 }
193 return $result;
194}
195
196function hasOverloading(array $params) {
197 foreach($params as $param) {
198 if($param->isOptional()) {
199 return true;
200 }
201 }
202 return false;
203}
204
205function isInHerited(ReflectionClass $class, ReflectionMethod $method) {
206 $parent = $class->getParentClass();
207 if($parent) {
208 if($parent->hasMethod($method->getName())) { return true; }
209 }
210 return false;
211}
212?>
2130
=== added file 'swig/php/zorba_api_wrapper.php'
--- swig/php/zorba_api_wrapper.php 1970-01-01 00:00:00 +0000
+++ swig/php/zorba_api_wrapper.php 2012-01-20 08:46:25 +0000
@@ -0,0 +1,1215 @@
1<?php
2//Try to load the extension if it's not already loaded.
3if(!extension_loaded('zorba_api')) {
4 $zorbaExtNotLoaded = "Zorba extension couldn't loaded";
5 if(function_exists('dl')) {
6 if(strtolower(substr(PHP_OS, 0, 3)) === 'win') {
7 if(!dl('php_zorba_api.dll')) {
8 throw new Exception($zorbaExtNotLoaded);
9 }
10 } else {
11 $suffix = "so";
12 if(PHP_SHLIB_SUFFIX === 'PHP_SHLIB_SUFFIX' || PHP_SHLIB_SUFFIX === 'dylib') {
13 $suffix = PHP_SHLIB_SUFFIX;
14 }
15 if(!dl('zorba_api.'.$suffix)) {
16 if(!dl('libzorba_api.'.$suffix)) {
17 throw new Exception($zorbaExtNotLoaded);
18 }
19 }
20 }
21 } else {
22 throw new Exception($zorbaExtNotLoaded);
23 }
24}
25
26class DynamicContext{
27 public $_cPtr=null;
28
29 public function __set($var, $value) {
30 $r = DynamicContext___set($this->_cPtr, $var, $value);
31 return $r;
32
33 }
34
35 public function __isset($var) {
36 $r = DynamicContext___isset($this->_cPtr, $var);
37 return $r;
38
39 }
40
41 public function __get($var) {
42 $r = DynamicContext___get($this->_cPtr, $var);
43 return $r;
44
45 }
46
47 public function setVariable($aNamespace, $aLocalname, $arg3) {
48 $r = DynamicContext_setVariable($this->_cPtr, $aNamespace, $aLocalname, $arg3);
49 return $r;
50
51 }
52
53 public function setContextItem($arg1) {
54 $r = DynamicContext_setContextItem($this->_cPtr, $arg1);
55 return $r;
56
57 }
58
59 public function __construct($ptr) {
60 $this->_cPtr = $ptr;
61 }
62
63}
64
65class Item{
66 public $_cPtr=null;
67
68 public function __set($var, $value) {
69 $r = Item___set($this->_cPtr, $var, $value);
70 return $r;
71
72 }
73
74 public function __isset($var) {
75 $r = Item___isset($this->_cPtr, $var);
76 return $r;
77
78 }
79
80 public function __get($var) {
81 $r = Item___get($this->_cPtr, $var);
82 return $r;
83
84 }
85
86 static public function createEmptyItem() {
87 $r = Item_createEmptyItem();
88 return is_resource($r) ? new Item($r) : $r;
89
90 }
91
92 public function getStringValue() {
93 $r = Item_getStringValue($this->_cPtr);
94 return $r;
95
96 }
97
98 public function serialize() {
99 $r = Item_serialize($this->_cPtr);
100 return $r;
101
102 }
103
104 public function getAtomizationValue() {
105 $r = Item_getAtomizationValue($this->_cPtr);
106 return is_resource($r) ? new IteratorImpl($r) : $r;
107
108 }
109
110 public function getAttributes() {
111 $r = Item_getAttributes($this->_cPtr);
112 return is_resource($r) ? new IteratorImpl($r) : $r;
113
114 }
115
116 public function getBooleanValue() {
117 $r = Item_getBooleanValue($this->_cPtr);
118 return $r;
119
120 }
121
122 public function getChildren() {
123 $r = Item_getChildren($this->_cPtr);
124 return is_resource($r) ? new IteratorImpl($r) : $r;
125
126 }
127
128 public function getEBV() {
129 $r = Item_getEBV($this->_cPtr);
130 return is_resource($r) ? new Item($r) : $r;
131
132 }
133
134 public function getIntValue() {
135 $r = Item_getIntValue($this->_cPtr);
136 return $r;
137
138 }
139
140 public function getLocalName() {
141 $r = Item_getLocalName($this->_cPtr);
142 return $r;
143
144 }
145
146 public function getNamespace() {
147 $r = Item_getNamespace($this->_cPtr);
148 return $r;
149
150 }
151
152 public function getNodeName($aNodeName) {
153 $r = Item_getNodeName($this->_cPtr, $aNodeName);
154 return $r;
155
156 }
157
158 public function getPrefix() {
159 $r = Item_getPrefix($this->_cPtr);
160 return $r;
161
162 }
163
164 public function getType() {
165 $r = Item_getType($this->_cPtr);
166 return is_resource($r) ? new Item($r) : $r;
167
168 }
169
170 public function getUnsignedIntValue() {
171 $r = Item_getUnsignedIntValue($this->_cPtr);
172 return $r;
173
174 }
175
176 public function getNodeKind() {
177 $r = Item_getNodeKind($this->_cPtr);
178 return $r;
179
180 }
181
182 public function isAtomic() {
183 $r = Item_isAtomic($this->_cPtr);
184 return $r;
185
186 }
187
188 public function isNaN() {
189 $r = Item_isNaN($this->_cPtr);
190 return $r;
191
192 }
193
194 public function isNode() {
195 $r = Item_isNode($this->_cPtr);
196 return $r;
197
198 }
199
200 public function isNull() {
201 $r = Item_isNull($this->_cPtr);
202 return $r;
203
204 }
205
206 public function isPosOrNegInf() {
207 $r = Item_isPosOrNegInf($this->_cPtr);
208 return $r;
209
210 }
211
212 public function __construct($ptr) {
213 $this->_cPtr = $ptr;
214 }
215
216}
217
218class IteratorImpl{
219 public $_cPtr=null;
220
221 public function __set($var, $value) {
222 $r = Iterator___set($this->_cPtr, $var, $value);
223 return $r;
224
225 }
226
227 public function __isset($var) {
228 $r = Iterator___isset($this->_cPtr, $var);
229 return $r;
230
231 }
232
233 public function __get($var) {
234 $r = Iterator___get($this->_cPtr, $var);
235 return $r;
236
237 }
238
239 public function open() {
240 $r = Iterator_open($this->_cPtr);
241 return $r;
242
243 }
244
245 public function next($arg1) {
246 $r = Iterator_next($this->_cPtr, $arg1);
247 return $r;
248
249 }
250
251 public function close() {
252 $r = Iterator_close($this->_cPtr);
253 return $r;
254
255 }
256
257 public function destroy() {
258 $r = Iterator_destroy($this->_cPtr);
259 return $r;
260
261 }
262
263 public function __construct($ptr) {
264 $this->_cPtr = $ptr;
265 }
266
267}
268
269class XQuery{
270 public $_cPtr=null;
271
272 public function __set($var, $value) {
273 $r = XQuery___set($this->_cPtr, $var, $value);
274 return $r;
275
276 }
277
278 public function __isset($var) {
279 $r = XQuery___isset($this->_cPtr, $var);
280 return $r;
281
282 }
283
284 public function __get($var) {
285 $r = XQuery___get($this->_cPtr, $var);
286 return $r;
287
288 }
289
290 public function execute() {
291 $r = XQuery_execute($this->_cPtr);
292 return $r;
293
294 }
295
296 public function printPlanAsXML() {
297 $r = XQuery_printPlanAsXML($this->_cPtr);
298 return $r;
299
300 }
301
302 public function printPlanAsDOT() {
303 $r = XQuery_printPlanAsDOT($this->_cPtr);
304 return $r;
305
306 }
307
308 public function compile($aQuery, $aStaticContext=null) {
309 switch(func_num_args()) {
310 case 1: $r = XQuery_compile($this->_cPtr, $aQuery);break;
311 case 2: $r = XQuery_compile($this->_cPtr, $aQuery, $aStaticContext);break;
312 default: $r = XQuery_compile($this->_cPtr, $aQuery, $aStaticContext);
313 }
314 return $r;
315
316 }
317
318 public function destroy() {
319 $r = XQuery_destroy($this->_cPtr);
320 return $r;
321
322 }
323
324 public function iterator() {
325 $r = XQuery_iterator($this->_cPtr);
326 return is_resource($r) ? new IteratorImpl($r) : $r;
327
328 }
329
330 public function getDynamicContext() {
331 $r = XQuery_getDynamicContext($this->_cPtr);
332 return is_resource($r) ? new DynamicContext($r) : $r;
333
334 }
335
336 public function __construct($ptr) {
337 $this->_cPtr = $ptr;
338 }
339
340}
341
342class Store{
343 public $_cPtr=null;
344
345 public function __set($var, $value) {
346 $r = Store___set($this->_cPtr, $var, $value);
347 return $r;
348
349 }
350
351 public function __isset($var) {
352 $r = Store___isset($this->_cPtr, $var);
353 return $r;
354
355 }
356
357 public function __get($var) {
358 $r = Store___get($this->_cPtr, $var);
359 return $r;
360
361 }
362
363 public function __construct($ptr) {
364 $this->_cPtr = $ptr;
365 }
366
367}
368
369class InMemoryStore extends Store{
370 public $_cPtr=null;
371
372 static public function getInstance() {
373 $r = InMemoryStore_getInstance();
374 return is_resource($r) ? new InMemoryStore($r) : $r;
375
376 }
377
378 static public function shutdown($arg1) {
379 $r = InMemoryStore_shutdown($arg1);
380 return $r;
381
382 }
383
384}
385
386class DocumentManager{
387 public $_cPtr=null;
388
389 public function __set($var, $value) {
390 $r = DocumentManager___set($this->_cPtr, $var, $value);
391 return $r;
392
393 }
394
395 public function __isset($var) {
396 $r = DocumentManager___isset($this->_cPtr, $var);
397 return $r;
398
399 }
400
401 public function __get($var) {
402 $r = DocumentManager___get($this->_cPtr, $var);
403 return $r;
404
405 }
406
407 public function put($aName, $aDoc) {
408 $r = DocumentManager_put($this->_cPtr, $aName, $aDoc);
409 return $r;
410
411 }
412
413 public function remove($aName) {
414 $r = DocumentManager_remove($this->_cPtr, $aName);
415 return $r;
416
417 }
418
419 public function document($aName) {
420 $r = DocumentManager_document($this->_cPtr, $aName);
421 return is_resource($r) ? new Item($r) : $r;
422
423 }
424
425 public function isAvailableDocument($aName) {
426 $r = DocumentManager_isAvailableDocument($this->_cPtr, $aName);
427 return $r;
428
429 }
430
431 public function __construct($ptr) {
432 $this->_cPtr = $ptr;
433 }
434
435}
436
437class XmlDataManager{
438 public $_cPtr=null;
439
440 public function __set($var, $value) {
441 $r = XmlDataManager___set($this->_cPtr, $var, $value);
442 return $r;
443
444 }
445
446 public function __isset($var) {
447 $r = XmlDataManager___isset($this->_cPtr, $var);
448 return $r;
449
450 }
451
452 public function __get($var) {
453 $r = XmlDataManager___get($this->_cPtr, $var);
454 return $r;
455
456 }
457
458 public function getDocumentManager() {
459 $r = XmlDataManager_getDocumentManager($this->_cPtr);
460 return is_resource($r) ? new DocumentManager($r) : $r;
461
462 }
463
464 public function parseXML($aDoc) {
465 $r = XmlDataManager_parseXML($this->_cPtr, $aDoc);
466 return is_resource($r) ? new IteratorImpl($r) : $r;
467
468 }
469
470 public function __construct($ptr) {
471 $this->_cPtr = $ptr;
472 }
473
474}
475
476class ZorbaException{
477 public $_cPtr=null;
478
479 public function __set($var, $value) {
480 $r = ZorbaException___set($this->_cPtr, $var, $value);
481 return $r;
482
483 }
484
485 public function __isset($var) {
486 $r = ZorbaException___isset($this->_cPtr, $var);
487 return $r;
488
489 }
490
491 public function __get($var) {
492 $r = ZorbaException___get($this->_cPtr, $var);
493 return $r;
494
495 }
496
497 public function __construct($ptr) {
498 $this->_cPtr = $ptr;
499 }
500
501 public function getDescription() {
502 $r = ZorbaException_getDescription($this->_cPtr);
503 return $r;
504
505 }
506
507 public function getErrorCode() {
508 $r = ZorbaException_getErrorCode($this->_cPtr);
509 return $r;
510
511 }
512
513 public function getFileLineNumber() {
514 $r = ZorbaException_getFileLineNumber($this->_cPtr);
515 return $r;
516
517 }
518
519 public function getFileName() {
520 $r = ZorbaException_getFileName($this->_cPtr);
521 return $r;
522
523 }
524
525 static public function getErrorCodeAsString($aErrorCode) {
526 $r = ZorbaException_getErrorCodeAsString($aErrorCode);
527 return $r;
528
529 }
530
531}
532
533class XQueryException extends ZorbaException{
534 public $_cPtr=null;
535
536 public function getColumnBegin() {
537 $r = XQueryException_getColumnBegin($this->_cPtr);
538 return $r;
539
540 }
541
542 public function getLineBegin() {
543 $r = XQueryException_getLineBegin($this->_cPtr);
544 return $r;
545
546 }
547
548 public function getQueryURI() {
549 $r = XQueryException_getQueryURI($this->_cPtr);
550 return $r;
551
552 }
553
554}
555
556class CompilerHints{
557 public $_cPtr=null;
558
559 public function __set($var, $value) {
560 $r = CompilerHints___set($this->_cPtr, $var, $value);
561 return $r;
562
563 }
564
565 public function __isset($var) {
566 $r = CompilerHints___isset($this->_cPtr, $var);
567 return $r;
568
569 }
570
571 public function __get($var) {
572 $r = CompilerHints___get($this->_cPtr, $var);
573 return $r;
574
575 }
576
577 public function getLibModule() {
578 $r = CompilerHints_getLibModule($this->_cPtr);
579 return $r;
580
581 }
582
583 public function setLibModule($aLibModule) {
584 $r = CompilerHints_setLibModule($this->_cPtr, $aLibModule);
585 return $r;
586
587 }
588
589 public function getOptimizationLevel() {
590 $r = CompilerHints_getOptimizationLevel($this->_cPtr);
591 return $r;
592
593 }
594
595 public function setOptimizationLevel($aOptLevel) {
596 $r = CompilerHints_setOptimizationLevel($this->_cPtr, $aOptLevel);
597 return $r;
598
599 }
600
601 public function __construct($ptr) {
602 $this->_cPtr = $ptr;
603 }
604
605}
606
607class StaticContext{
608 public $_cPtr=null;
609
610 public function __set($var, $value) {
611 $r = StaticContext___set($this->_cPtr, $var, $value);
612 return $r;
613
614 }
615
616 public function __isset($var) {
617 $r = StaticContext___isset($this->_cPtr, $var);
618 return $r;
619
620 }
621
622 public function __get($var) {
623 $r = StaticContext___get($this->_cPtr, $var);
624 return $r;
625
626 }
627
628 public function __construct($ptr) {
629 $this->_cPtr = $ptr;
630 }
631
632 public function addColation($aURI) {
633 $r = StaticContext_addColation($this->_cPtr, $aURI);
634 return $r;
635
636 }
637
638 public function addNamespace($aPrefix, $aURI) {
639 $r = StaticContext_addNamespace($this->_cPtr, $aPrefix, $aURI);
640 return $r;
641
642 }
643
644 public function addReference() {
645 $r = StaticContext_addReference($this->_cPtr);
646 return $r;
647
648 }
649
650 public function containsFunction($aFnNameUri, $aFnNameLocal, $arity) {
651 $r = StaticContext_containsFunction($this->_cPtr, $aFnNameUri, $aFnNameLocal, $arity);
652 return $r;
653
654 }
655
656 public function createChildContext() {
657 $r = StaticContext_createChildContext($this->_cPtr);
658 return is_resource($r) ? new StaticContext($r) : $r;
659
660 }
661
662 public function declareOption($aQName, $aOptionVal) {
663 $r = StaticContext_declareOption($this->_cPtr, $aQName, $aOptionVal);
664 return $r;
665
666 }
667
668 public function disableFunction($aQName, $arity) {
669 $r = StaticContext_disableFunction($this->_cPtr, $aQName, $arity);
670 return $r;
671
672 }
673
674 public function free() {
675 $r = StaticContext_free($this->_cPtr);
676 return $r;
677
678 }
679
680 public function getBaseURI() {
681 $r = StaticContext_getBaseURI($this->_cPtr);
682 return $r;
683
684 }
685
686 public function getBoundarySpacePolicy() {
687 $r = StaticContext_getBoundarySpacePolicy($this->_cPtr);
688 return $r;
689
690 }
691
692 public function getConstructionMode() {
693 $r = StaticContext_getConstructionMode($this->_cPtr);
694 return $r;
695
696 }
697
698 public function getCopyNamespacesMode($aPreserve, $aInherit) {
699 $r = StaticContext_getCopyNamespacesMode($this->_cPtr, $aPreserve, $aInherit);
700 return $r;
701
702 }
703
704 public function getDefaultCollation() {
705 $r = StaticContext_getDefaultCollation($this->_cPtr);
706 return $r;
707
708 }
709
710 public function getDefaultElementAndTypeNamespace() {
711 $r = StaticContext_getDefaultElementAndTypeNamespace($this->_cPtr);
712 return $r;
713
714 }
715
716 public function getDefaultFunctionNamespace() {
717 $r = StaticContext_getDefaultFunctionNamespace($this->_cPtr);
718 return $r;
719
720 }
721
722 public function getDefaultOrderForEmptySequences() {
723 $r = StaticContext_getDefaultOrderForEmptySequences($this->_cPtr);
724 return $r;
725
726 }
727
728 public function getNamespaceURIByPrefix($aPrefix) {
729 $r = StaticContext_getNamespaceURIByPrefix($this->_cPtr, $aPrefix);
730 return $r;
731
732 }
733
734 public function getOption($aQName, $aOptionValue) {
735 $r = StaticContext_getOption($this->_cPtr, $aQName, $aOptionValue);
736 return $r;
737
738 }
739
740 public function getOrderingMode() {
741 $r = StaticContext_getOrderingMode($this->_cPtr);
742 return $r;
743
744 }
745
746 public function getRefCount() {
747 $r = StaticContext_getRefCount($this->_cPtr);
748 return $r;
749
750 }
751
752 public function getRevalidationMode() {
753 $r = StaticContext_getRevalidationMode($this->_cPtr);
754 return $r;
755
756 }
757
758 public function getXPath1_0CompatibMode() {
759 $r = StaticContext_getXPath1_0CompatibMode($this->_cPtr);
760 return $r;
761
762 }
763
764 public function loadProlog($aProlog, $hints) {
765 $r = StaticContext_loadProlog($this->_cPtr, $aProlog, $hints);
766 return $r;
767
768 }
769
770 public function removeReference() {
771 $r = StaticContext_removeReference($this->_cPtr);
772 return $r;
773
774 }
775
776 public function resetTraceStream() {
777 $r = StaticContext_resetTraceStream($this->_cPtr);
778 return $r;
779
780 }
781
782 public function setBaseURI($aBaseURI) {
783 $r = StaticContext_setBaseURI($this->_cPtr, $aBaseURI);
784 return $r;
785
786 }
787
788 public function setBoundarySpacePolicy($aMode) {
789 $r = StaticContext_setBoundarySpacePolicy($this->_cPtr, $aMode);
790 return $r;
791
792 }
793
794 public function setConstructionMode($aMode) {
795 $r = StaticContext_setConstructionMode($this->_cPtr, $aMode);
796 return $r;
797
798 }
799
800 public function setCopyNamespacesMode($aPreserve, $aInherit) {
801 $r = StaticContext_setCopyNamespacesMode($this->_cPtr, $aPreserve, $aInherit);
802 return $r;
803
804 }
805
806 public function setDefaultCollation($aURI) {
807 $r = StaticContext_setDefaultCollation($this->_cPtr, $aURI);
808 return $r;
809
810 }
811
812 public function setDefaultElementAndTypeNamespace($aURI) {
813 $r = StaticContext_setDefaultElementAndTypeNamespace($this->_cPtr, $aURI);
814 return $r;
815
816 }
817
818 public function setDefaultFunctionNamespace($aURI) {
819 $r = StaticContext_setDefaultFunctionNamespace($this->_cPtr, $aURI);
820 return $r;
821
822 }
823
824 public function setDefaultOrderForEmptySequences($aMode) {
825 $r = StaticContext_setDefaultOrderForEmptySequences($this->_cPtr, $aMode);
826 return $r;
827
828 }
829
830 public function setOrderingMode($aMode) {
831 $r = StaticContext_setOrderingMode($this->_cPtr, $aMode);
832 return $r;
833
834 }
835
836 public function setRevalidationMode($aMode) {
837 $r = StaticContext_setRevalidationMode($this->_cPtr, $aMode);
838 return $r;
839
840 }
841
842 public function setXPath1_0CompatibMode($aMode) {
843 $r = StaticContext_setXPath1_0CompatibMode($this->_cPtr, $aMode);
844 return $r;
845
846 }
847
848 public function destroy() {
849 $r = StaticContext_destroy($this->_cPtr);
850 return $r;
851
852 }
853
854}
855
856class Zorba{
857 public $_cPtr=null;
858
859 public function __set($var, $value) {
860 $r = Zorba___set($this->_cPtr, $var, $value);
861 return $r;
862
863 }
864
865 public function __isset($var) {
866 $r = Zorba___isset($this->_cPtr, $var);
867 return $r;
868
869 }
870
871 public function __get($var) {
872 $r = Zorba___get($this->_cPtr, $var);
873 return $r;
874
875 }
876
877 static public function getInstance($arg1) {
878 $r = Zorba_getInstance($arg1);
879 return is_resource($r) ? new Zorba($r) : $r;
880
881 }
882
883 public function createStaticContext() {
884 $r = Zorba_createStaticContext($this->_cPtr);
885 return is_resource($r) ? new StaticContext($r) : $r;
886
887 }
888
889 public function createQuery() {
890 $r = Zorba_createQuery($this->_cPtr);
891 return is_resource($r) ? new XQuery($r) : $r;
892
893 }
894
895 public function compileQuery($aStr, $aStaticContext=null) {
896 switch(func_num_args()) {
897 case 1: $r = Zorba_compileQuery($this->_cPtr, $aStr);break;
898 case 2: $r = Zorba_compileQuery($this->_cPtr, $aStr, $aStaticContext);break;
899 default: $r = Zorba_compileQuery($this->_cPtr, $aStr, $aStaticContext);
900 }
901 return is_resource($r) ? new XQuery($r) : $r;
902
903 }
904
905 public function getItemFactory() {
906 $r = Zorba_getItemFactory($this->_cPtr);
907 return is_resource($r) ? new ItemFactory($r) : $r;
908
909 }
910
911 public function getXmlDataManager() {
912 $r = Zorba_getXmlDataManager($this->_cPtr);
913 return is_resource($r) ? new XmlDataManager($r) : $r;
914
915 }
916
917 public function shutdown() {
918 $r = Zorba_shutdown($this->_cPtr);
919 return $r;
920
921 }
922
923 public function __construct($ptr) {
924 $this->_cPtr = $ptr;
925 }
926
927}
928
929class ItemFactory{
930 public $_cPtr=null;
931
932 public function __set($var, $value) {
933 $r = ItemFactory___set($this->_cPtr, $var, $value);
934 return $r;
935
936 }
937
938 public function __isset($var) {
939 $r = ItemFactory___isset($this->_cPtr, $var);
940 return $r;
941
942 }
943
944 public function __get($var) {
945 $r = ItemFactory___get($this->_cPtr, $var);
946 return $r;
947
948 }
949
950 public function __construct($ptr) {
951 $this->_cPtr = $ptr;
952 }
953
954 public function createAnyURI($aURI) {
955 $r = ItemFactory_createAnyURI($this->_cPtr, $aURI);
956 return is_resource($r) ? new Item($r) : $r;
957
958 }
959
960 public function createAttributeNode($aParent, $aNodeName, $aTypeName, $aTypedValue) {
961 $r = ItemFactory_createAttributeNode($this->_cPtr, $aParent, $aNodeName, $aTypeName, $aTypedValue);
962 return is_resource($r) ? new Item($r) : $r;
963
964 }
965
966 public function createBase64Binary($aBinData_or_aStream, $aLength=null) {
967 switch(func_num_args()) {
968 case 1: $r = ItemFactory_createBase64Binary($this->_cPtr, $aBinData_or_aStream);break;
969 case 2: $r = ItemFactory_createBase64Binary($this->_cPtr, $aBinData_or_aStream, $aLength);break;
970 default: $r = ItemFactory_createBase64Binary($this->_cPtr, $aBinData_or_aStream, $aLength);
971 }
972 return is_resource($r) ? new Item($r) : $r;
973
974 }
975
976 public function createBoolean($aValue) {
977 $r = ItemFactory_createBoolean($this->_cPtr, $aValue);
978 return is_resource($r) ? new Item($r) : $r;
979
980 }
981
982 public function createByte($aByte) {
983 $r = ItemFactory_createByte($this->_cPtr, $aByte);
984 return is_resource($r) ? new Item($r) : $r;
985
986 }
987
988 public function createDate($aDate_or_aYear, $aMonth=null, $aDay=null) {
989 switch(func_num_args()) {
990 case 1: $r = ItemFactory_createDate($this->_cPtr, $aDate_or_aYear);break;
991 case 2: $r = ItemFactory_createDate($this->_cPtr, $aDate_or_aYear, $aMonth);break;
992 case 3: $r = ItemFactory_createDate($this->_cPtr, $aDate_or_aYear, $aMonth, $aDay);break;
993 default: $r = ItemFactory_createDate($this->_cPtr, $aDate_or_aYear, $aMonth, $aDay);
994 }
995 return is_resource($r) ? new Item($r) : $r;
996
997 }
998
999 public function createDateTime($aDateTimeValue_or_aYear, $aMonth=null, $aDay=null, $aHour=null, $aMinute=null, $aSecond=null, $aTimeZone_hours=null) {
1000 switch(func_num_args()) {
1001 case 1: $r = ItemFactory_createDateTime($this->_cPtr, $aDateTimeValue_or_aYear);break;
1002 case 2: $r = ItemFactory_createDateTime($this->_cPtr, $aDateTimeValue_or_aYear, $aMonth);break;
1003 case 3: $r = ItemFactory_createDateTime($this->_cPtr, $aDateTimeValue_or_aYear, $aMonth, $aDay);break;
1004 case 4: $r = ItemFactory_createDateTime($this->_cPtr, $aDateTimeValue_or_aYear, $aMonth, $aDay, $aHour);break;
1005 case 5: $r = ItemFactory_createDateTime($this->_cPtr, $aDateTimeValue_or_aYear, $aMonth, $aDay, $aHour, $aMinute);break;
1006 case 6: $r = ItemFactory_createDateTime($this->_cPtr, $aDateTimeValue_or_aYear, $aMonth, $aDay, $aHour, $aMinute, $aSecond);break;
1007 case 7: $r = ItemFactory_createDateTime($this->_cPtr, $aDateTimeValue_or_aYear, $aMonth, $aDay, $aHour, $aMinute, $aSecond, $aTimeZone_hours);break;
1008 default: $r = ItemFactory_createDateTime($this->_cPtr, $aDateTimeValue_or_aYear, $aMonth, $aDay, $aHour, $aMinute, $aSecond, $aTimeZone_hours);
1009 }
1010 return is_resource($r) ? new Item($r) : $r;
1011
1012 }
1013
1014 public function createDecimal($aValue) {
1015 $r = ItemFactory_createDecimal($this->_cPtr, $aValue);
1016 return is_resource($r) ? new Item($r) : $r;
1017
1018 }
1019
1020 public function createDecimalFromDouble($aValue) {
1021 $r = ItemFactory_createDecimalFromDouble($this->_cPtr, $aValue);
1022 return is_resource($r) ? new Item($r) : $r;
1023
1024 }
1025
1026 public function createDecimalFromLong($aValue) {
1027 $r = ItemFactory_createDecimalFromLong($this->_cPtr, $aValue);
1028 return is_resource($r) ? new Item($r) : $r;
1029
1030 }
1031
1032 public function createDouble($aValue) {
1033 $r = ItemFactory_createDouble($this->_cPtr, $aValue);
1034 return is_resource($r) ? new Item($r) : $r;
1035
1036 }
1037
1038 public function createDuration($aValue_or_aYear, $aMonths=null, $aDays=null, $aHours=null, $aMinutes=null, $aSeconds=null) {
1039 switch(func_num_args()) {
1040 case 1: $r = ItemFactory_createDuration($this->_cPtr, $aValue_or_aYear);break;
1041 case 2: $r = ItemFactory_createDuration($this->_cPtr, $aValue_or_aYear, $aMonths);break;
1042 case 3: $r = ItemFactory_createDuration($this->_cPtr, $aValue_or_aYear, $aMonths, $aDays);break;
1043 case 4: $r = ItemFactory_createDuration($this->_cPtr, $aValue_or_aYear, $aMonths, $aDays, $aHours);break;
1044 case 5: $r = ItemFactory_createDuration($this->_cPtr, $aValue_or_aYear, $aMonths, $aDays, $aHours, $aMinutes);break;
1045 case 6: $r = ItemFactory_createDuration($this->_cPtr, $aValue_or_aYear, $aMonths, $aDays, $aHours, $aMinutes, $aSeconds);break;
1046 default: $r = ItemFactory_createDuration($this->_cPtr, $aValue_or_aYear, $aMonths, $aDays, $aHours, $aMinutes, $aSeconds);
1047 }
1048 return is_resource($r) ? new Item($r) : $r;
1049
1050 }
1051
1052 public function createFloat($aValue) {
1053 $r = ItemFactory_createFloat($this->_cPtr, $aValue);
1054 return is_resource($r) ? new Item($r) : $r;
1055
1056 }
1057
1058 public function createGDay($aValue_or_aDay) {
1059 $r = ItemFactory_createGDay($this->_cPtr, $aValue_or_aDay);
1060 return is_resource($r) ? new Item($r) : $r;
1061
1062 }
1063
1064 public function createGMonth($aValue_or_aMonth) {
1065 $r = ItemFactory_createGMonth($this->_cPtr, $aValue_or_aMonth);
1066 return is_resource($r) ? new Item($r) : $r;
1067
1068 }
1069
1070 public function createGMonthDay($aValue_or_aMonth, $aDay=null) {
1071 switch(func_num_args()) {
1072 case 1: $r = ItemFactory_createGMonthDay($this->_cPtr, $aValue_or_aMonth);break;
1073 case 2: $r = ItemFactory_createGMonthDay($this->_cPtr, $aValue_or_aMonth, $aDay);break;
1074 default: $r = ItemFactory_createGMonthDay($this->_cPtr, $aValue_or_aMonth, $aDay);
1075 }
1076 return is_resource($r) ? new Item($r) : $r;
1077
1078 }
1079
1080 public function createGYear($aYear_or_aValue) {
1081 $r = ItemFactory_createGYear($this->_cPtr, $aYear_or_aValue);
1082 return is_resource($r) ? new Item($r) : $r;
1083
1084 }
1085
1086 public function createGYearMonth($aValue_or_aYear, $aMonth=null) {
1087 switch(func_num_args()) {
1088 case 1: $r = ItemFactory_createGYearMonth($this->_cPtr, $aValue_or_aYear);break;
1089 case 2: $r = ItemFactory_createGYearMonth($this->_cPtr, $aValue_or_aYear, $aMonth);break;
1090 default: $r = ItemFactory_createGYearMonth($this->_cPtr, $aValue_or_aYear, $aMonth);
1091 }
1092 return is_resource($r) ? new Item($r) : $r;
1093
1094 }
1095
1096 public function createHexBinary($aHexData, $aSize) {
1097 $r = ItemFactory_createHexBinary($this->_cPtr, $aHexData, $aSize);
1098 return is_resource($r) ? new Item($r) : $r;
1099
1100 }
1101
1102 public function createInt($aInt) {
1103 $r = ItemFactory_createInt($this->_cPtr, $aInt);
1104 return is_resource($r) ? new Item($r) : $r;
1105
1106 }
1107
1108 public function createInteger($aInteger) {
1109 $r = ItemFactory_createInteger($this->_cPtr, (string)$aInteger);
1110 return is_resource($r) ? new Item($r) : $r;
1111
1112 }
1113
1114 public function createLong($aLong) {
1115 $r = ItemFactory_createLong($this->_cPtr, $aLong);
1116 return is_resource($r) ? new Item($r) : $r;
1117
1118 }
1119
1120 public function createNCName($aValue) {
1121 $r = ItemFactory_createNCName($this->_cPtr, $aValue);
1122 return is_resource($r) ? new Item($r) : $r;
1123
1124 }
1125
1126 public function createNegativeInteger($aValue) {
1127 $r = ItemFactory_createNegativeInteger($this->_cPtr, $aValue);
1128 return is_resource($r) ? new Item($r) : $r;
1129
1130 }
1131
1132 public function createNonNegativeInteger($aValue) {
1133 $r = ItemFactory_createNonNegativeInteger($this->_cPtr, $aValue);
1134 return is_resource($r) ? new Item($r) : $r;
1135
1136 }
1137
1138 public function createNonPositiveInteger($aValue) {
1139 $r = ItemFactory_createNonPositiveInteger($this->_cPtr, $aValue);
1140 return is_resource($r) ? new Item($r) : $r;
1141
1142 }
1143
1144 public function createPositiveInteger($aValue) {
1145 $r = ItemFactory_createPositiveInteger($this->_cPtr, $aValue);
1146 return is_resource($r) ? new Item($r) : $r;
1147
1148 }
1149
1150 public function createQName($aNamespace_or_aQNameString, $aPrefix_or_aLocalname=null, $aLocalname=null) {
1151 switch(func_num_args()) {
1152 case 1: $r = ItemFactory_createQName($this->_cPtr, $aNamespace_or_aQNameString);break;
1153 case 2: $r = ItemFactory_createQName($this->_cPtr, $aNamespace_or_aQNameString, $aPrefix_or_aLocalname);break;
1154 case 3: $r = ItemFactory_createQName($this->_cPtr, $aNamespace_or_aQNameString, $aPrefix_or_aLocalname, $aLocalname);break;
1155 default: $r = ItemFactory_createQName($this->_cPtr, $aNamespace_or_aQNameString, $aPrefix_or_aLocalname, $aLocalname);
1156 }
1157 return is_resource($r) ? new Item($r) : $r;
1158
1159 }
1160
1161 public function createShort($aShort) {
1162 $r = ItemFactory_createShort($this->_cPtr, $aShort);
1163 return is_resource($r) ? new Item($r) : $r;
1164
1165 }
1166
1167 public function createString($aString) {
1168 $r = ItemFactory_createString($this->_cPtr, $aString);
1169 return is_resource($r) ? new Item($r) : $r;
1170
1171 }
1172
1173 public function createTextNode($parent, $content) {
1174 $r = ItemFactory_createTextNode($this->_cPtr, $parent, $content);
1175 return is_resource($r) ? new Item($r) : $r;
1176
1177 }
1178
1179 public function createTime($aHour_or_aValue, $aMinute=null, $aSecond=null, $aTimeZone_hours=null) {
1180 switch(func_num_args()) {
1181 case 1: $r = ItemFactory_createTime($this->_cPtr, $aHour_or_aValue);break;
1182 case 2: $r = ItemFactory_createTime($this->_cPtr, $aHour_or_aValue, $aMinute);break;
1183 case 3: $r = ItemFactory_createTime($this->_cPtr, $aHour_or_aValue, $aMinute, $aSecond);break;
1184 case 4: $r = ItemFactory_createTime($this->_cPtr, $aHour_or_aValue, $aMinute, $aSecond, $aTimeZone_hours);break;
1185 default: $r = ItemFactory_createTime($this->_cPtr, $aHour_or_aValue, $aMinute, $aSecond, $aTimeZone_hours);
1186 }
1187 return is_resource($r) ? new Item($r) : $r;
1188
1189 }
1190
1191 public function createUnsignedByte($aValue) {
1192 $r = ItemFactory_createUnsignedByte($this->_cPtr, $aValue);
1193 return is_resource($r) ? new Item($r) : $r;
1194
1195 }
1196
1197 public function createUnsignedInt($aValue) {
1198 $r = ItemFactory_createUnsignedInt($this->_cPtr, $aValue);
1199 return is_resource($r) ? new Item($r) : $r;
1200
1201 }
1202
1203 public function createUnsignedLong($aValue) {
1204 $r = ItemFactory_createUnsignedLong($this->_cPtr, $aValue);
1205 return is_resource($r) ? new Item($r) : $r;
1206
1207 }
1208
1209 public function createUnsignedShort($aValue) {
1210 $r = ItemFactory_createUnsignedShort($this->_cPtr, $aValue);
1211 return is_resource($r) ? new Item($r) : $r;
1212
1213 }
1214
1215}

Subscribers

People subscribed via source and target branches