This repository has been archived by the owner on Dec 1, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit bb25c6c
Showing
54 changed files
with
5,811 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
vendor/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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` | ||
|
||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" | ||
} | ||
} |
Oops, something went wrong.