Skip to content
This repository has been archived by the owner on Dec 1, 2021. It is now read-only.

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ikwattro committed Aug 30, 2015
0 parents commit bb25c6c
Show file tree
Hide file tree
Showing 54 changed files with 5,811 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -0,0 +1 @@
vendor/
19 changes: 19 additions & 0 deletions LICENSE
@@ -0,0 +1,19 @@
Copyright (c) 2015 Christophe Willemsen

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:

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

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.
48 changes: 48 additions & 0 deletions README.md
@@ -0,0 +1,48 @@
## Neo4j Bolt PHP

PHP Driver for Neo4j's Bolt Remoting Protocol

---

### DEV MODE

This library will remain in 1.0.0-dev version until stable release of Neo4j's Bolt.

---

### Installation

Require the package in your composer dependencies :

```bash
composer require graphaware/neo4j-bolt-driver
```

Instantiate the driver by passing the host and the port to use, default port is `7687`.

```php
use GraphAware\Bolt\Driver;

$bolt = new Driver('localhost', 7687);
```

All statements need to be handled by a `Session`, getting a session is easy and will automatically trigger the
version negotiation (also called `Handshake`) :

```php
$session = $bolt->getSession();
```

Send your statements :

```php
$results = $session->run('MATCH (n:User {id: {id}}) RETURN n', array('id' => 123));
```

---

License : `MIT`

Author: `Christophe Willemsen`

---
20 changes: 20 additions & 0 deletions bench.php
@@ -0,0 +1,20 @@
<?php

require_once(__DIR__.'/vendor/autoload.php');

use Neo4j\PackStream\Session;

$session = new Session('localhost', 7687);
$version = $session->testHandShake();

$start = microtime(true);
$x = 1;
while ($x <= 1) {
echo 'Iteration ' . $x . "\n";
//$session->runQuery('MATCH (n:Person) RETURN {ids: collect(id(n)), labels: labels(n)}, 270 as x');
$session->runQuery('MATCH (n:Person) RETURN n LIMIT 2');
$x++;
}
$end = microtime(true);
$diff = $end - $start;
echo 'Query sent in ' . $diff . ' seconds';
31 changes: 31 additions & 0 deletions composer.json
@@ -0,0 +1,31 @@
{
"name": "ikwattro/neo4j-packstream-php",
"description": "Neo4j Packstream Binary Protocol PHP Driver",
"type": "library",
"license": "MIT",
"authors": [
{
"name": "Christophe Willemsen",
"email": "willemsen.christophe@gmail.com"
}
],
"require": {
"symfony/event-dispatcher": "^2.7",
"monolog/monolog": "^1.16",
"doctrine/collections": "^1.3"
},
"autoload": {
"psr-4": {
"Neo4j\\PackStream\\": "src/",
"GraphAware\\Bolt\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"GraphAware\\Bolt\\Tests\\": "tests/"
}
},
"require-dev": {
"phpunit/phpunit": "^4.8"
}
}

0 comments on commit bb25c6c

Please sign in to comment.