我這就給我的機器上一試,我至少得到一個迴應的,我發送請求:
<?php
require('vendor/autoload.php');
use Everyman\Neo4j\Cypher\Query;
$client = new Everyman\Neo4j\Client('localhost', 7534);
$queryString = "MATCH (p:Person) RETURN p LIMIT 1";
$query = new Everyman\Neo4j\Cypher\Query($client, $queryString);
$result = $query->getResultSet();
foreach ($result as $row) {
echo $row['p']->getProperty('name') . "\n";
}
,然後當我運行,這是我的輸出中所看到的的ngrep: T 127.0.0.1:55145 -> 127.0.0.1:7534 [AP] POST /db/data/cypher HTTP/1.1..Host: localhost:7534..Accept: application/json;stream=true..Content-type: application/json..User-Agent: neo4jphp/0.1.0..X-Stream: true..Content -Length: 45....{"query":"MATCH (p:Person) RETURN p LIMIT 1"} ## T 127.0.0.1:7534 -> 127.0.0.1:55145 [AP] HTTP/1.1 200 OK..Content-Type: application/json; charset=UTF-8; stream=true..Access-Control-Allow- Origin: *..Transfer-Encoding: chunked..Server: Jetty(9.0.5.v20130815)....486 ..{"columns":["p"],"data":[[{"extensions":{},"outgoing_relationships":"http://localhost:7534/db/data/node/1/relationships/out","labels":"http://localhost:7534/db/data/node/1/ labels","traverse":"http://localhost:7534/db/data/node/1/traverse/{returnType}","all_typed_relationsh ips":"http://localhost:7534/db/data/node/1/relationships/all/{-list|&|typ es}","self":"http://localhost:7534/db/data/node/1","property":"http://localhost:7534/db/data/node/1/properties/{key}","properties":"http://localhost:7534/db/data/node/1/prope rties","outgoing_typed_relationships":"http://localhost:7534/db/data/node/1/relationships/out/{-list|&|types}","incoming_relationships":"http://localhost:7534/db/data/node/1/ relationships/in","create_relationship":"http://localhost:7534/db/data/node/1/relationships","paged_t raverse":"http://localhost:7534/db/data/node/1/paged/traverse/{returnType }{? pageSize,leaseTime}","all_relationships":"http://localhost:7534/db/data/node/1/relationships/all","in coming_typed_relationships":"http://localhost:7534/db/data/node/1/rela tionships/in/{-list|&|types}","metadata":{"id":1,"labels":["Person"]},"data": {"born":1964,"name":"Keanu Reeves"}}]]} #####################
我有什麼對你有什麼不同?