Service provider making the Neo4j graph database accessible to your Silex application.
Add "kbrabrand/silex-neo4j": "XXX"
to the composer.json file inside your project and do a composer install
. Check Composer for the latest available version.
Register the Neo4j service provider in your Silex app like this;
$app->register(new Neo4jServiceProvider(), array(
'neo4j.transport' => 'localhost', // Hostname as string, or Everyman\Neo4j\Transport object
'neo4j.port' => 7474, // Port number, ignored if transport is not a string
));
After registering the Neo4j service provider, the Everyman\Neo4j\Client instance can be accessed from the $app
variable like this;
$node = $app['neo4j']->getNode(123);
The service provider comes with PHPUnit tests and can be run by doing a ./vendor/phpunit/phpunit/phpunit
inside the silex-neo4j folder.
License Copyright (c) 2014, Kristoffer Brabrand [email protected]
Licensed under the MIT License