dongritan5654 2017-09-20 10:45
浏览 124
已采纳

如何将GraphAware Library添加到项目中

I am creating a project in php and want to configure it with my Neo4j graph data. Here is the code:

<?php
require_once '/path/to/Client.php';
use GraphAware\Neo4j\Client; 
use GraphAware\Neo4j\Client\ClientBuilder;
$client = new GraphAware\Neo4j\Client('http://127.0.0.1:7474/');

$client = ClientBuilder::create()
->addConnection('default', 'http://neo4j:password@127.0.0.1:7474')
->addConnection('bolt', 'bolt://neo4j:password@127.0.0.1:7474')
->build();  

so you can see that the library I am trying to use in GraphAware. I cannot get this library to work as I do not have it. Can someone please let me know how I can get this library in my php project which I am creating in eclipse.

  • 写回答

2条回答 默认 最新

  • douzhuo6931 2017-09-20 10:50
    关注

    As per the documentation, you use Composer to require it into your project.

    https://github.com/graphaware/neo4j-php-client#installation

    composer require graphaware/neo4j-php-client:^4.0
    

    Don't have composer? It's well worth installing, manages dependencies and autoloading, and all you need to do to get it working with any PHP project is to add this line pretty much at the start point of your script (index.php?)

    require_once 'vendor/autoload.php`
    

    Get Composer here https://getcomposer.org/

    The lame non-composer way is just download the Zip from github and dump it in your project. But you'll need to require in all the classes you use!

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?