klaussilveira / neo4j-client-bundle
此包提供了Josh Adell的Neo4jPHP库到Symfony2的简单集成
dev-master
2012-11-20 22:18 UTC
Requires
- php: >=5.3.2
- everyman/neo4jphp: >=0.1.0
This package is not auto-updated.
Last update: 2024-09-22 02:41:58 UTC
README
此包提供了Josh Adell的Neo4jPHP库到Symfony2的简单集成。它允许通过REST连接器在Neo4j图数据库内部操作数据。
安装
要安装此包,请将以下内容添加到您的项目中的composer.json
"require": { // ... "klaussilveira/neo4j-client-bundle": "dev-master", }
接下来,通过运行以下命令更新您的供应商
$ composer update
现在在内核中启用该包
<?php // app/AppKernel.php public function registerBundles() { $bundles = array( // ... new Neo4j\Client\ClientBundle\Neo4jClientBundle(), ); }
通过在config.yml中添加neo4j_client命名空间来配置该包
neo4j_client: host: 'localhost' port: 7474
恭喜!您现在可以开始在Symfony2中使用Neo4j客户端了。
基本用法
要做的只是从容器中请求neo4j.client服务以获取Everyman\Neo4j\Client实例。
<?php $client = $this->get('neo4j.client'); print_r($client->getServerInfo());