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