Giter Club home page Giter Club logo

neo4j-symfony's Introduction

Neo4j Symfony Bundle

Latest Version Build Status Code Coverage Quality Score Total Downloads

Install

Via Composer

$ composer require neo4j/neo4j-bundle

If you want to use the an EntityManager you need to install a GraphAware OGM

$ composer require graphaware/neo4j-php-ogm:@rc

Enable the bundle in your kernel:

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Neo4j\Neo4jBundle\Neo4jBundle(),
    );
}

Documentation

The bundle is a convenient way of registering services. We register Connections, Clients and EntityManagers. You will always have alias for the default services:

  • neo4j.connection
  • neo4j.client
  • neo4j.entity_manager.*

Minimal configuration

neo4j:
  connections:
    default: ~

With the minimal configuration we have services named:

  • neo4j.connection.default
  • neo4j.client.default
  • neo4j.entity_manager.default*

Full configuration

neo4j:
  profiling: 
    enabled: true
  connections:
    default:
      scheme: bolt # default (must be either "http" or "bolt")
      host: localhost # default
      port: 7474 # optional, will be set to the proper driver's default port if not provided
      username: neo4j # default
      password: neo4j # default
    second_connection:
      username: foo
      password: bar
    third_connection:
      dsn: 'bolt://foo:bar@localhost:7687'
  clients:
    default:
      connections: [default, second_connection, third_connection]
    other_client:
      connections: [second_connection]
    foobar: ~ # foobar client will have the "default" connection
  entity_managers:
    default: 
      client: other_client # defaults to "default"
      cache_dir: "%kernel.cache_dir%/neo4j" # defaults to system cache

With the configuration above we would have services named:

  • neo4j.connection.default
  • neo4j.connection.second_connection
  • neo4j.client.default
  • neo4j.client.other_client
  • neo4j.client.other_foobar
  • neo4j.entity_manager.default*

* Note: EntityManagers will only be available if graphaware/neo4j-php-ogm is installed.

Testing

$ composer test

Example application

See an example application at https://github.com/neo4j-examples/movies-symfony-php-bolt

License

The MIT License (MIT). Please see License File for more information.

neo4j-symfony's People

Contributors

aliel avatar angelov avatar florinmotoc avatar ikwattro avatar nyholm avatar spolischook avatar theum avatar tnajanssen avatar xavismeh avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.