lrezek / arachnid4laravel
Arachnid OGM提供者和Laravel门面。
dev-master
2015-04-09 00:51 UTC
Requires
- php: >=5.3.0
- illuminate/support: >=4.1.0
- lrezek/arachnid: dev-master
This package is not auto-updated.
Last update: 2024-09-24 04:09:53 UTC
README
这是为Laravel 4.1提供的Arachnid OGM服务提供者。
安装
将lrezek/arachnid4laravel
添加到composer.json
的要求中
{ "require": { "lrezek/arachnid4laravel": "dev-master" } }
您可能还需要添加包依赖项,具体取决于您的minimum-stability
设置
{ "require": { "everyman/neo4jphp":"dev-master", "lrezek/arachnid":"dev-master" } }
使用composer update
更新您的包或使用composer install
进行安装。
一旦Composer已更新您的包,您需要让Lavarel知道服务提供者。将以下内容添加到app/config/app.php
中的providers
'LRezek\Arachnid4Laravel\Providers\ArachnidServiceProvider',
并将门面添加到facades
'Arachnid' => 'LRezek\Arachnid4Laravel\Facades\ArachnidFacade',
注意:您可以将门面(Arachnid
)的名称改为您喜欢的任何名称。
数据库配置
Neo4J数据库配置从app/config/database.php
自动加载。要添加Neo4J连接,只需将以下内容添加到connections
参数中
'neo4j' => array( 'transport' => 'curl', 'host' => 'localhost', 'port' => '7474', 'debug' => true, 'proxy_dir' => '/tmp', 'cache_prefix' => 'neo4j', 'meta_data_cache' => 'array', 'annotation_reader' => null, 'username' => null, 'password' => null, 'pathfinder_algorithm' => null, 'pathfinder_maxdepth' => null )
并设置默认连接如下
'default' => 'neo4j',
用法
一旦完成此设置,您就可以使用实体和查询,如Arachnid中所示。要调用实体管理器中的函数,只需使用您定义的门面。例如
Arachnid::flush()