2017 © Pedro Peláez
 

library neo4j-bolt

Neo4j Bolt Binary Protocol PHP Driver

image

graphaware/neo4j-bolt

Neo4j Bolt Binary Protocol PHP Driver

  • Tuesday, December 12, 2017
  • by ikwattro
  • Repository
  • 12 Watchers
  • 30 Stars
  • 290,980 Installations
  • PHP
  • 5 Dependents
  • 0 Suggesters
  • 6 Forks
  • 4 Open issues
  • 52 Versions
  • 5 % Grown

The README.md

THIS REPOSITORY IS ARCHIVED., (*1)

Please head to http://github.com/neo4j-php or http://neo4j.com/developer/php for up-to-date PHP support for Neo4j., (*2)


Neo4j Bolt PHP

PHP low level Driver for Neo4j's Bolt Remoting Protocol, (*3)

Build Status, (*4)


References :

  • PHP Client embedding Bolt along with the http driver (recommended way of using Neo4j in PHP) : https://github.com/graphaware/neo4j-php-client
  • Neo4j 3.0 : http://neo4j.com/docs

Requirements:

  • PHP5.6+
  • Neo4j3.0
  • PHP Sockets extension available
  • bcmath extension
  • mbstring extension

Installation

Require the package in your dependencies :, (*5)

composer require graphaware/neo4j-bolt

Setting up a driver and creating a session


use GraphAware\Bolt\GraphDatabase; $driver = GraphDatabase::driver("bolt://localhost"); $session = $driver->session();

Sending a Cypher statement

$session = $driver->session();
$session->run("CREATE (n)");
$session->close();

// with parameters :

$session->run("CREATE (n) SET n += {props}", ['name' => 'Mike', 'age' => 27]);

Empty Arrays

Due to lack of Collections types in php, there is no way to distinguish when an empty array should be treated as equivalent Java List or Map types., (*6)

Therefore you can use a wrapper around arrays for type safety :, (*7)

use GraphAware\Common\Collections;

        $query = 'MERGE (n:User {id: {id} }) 
        WITH n
        UNWIND {friends} AS friend
        MERGE (f:User {id: friend.name})
        MERGE (f)-[:KNOWS]->(n)';

        $params = ['id' => 'me', 'friends' => Collections::asList([])];
        $this->getSession()->run($query, $params);

// Or

        $query = 'MERGE (n:User {id: {id} }) 
        WITH n
        UNWIND {friends}.users AS friend
        MERGE (f:User {id: friend.name})
        MERGE (f)-[:KNOWS]->(n)';

        $params = ['id' => 'me', 'friends' => Collections::asMap([])];
        $this->getSession()->run($query, $params);

TLS Encryption

In order to enable TLS support, you need to set the configuration option to REQUIRED, here an example :, (*8)

$config = \GraphAware\Bolt\Configuration::newInstance()
    ->withCredentials('bolttest', 'L7n7SfTSj0e6U')
    ->withTLSMode(\GraphAware\Bolt\Configuration::TLSMODE_REQUIRED);

$driver = \GraphAware\Bolt\GraphDatabase::driver('bolt://hobomjfhocgbkeenl.dbs.graphenedb.com:24786', $config);
$session = $driver->session();

License

Copyright (c) 2015-2016 GraphAware Ltd, (*9)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:, (*10)

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software., (*11)

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE., (*12)


The Versions

12/12 2017

dev-master

9999999-dev

Neo4j Bolt Binary Protocol PHP Driver

  Sources   Download

MIT

The Requires

 

The Development Requires

12/12 2017

1.11.0

1.11.0.0

Neo4j Bolt Binary Protocol PHP Driver

  Sources   Download

MIT

The Requires

 

The Development Requires

09/06 2017

1.10.0

1.10.0.0

Neo4j Bolt Binary Protocol PHP Driver

  Sources   Download

MIT

The Requires

 

The Development Requires

09/06 2017

dev-collections

dev-collections

Neo4j Bolt Binary Protocol PHP Driver

  Sources   Download

MIT

The Requires

 

The Development Requires

16/05 2017

1.9.2

1.9.2.0

Neo4j Bolt Binary Protocol PHP Driver

  Sources   Download

MIT

The Requires

 

The Development Requires

16/05 2017

