kbrabrand/silex-neo4j

Neo4j service provider for Silex

2.0.0 2016-12-07 15:57 UTC

This package is auto-updated.

Last update: 2024-03-15 02:49:12 UTC


README

Service provider making the Neo4j graph database accessible to your Silex application.

Build Status

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