git 專案網址 church/neo4j:https://github.com/fireqong/neo4j
介紹
#基於PHP的neo4j庫,可以幫助你更方便的連接neo4j的PHP庫,源文檔鏈接地址 neo4j http api:https://neo4j.com/docs/http-api/current/actions/
安裝環境需求
PHP >= 7.4
#
composer require church/neo4j
##用法
初始化$app = new \Church\Neo4j\Application("http://127.0.0.1:7474", "neo4j", "neo4j"); $app->discovery();
$statement = (new \Church\Neo4j\Statement('CREATE (n $props) RETURN n)'))->params([ 'props' => [ 'name' => 'test' ] ]);
$statements = \Church\Neo4j\StatementRepository::add($statement); $transaction = $app->transaction($statements); $transaction->begin();
$result = $transaction->commit(); if ($result->getRawResponse()->getStatusCode() == 200) { print_r($result->getData()); }
default expiry time is 60 seconds.$transaction->keepAlive();
$transaction->rollback();
$result = $transaction->beginAndCommit();print_r($result);
composer install ./vendor/bin/phpunit
以上是分享一個neo4j(圖形資料庫)的PHP庫!的詳細內容。更多資訊請關注PHP中文網其他相關文章!