kbrabrand / silex-neo4j
Neo4j service provider for Silex
Installs: 1 296
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 3
Open Issues: 0
Requires
- php: >=5.5.9
- everyman/neo4jphp: dev-master
- silex/silex: ~2.0
Requires (Dev)
- fabpot/php-cs-fixer: *
- phpunit/phpunit: ~4.0
README
Service provider making the Neo4j graph database accessible to your Silex application.
Installation
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.
Setup instructions
Register the Neo4j service provider in your Silex app like this;
use KBrabrand\Silex\Provider\Neo4jServiceProvider; $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 ));
Usage
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);
Tests
The service provider comes with PHPUnit tests and can be run by doing a ./vendor/phpunit/phpunit/phpunit
inside the silex-neo4j folder.
License
License Copyright (c) 2014, Kristoffer Brabrand kristoffer@brabrand.no
Licensed under the MIT License