使用neo4jphp.phar时,在neo4jphp中找不到关系类

时间:2013-05-09 12:33:11

标签: neo4j

在本地计算机上运行neo4jphp / neo4jphp.phar时,似乎Noe4j - 1.9.RC2正常工作。此外,Web界面可用。

运行命令时(下方)

$arthurOutgoingRelationships = $arthur->getRelationships(array(),     Relationship::DirectionOut);

,我正在

PHP Fatal error:  Class 'Relationship' not found in /var/www/index.php

在Apache错误日志中。我下载了最新版本的neo4jphp并注册了自动加载器:

spl_autoload_register(function ($className) {
  $libPath = '/var/www/neo4jphp/lib/';
  $classFile = str_replace('\\',DIRECTORY_SEPARATOR,$className).'.php';
  $classPath = $libPath.$classFile;
  if (file_exists($classPath)) {
     require($classPath);
  }
});

1 个答案:

答案 0 :(得分:1)

您可以通过从GitHub下载库来解决此问题,将Everyman文件夹及其子文件夹复制到根目录中并使用您需要的内容。例如

    require("phar://neo4jphp.phar");
    use Everyman\Neo4j\Relationship;