-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathneo4j.php
executable file
·37 lines (33 loc) · 958 Bytes
/
neo4j.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
$module = 'neo4j';
if (extension_loaded($module)) {
echo "Module $module is compiled into PHP\n";
//$con = new neo4j('localhost','7474','root:root');
$con = new neo4j('localhost','7474','root:blue@shopinterest');
$con->createNode(array('name'=>'n1','type'=>'a'));
$con->createNode(array('name'=>'n2','type'=>'b'));
$con->createNode(array('name'=>'n3','type'=>'a'));
$data = $con->query('type:a');
var_dump($data);
}
/*
$neo4j = new neo4j('localhost','7474','root:blue@shopinterest');
echo "GetNode ",getNode($neo4j),"ms<br>";
echo "getRelationship ",getRelationship($neo4j),"ms<br>";
function getNode($neo4j){
$time = 10000;
$start = microtime(true);
while($time--){
$data = $neo4j->getNode(0)->getAllProperties();
}
return microtime(true)-$start;
}
function getRelationship($neo4j){
$time = 10000;
$start = microtime(true);
while($time--){
$neo4j->getRelationship(0);
}
return microtime(true)-$start;
}
*/