承接 graphaware/neo4j-bolt 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

graphaware/neo4j-bolt

最新稳定版本:1.11.0

Composer 安装命令:

composer require graphaware/neo4j-bolt

包简介

Neo4j Bolt Binary Protocol PHP Driver

README 文档

README

PHP low level Driver for Neo4j's Bolt Remoting Protocol

Build Status

References :

Requirements:

  • PHP5.6+
  • Neo4j3.0
  • PHP Sockets extension available
  • bcmath extension
  • mbstring extension

Installation

Require the package in your dependencies :

composer require graphaware/neo4j-bolt

Setting up a driver and creating a session

use GraphAware\Bolt\GraphDatabase; $driver = GraphDatabase::driver("bolt://localhost"); $session = $driver->session();

Sending a Cypher statement

$session = $driver->session(); $session->run("CREATE (n)"); $session->close(); // with parameters : $session->run("CREATE (n) SET n += {props}", ['name' => 'Mike', 'age' => 27]);

Empty Arrays

Due to lack of Collections types in php, there is no way to distinguish when an empty array should be treated as equivalent Java List or Map types.

Therefore you can use a wrapper around arrays for type safety :

use GraphAware\Common\Collections; $query = 'MERGE (n:User {id: {id} })   WITH n  UNWIND {friends} AS friend  MERGE (f:User {id: friend.name})  MERGE (f)-[:KNOWS]->(n)'; $params = ['id' => 'me', 'friends' => Collections::asList([])]; $this->getSession()->run($query, $params); // Or $query = 'MERGE (n:User {id: {id} })   WITH n  UNWIND {friends}.users AS friend  MERGE (f:User {id: friend.name})  MERGE (f)-[:KNOWS]->(n)'; $params = ['id' => 'me', 'friends' => Collections::asMap([])]; $this->getSession()->run($query, $params);

TLS Encryption

In order to enable TLS support, you need to set the configuration option to REQUIRED, here an example :

$config = \GraphAware\Bolt\Configuration::newInstance() ->withCredentials('bolttest', 'L7n7SfTSj0e6U') ->withTLSMode(\GraphAware\Bolt\Configuration::TLSMODE_REQUIRED); $driver = \GraphAware\Bolt\GraphDatabase::driver('bolt://hobomjfhocgbkeenl.dbs.graphenedb.com:24786', $config); $session = $driver->session();

License

Copyright (c) 2015-2016 GraphAware Ltd

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.

统计信息

  • 总下载量: 744.75k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 44
  • 点击次数: 3
  • 依赖项目数: 7
  • 推荐数: 0

GitHub 信息

  • Stars: 43
  • Watchers: 22
  • Forks: 23
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固