Skip to content

Commit 89957b4

Browse files
committed
updated README and examples
1 parent b42502f commit 89957b4

File tree

2 files changed

+24
-19
lines changed

2 files changed

+24
-19
lines changed

README.md

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ The autoloader will care about loading additionally required classes on the fly.
5858

5959
The ArangoDB PHP client is an API that allows you to send and retrieve documents from ArangoDB from out of your PHP application. The client library itself is written in PHP and has no further dependencies but just plain PHP 5.3 (or higher).
6060

61-
The client library provides document and collection classes you can use to work with documents and collections in an OO fashion. When exchanging document data with the server, the library internally will use the [HTTP REST interface of ArangoDB](https://docs.arangodb.com/HttpApi/README.html). The library user does not have to care about this fact as all the details of the REST interface are abstracted by the client library.
61+
The client library provides document and collection classes you can use to work with documents and collections in an OO fashion. When exchanging document data with the server, the library internally will use the [HTTP REST interface of ArangoDB](https://docs.arangodb.com/HttpApi/index.html). The library user does not have to care about this fact as all the details of the REST interface are abstracted by the client library.
6262

6363
<br>
6464

@@ -225,22 +225,24 @@ use triagens\ArangoDb\UpdatePolicy as ArangoUpdatePolicy;
225225

226226
// set up some basic connection options
227227
$connectionOptions = array(
228+
// database name
229+
ArangoConnectionOptions::OPTION_DATABASE => '_system',
228230
// server endpoint to connect to
229-
ArangoConnectionOptions::OPTION_ENDPOINT => 'tcp://127.0.0.1:8529',
231+
ArangoConnectionOptions::OPTION_ENDPOINT => 'tcp://127.0.0.1:8529',
230232
// authorization type to use (currently supported: 'Basic')
231-
ArangoConnectionOptions::OPTION_AUTH_TYPE => 'Basic',
233+
ArangoConnectionOptions::OPTION_AUTH_TYPE => 'Basic',
232234
// user for basic authorization
233-
ArangoConnectionOptions::OPTION_AUTH_USER => 'root',
235+
ArangoConnectionOptions::OPTION_AUTH_USER => 'root',
234236
// password for basic authorization
235-
ArangoConnectionOptions::OPTION_AUTH_PASSWD => '',
237+
ArangoConnectionOptions::OPTION_AUTH_PASSWD => '',
236238
// connection persistence on server. can use either 'Close' (one-time connections) or 'Keep-Alive' (re-used connections)
237-
ArangoConnectionOptions::OPTION_CONNECTION => 'Keep-Alive',
239+
ArangoConnectionOptions::OPTION_CONNECTION => 'Keep-Alive',
238240
// connect timeout in seconds
239-
ArangoConnectionOptions::OPTION_TIMEOUT => 3,
241+
ArangoConnectionOptions::OPTION_TIMEOUT => 3,
240242
// whether or not to reconnect when a keep-alive connection has timed out on server
241-
ArangoConnectionOptions::OPTION_RECONNECT => true,
243+
ArangoConnectionOptions::OPTION_RECONNECT => true,
242244
// optionally create new collections when inserting documents
243-
ArangoConnectionOptions::OPTION_CREATE => true,
245+
ArangoConnectionOptions::OPTION_CREATE => true,
244246
// optionally create new collections when inserting documents
245247
ArangoConnectionOptions::OPTION_UPDATE_POLICY => ArangoUpdatePolicy::LAST,
246248
);
@@ -589,22 +591,24 @@ use triagens\ArangoDb\UpdatePolicy as ArangoUpdatePolicy;
589591

590592
// set up some basic connection options
591593
$connectionOptions = array(
594+
// database name
595+
ArangoConnectionOptions::OPTION_DATABASE => '_system',
592596
// server endpoint to connect to
593-
ArangoConnectionOptions::OPTION_ENDPOINT => 'tcp://127.0.0.1:8529',
597+
ArangoConnectionOptions::OPTION_ENDPOINT => 'tcp://127.0.0.1:8529',
594598
// authorization type to use (currently supported: 'Basic')
595-
ArangoConnectionOptions::OPTION_AUTH_TYPE => 'Basic',
599+
ArangoConnectionOptions::OPTION_AUTH_TYPE => 'Basic',
596600
// user for basic authorization
597-
ArangoConnectionOptions::OPTION_AUTH_USER => 'root',
601+
ArangoConnectionOptions::OPTION_AUTH_USER => 'root',
598602
// password for basic authorization
599-
ArangoConnectionOptions::OPTION_AUTH_PASSWD => '',
603+
ArangoConnectionOptions::OPTION_AUTH_PASSWD => '',
600604
// connection persistence on server. can use either 'Close' (one-time connections) or 'Keep-Alive' (re-used connections)
601-
ArangoConnectionOptions::OPTION_CONNECTION => 'Keep-Alive',
605+
ArangoConnectionOptions::OPTION_CONNECTION => 'Keep-Alive',
602606
// connect timeout in seconds
603-
ArangoConnectionOptions::OPTION_TIMEOUT => 3,
607+
ArangoConnectionOptions::OPTION_TIMEOUT => 3,
604608
// whether or not to reconnect when a keep-alive connection has timed out on server
605-
ArangoConnectionOptions::OPTION_RECONNECT => true,
609+
ArangoConnectionOptions::OPTION_RECONNECT => true,
606610
// optionally create new collections when inserting documents
607-
ArangoConnectionOptions::OPTION_CREATE => true,
611+
ArangoConnectionOptions::OPTION_CREATE => true,
608612
// optionally create new collections when inserting documents
609613
ArangoConnectionOptions::OPTION_UPDATE_POLICY => ArangoUpdatePolicy::LAST,
610614
);

examples/init.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@
1212

1313
/* set up connection options */
1414
$connectionOptions = array(
15-
ConnectionOptions::OPTION_ENDPOINT => 'tcp://localhost:8529', // endpoint to connect to
16-
ConnectionOptions::OPTION_CONNECTION => 'Keep-Alive', // can use either 'Close' (one-time connections) or 'Keep-Alive' (re-used connections)
15+
ConnectionOptions::OPTION_DATABASE => '_system', // database name
16+
ConnectionOptions::OPTION_ENDPOINT => 'tcp://localhost:8529', // endpoint to connect to
17+
ConnectionOptions::OPTION_CONNECTION => 'Keep-Alive', // can use either 'Close' (one-time connections) or 'Keep-Alive' (re-used connections)
1718
ConnectionOptions::OPTION_AUTH_TYPE => 'Basic', // use basic authorization
1819
/*
1920
ConnectionOptions::OPTION_AUTH_USER => '', // user for basic authorization

0 commit comments

Comments
 (0)