wunder / neo4j
    v0.0.8
    2021-08-03 06:35 UTC
Requires
- php: >7.1
- ext-bcmath: *
- ext-mbstring: *
- graphaware/neo4j-bolt: ^1.5
- graphaware/neo4j-common: ^3.4
- myclabs/php-enum: ^1.4
- php-http/client-common: ^1.0
- php-http/discovery: ^1.0
- php-http/guzzle6-adapter: ^1.0
- php-http/httplug: ^1.0
- php-http/message: ^1.0
- php-http/message-factory: ^1.0
- symfony/event-dispatcher: ^2.7 || ^3.0 || ^4.0
This package is not auto-updated.
Last update: 2025-10-22 02:41:47 UTC
README
介绍
基于swoft的neo4j数据库操作组件
安装
composer require wunder/neo4j
bean配置
'neo4j'      => [
        'class'   =>\Wunder\Neo4j\Client::class,
        'scheme'  => "http",
        'host'    => '192.168.1.100',
        'port'    => 7474,
        'username'    => 'neo4j',
        'password'    => '123456',
    ],
    'neo4j.pool' => [
        'class'  => \Wunder\Neo4j\Pool::class,
        'client' => bean('neo4j'),
        'minActive'   => 10,
        'maxActive'   => 1000,
        'maxWait'     => 0,
        'maxWaitTime' => 5,
        'maxIdleTime' => 40,
    ]
neo4j
- class: 当前配置驱动类\Wunder\Neo4j\Client::class。
- shceme: 请求方式 默认HTTP。
- hsot: 连接地址 默认127.0.0.1。
- username: 账号。
- password: 密码。
- port: 端口 默认7474。
neo4j.pool
- class 连接池驱动类 一般不用改,如果需要可以继承写成自己的 Pool 类也是可以的。
- client 指定当前连接使用的client。
- minActive 连接池需要维持的连接数。
- maxActive 连接池最大保持的连接数。
- maxWait 连接池最多等待连接数, 如果没有限制为0(默认)。
- maxWaitTime 连接最大等待时间,单位秒,如果没有限制为0(默认)。
- maxIdleTime 连接最大空闲时间,单位秒。
集群方式
'neo4j'      => [
   'class'   =>\Wunder\Neo4j\Client::class,
   'scheme'  => "http",             
   'hosts'    => [
        [
           "scheme"=>"http",          
           "host"=>"192.168.1.100",   
           "port"=>"7474",
           "username"=>"neo4j",
        ],
        [
           "scheme"=>"http",          
           "host"=>"192.168.1.200",   
           "port"=>"7474",
           "username"=>"neo4j",
        ]
    ]   
],
'neo4j.pool' => [
    'class'  => \Wunder\Neo4j\Pool::class,
    'client' => bean('neo4j'),
    'minActive'   => 10,
    'maxActive'   => 1000,
    'maxWait'     => 0,
    'maxWaitTime' => 5,
    'maxIdleTime' => 40,
]
- hsots: 多个节点配置。ps: host为必填,其他选填,默认获取单机的配置信息