Skip to content

Commit 2ee85cd

Browse files
committed
updated docs
1 parent 690fb4e commit 2ee85cd

File tree

1 file changed

+100
-0
lines changed

1 file changed

+100
-0
lines changed

docs/README.md

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# Neo4j Symfony Bundle
2+
3+
[![Latest Version](https://img.shields.io/github/release/neo4j-contrib/neo4j-symfony.svg?style=flat-square)](https://github.com/neo4j-contrib/neo4j-symfony/releases)
4+
[![Build Status](https://img.shields.io/travis/neo4j-contrib/neo4j-symfony/master.svg?style=flat-square)](https://travis-ci.org/neo4j-contrib/neo4j-symfony)
5+
[![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/neo4j-contrib/neo4j-symfony.svg?style=flat-square)](https://scrutinizer-ci.com/g/neo4j-contrib/neo4j-symfony)
6+
[![Quality Score](https://img.shields.io/scrutinizer/g/neo4j-contrib/neo4j-symfony.svg?style=flat-square)](https://scrutinizer-ci.com/g/neo4j-contrib/neo4j-symfony)
7+
[![Total Downloads](https://img.shields.io/packagist/dt/neo4j/neo4j-bundle.svg?style=flat-square)](https://packagist.org/packages/neo4j/neo4j-bundle)
8+
9+
10+
## Install
11+
12+
Via Composer
13+
14+
``` bash
15+
$ composer require neo4j/neo4j-bundle
16+
```
17+
18+
Enable the bundle in your kernel:
19+
20+
``` php
21+
<?php
22+
// app/AppKernel.php
23+
24+
public function registerBundles()
25+
{
26+
$bundles = array(
27+
// ...
28+
new Neo4j\Neo4jBundle\Neo4jBundle(),
29+
);
30+
}
31+
```
32+
33+
## Documentation
34+
35+
The bundle is a convenient way of registering services. We register `Connections`,
36+
`Clients` and `EntityManagers`. You will always have alias for the default services:
37+
38+
* neo4j.driver
39+
* neo4j.client
40+
41+
42+
### Minimal configuration
43+
44+
```yaml
45+
neo4j:
46+
drivers:
47+
default: ~
48+
```
49+
50+
With the minimal configuration we have services named:
51+
* neo4j.connection.default
52+
* neo4j.client.default
53+
* neo4j.entity_manager.default*
54+
55+
### Full configuration example
56+
57+
This example configures the client to contain two instances.
58+
59+
```yaml
60+
neo4j:
61+
profiling: true
62+
default_driver: high-availability
63+
connections:
64+
- alias: high-availability
65+
dsn: 'neo4j://core1.mydomain.com:7687'
66+
authentication:
67+
type: 'oidc'
68+
token: '%neo4j.openconnect-id-token%'
69+
priority: 1
70+
# Overriding the alias makes it so that there is a backup server to use in case
71+
# the routing table cannot be fetched through the driver with a higher priority
72+
# but the same alias.
73+
# Once the table is fetched it will use that information to auto-route as usual.
74+
- alias: high-availability
75+
dsn: 'neo4j://core2.mydomain.com:7687'
76+
priority: 0
77+
authentication:
78+
type: 'oidc'
79+
token: '%neo4j.openconnect-id-token%'
80+
- alias: backup-instance
81+
dsn: 'bolt://localhost:7687'
82+
authentication:
83+
type: basic
84+
username: '%neo4j.backup-user%'
85+
password: '%neo4j.backup-pass%'
86+
```
87+
88+
## Testing
89+
90+
``` bash
91+
$ composer test
92+
```
93+
94+
## Example application
95+
96+
See an example application at https://github.com/neo4j-examples/movies-symfony-php-bolt (legacy project)
97+
98+
## License
99+
100+
The MIT License (MIT). Please see [License File](../LICENSE) for more information.

0 commit comments

Comments
 (0)