sgpatil/orientdb-php
最新稳定版本:v0.0.3
Composer 安装命令:
composer require sgpatil/orientdb-php
包简介
PHP Wrapper for the Orientdb database (REST)
README 文档
README
Author: Sumit Patil sgpatil.2803@gmail.com
Copyright (c) 2014-2015
PHP Wrapper for the Orientdb graph database REST interface
Installation
Add the package to your composer.json
{
"require": {
"sgpatil/orientdb-php": "dev-master"
}
}
Connection
$client = new Sgpatil\Orientphp\Client(<server>, <port>, <database_name>); $client->getTransport() ->setAuth(<database_user_name>, <database_password>);
If you are using default configuration then the code should be
$client = new Sgpatil\Orientphp\Client("localhost", 2480, <database_name>); $client->getTransport() ->setAuth('root', 'root');
To check database connection.
print_r($client->getServerInfo());
This will display server information.
Create Class
$user = $client->makeClass("User", function($property){ $property->string("name"); $property->integer("age"); $property->timestamp("datetime"); })->save();
Supporting Datatype
| Commands |
|---|
| $property->short('<field_name>'); |
| $property->integer('<field_name>'); |
| $property->long('<field_name>'); |
|
|$property->byte('<field_name>');
|$property->boolean('<field_name>');
|
|$property->float('<field_name>');
|$property->double('<field_name>');
|
|$property->datetime('<field_name>');
|$property->date('<field_name>');
|$property->timestamp('<field_name>');
|
|$property->string('<field_name>');
|$property->binary('<field_name>');
|
|$property->embedded('<field_name>');
|$property->embeddedlist('<field_name>');
|$property->embeddedset('<field_name>');
|
|$property->link('<field_name>');
|$property->linklist('<field_name>');
|$property->linkset('<field_name>');
|$property->linkmap('<field_name>');
|$property->linkbag('<field_name>');
|
|$property->custom('<field_name>');
|$property->any('<field_name>');
统计信息
- 总下载量: 577
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 0
- 依赖项目数: 4
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-04-16