File tree Expand file tree Collapse file tree 4 files changed +25
-47
lines changed Expand file tree Collapse file tree 4 files changed +25
-47
lines changed Original file line number Diff line number Diff line change 2
2
3
3
namespace triagens \Avocado ;
4
4
5
- require dirname (__FILE__ ) . DIRECTORY_SEPARATOR . '.. ' . DIRECTORY_SEPARATOR . 'autoload.php ' ;
6
-
7
- /* set up a trace function that will be called for each communication with the server */
8
- $ traceFunc = function ($ type , $ data ) {
9
- print "TRACE FOR " . $ type . PHP_EOL ;
10
- var_dump ($ data );
11
- };
12
-
13
- /* set up connection options */
14
- $ connectionOptions = array (
15
- ConnectionOptions::OPTION_PORT => 9000 ,
16
- ConnectionOptions::OPTION_HOST => "localhost " ,
17
- ConnectionOptions::OPTION_TIMEOUT => 3 ,
18
- ConnectionOptions::OPTION_TRACE => $ traceFunc ,
19
- ConnectionOptions::OPTION_CREATE => false ,
20
- ConnectionOptions::OPTION_UPDATE_POLICY => "last " ,
21
- );
5
+ require dirname (__FILE__ ) . DIRECTORY_SEPARATOR . 'init.php ' ;
22
6
23
7
try {
24
8
$ connection = new Connection ($ connectionOptions );
Original file line number Diff line number Diff line change 2
2
3
3
namespace triagens \Avocado ;
4
4
5
- require dirname (__FILE__ ) . DIRECTORY_SEPARATOR . '.. ' . DIRECTORY_SEPARATOR . ' autoload .php ' ;
5
+ require dirname (__FILE__ ) . DIRECTORY_SEPARATOR . 'init .php ' ;
6
6
7
- /* set up a trace function that will be called for each communication with the server */
8
- $ traceFunc = function ($ type , $ data ) {
9
- print "TRACE FOR " . $ type . PHP_EOL ;
10
- var_dump ($ data );
11
- };
12
-
13
- /* set up connection options */
14
- $ connectionOptions = array (
15
- ConnectionOptions::OPTION_PORT => 9000 , // port to connect to
16
- ConnectionOptions::OPTION_HOST => "localhost " , // host to connect to
17
- ConnectionOptions::OPTION_TIMEOUT => 3 , // timeout in seconds
18
- ConnectionOptions::OPTION_TRACE => $ traceFunc , // tracer function
19
- ConnectionOptions::OPTION_CREATE => false , // do not create unknown collections automatically
20
- ConnectionOptions::OPTION_UPDATE_POLICY => UpdatePolicy::LAST , // last update wins
21
- );
22
7
23
8
try {
24
9
$ connection = new Connection ($ connectionOptions );
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace triagens \Avocado ;
4
+
5
+ require dirname (__FILE__ ) . DIRECTORY_SEPARATOR . '.. ' . DIRECTORY_SEPARATOR . 'autoload.php ' ;
6
+
7
+ /* set up a trace function that will be called for each communication with the server */
8
+ $ traceFunc = function ($ type , $ data ) {
9
+ print "TRACE FOR " . $ type . PHP_EOL ;
10
+ var_dump ($ data );
11
+ };
12
+
13
+ /* set up connection options */
14
+ $ connectionOptions = array (
15
+ ConnectionOptions::OPTION_PORT => 8529 , // port to connect to
16
+ ConnectionOptions::OPTION_HOST => "localhost " , // host to connect to
17
+ ConnectionOptions::OPTION_TIMEOUT => 3 , // timeout in seconds
18
+ ConnectionOptions::OPTION_TRACE => $ traceFunc , // tracer function
19
+ ConnectionOptions::OPTION_CREATE => false , // do not create unknown collections automatically
20
+ ConnectionOptions::OPTION_UPDATE_POLICY => UpdatePolicy::LAST , // last update wins
21
+ );
22
+
Original file line number Diff line number Diff line change 2
2
3
3
namespace triagens \Avocado ;
4
4
5
- require dirname (__FILE__ ) . DIRECTORY_SEPARATOR . '.. ' . DIRECTORY_SEPARATOR . ' autoload .php ' ;
5
+ require dirname (__FILE__ ) . DIRECTORY_SEPARATOR . 'init .php ' ;
6
6
7
7
/* set up some example statements */
8
8
$ statements = array (
17
17
"select u from users u where u.id == @id@ && u.name != @name@ " => array ("id " => 6 , "name " => "fux " ),
18
18
);
19
19
20
- /* set up a trace function that will be called for each communication with the server */
21
- $ traceFunc = function ($ type , $ data ) {
22
- print "TRACE FOR " . $ type . PHP_EOL ;
23
- var_dump ($ data );
24
- };
25
-
26
- /* set up connection options */
27
- $ connectionOptions = array (
28
- ConnectionOptions::OPTION_PORT => 9000 ,
29
- ConnectionOptions::OPTION_HOST => "localhost " ,
30
- ConnectionOptions::OPTION_TIMEOUT => 3 ,
31
- ConnectionOptions::OPTION_TRACE => $ traceFunc ,
32
- );
33
20
34
21
try {
35
22
$ connection = new Connection ($ connectionOptions );
You can’t perform that action at this time.
0 commit comments