3
* Copyright 2006-2012 The FLWOR Foundation.
5
* Licensed under the Apache License, Version 2.0 (the "License");
6
* you may not use this file except in compliance with the License.
7
* You may obtain a copy of the License at
9
* http://www.apache.org/licenses/LICENSE-2.0
11
* Unless required by applicable law or agreed to in writing, software
12
* distributed under the License is distributed on an "AS IS" BASIS,
13
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
* See the License for the specific language governing permissions and
15
* limitations under the License.
18
//require '@phpPath@/Zorba/zorba_api_wrapper.php';
19
require 'C:/dev/zapi/build/swig/php/Zorba/zorba_api_wrapper.php';
21
class MyDiagnosticHandler(zorba_api.DiagnosticHandler):
22
def error(self, *args):
23
print "Error args: ", args
26
#Read and write result
27
print 'Executing: compilerHints.xq'
28
f = open('compilerHints.xq', 'r')
31
diagnosticHandler = MyDiagnosticHandler()
32
compilerHints = zorba_api.CompilerHints()
33
compilerHints.setLibModule(True)
34
compilerHints.setOptimizationLevel(1)
35
xquery = zorba.compileQuery(lines, compilerHints, diagnosticHandler)
37
result = xquery.execute()
42
store = zorba_api.InMemoryStore_getInstance()
43
zorba = zorba_api.Zorba_getInstance(store)
45
print "Running: CompileQuery string + Dignostinc handler + CompilerHint - with optimization 1 - setLibModule(True)"
51
zorba_api.InMemoryStore_shutdown(store)
b'\\ No newline at end of file'