dev-fix/marker-d6

dev-fix/marker-d6

Neo4j Bolt Binary Protocol PHP Driver

  Sources   Download

MIT

The Requires

 

The Development Requires

27/02 2017

1.9.1

1.9.1.0

Neo4j Bolt Binary Protocol PHP Driver

  Sources   Download

MIT

The Requires

 

The Development Requires

23/02 2017

1.9.0

1.9.0.0

Neo4j Bolt Binary Protocol PHP Driver

  Sources   Download

MIT

The Requires

 

The Development Requires

20/02 2017

1.8.3

1.8.3.0

Neo4j Bolt Binary Protocol PHP Driver

  Sources   Download

MIT

The Requires

 

The Development Requires

15/02 2017

1.8.2

1.8.2.0

Neo4j Bolt Binary Protocol PHP Driver

  Sources   Download

MIT

The Requires

 

The Development Requires

15/02 2017

1.8.1

1.8.1.0

Neo4j Bolt Binary Protocol PHP Driver

  Sources   Download

MIT

The Requires

 

The Development Requires

16/10 2016

1.8.0

1.8.0.0

Neo4j Bolt Binary Protocol PHP Driver

  Sources   Download

MIT

The Requires

 

The Development Requires

10/10 2016

1.7.1

1.7.1.0

Neo4j Bolt Binary Protocol PHP Driver

  Sources   Download

MIT

The Requires

 

The Development Requires

30/09 2016

1.7.0

1.7.0.0

Neo4j Bolt Binary Protocol PHP Driver

  Sources   Download

MIT

The Requires

 

The Development Requires

30/09 2016

dev-ssl

dev-ssl

Neo4j Bolt Binary Protocol PHP Driver

  Sources   Download

MIT

The Requires

 

The Development Requires

27/08 2016

1.6.1

1.6.1.0

Neo4j Bolt Binary Protocol PHP Driver

  Sources   Download

MIT

The Requires

 

The Development Requires

14/07 2016

1.6.0

1.6.0.0

Neo4j Bolt Binary Protocol PHP Driver

  Sources   Download

MIT

The Requires

 

The Development Requires

08/07 2016

1.5.8

1.5.8.0

Neo4j Bolt Binary Protocol PHP Driver

  Sources   Download

MIT

The Requires

 

The Development Requires

06/06 2016

1.5.7

1.5.7.0

Neo4j Bolt Binary Protocol PHP Driver

  Sources   Download

MIT

The Requires

 

The Development Requires

24/05 2016

55.x-dev

55.9999999.9999999.9999999-dev

Neo4j Bolt Binary Protocol PHP Driver

  Sources   Download

MIT

The Requires

 

The Development Requires

20/05 2016

1.5.6

1.5.6.0

Neo4j Bolt Binary Protocol PHP Driver

  Sources   Download

MIT

The Requires

 

The Development Requires

16/05 2016

1.5.5

1.5.5.0

Neo4j Bolt Binary Protocol PHP Driver

  Sources   Download

MIT

The Requires

 

The Development Requires

16/05 2016

1.5.4

1.5.4.0

Neo4j Bolt Binary Protocol PHP Driver

  Sources   Download

MIT

The Requires

 

The Development Requires

13/05 2016

1.5.3

1.5.3.0

Neo4j Bolt Binary Protocol PHP Driver

  Sources   Download

MIT

The Requires

 

The Development Requires

13/05 2016

1.5.2

1.5.2.0

Neo4j Bolt Binary Protocol PHP Driver

  Sources   Download

MIT

The Requires

 

The Development Requires

10/05 2016

1.5.1

1.5.1.0

Neo4j Bolt Binary Protocol PHP Driver

  Sources   Download

MIT

The Requires

 

The Development Requires

07/05 2016

1.5.0

1.5.0.0

Neo4j Bolt Binary Protocol PHP Driver

  Sources   Download

MIT

The Requires

 

The Development Requires

03/05 2016

1.4.2

1.4.2.0

Neo4j Bolt Binary Protocol PHP Driver

  Sources   Download

MIT

The Requires

 

The Development Requires

03/05 2016

1.4.1

1.4.1.0

Neo4j Bolt Binary Protocol PHP Driver

  Sources   Download

MIT

The Requires

 

The Development Requires

21/01 2016