2017 © Pedro Peláez
 

symfony-bundle doctrine2-orientdb-restful-driver

Doctrine2 PHP RESTful driver for OrientDB graph database.

image

yapro/doctrine2-orientdb-restful-driver

Doctrine2 PHP RESTful driver for OrientDB graph database.

  • Wednesday, June 11, 2014
  • by Lebnik
  • Repository
  • 3 Watchers
  • 5 Stars
  • 24 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Doctrine2 RESTful-driver for OrientDB

System requirements

Install orientDB v.1.7 from branch develop. Last cheked this version on:, (*1)

commit 4f3aba5faa6a404367aea41e3fbab3dbe7c06da4
Author: enisher <enisher@gmail.com>
Date:   Thu May 15 23:33:51 2014 +0300

To work with database, you must perform actions described below., (*2)

Start the database (complete path):, (*3)

$ /var/www/orientDB/bin/server.sh

if you receive an error:, (*4)

java: command not found

install java, example java 1.7.0_45. You can confirm the version command:, (*5)

$ java -version

Setup

1) In file /app/config/config.yml replace string:, (*6)

driver:   %database_driver%

on this string:, (*7)

driver_class:   OrientDB\Driver

2) Change you settings for connect to database in file:, (*8)

/app/config/parameters.yml

for example default settings:, (*9)

parameters:
    database_driver: pdo_mysql
    database_host: localhost
    database_port: 2480
    database_name: GratefulDeadConcerts
    database_user: admin
    database_password: admin
    mailer_transport: smtp
    mailer_host: 127.0.0.1
    mailer_user: null
    mailer_password: null
    locale: en
    secret: ThisTokenIsNotSoSecretChangeIt

3) Add following code into your composer.json, (*10)

      "require": {
          ...
          "yapro/doctrine2-orientdb-restful-driver": "dev-master"
      },

and run command:, (*11)

$ composer update yapro/doctrine2-orientdb-restful-driver --prefer-source

All ready., (*12)

How use it

1) Create you entities classes (php files) with PHPDoc annotations for field rid, example:, (*13)

/**
 * @ORM\Id
 * @ORM\Column(type="bigint", name="@rid")
 * @ORM\GeneratedValue(strategy="IDENTITY")
 */
private $rid = 0;

2) Run console command for create/update you entities:, (*14)

$ php app/console doctrine:schema:update --force

If you delete entity class, this command not delete class(table) in OrientDB. If you need this action, please delete class(table) in OrientDB with command:, (*15)

orientdb {YouDatabase}> drop class YouEntityName

UnitTest

You can check you fix (or features) with next command:, (*16)

$ bin/phpunit -c app vendor/yapro/doctrine2-orientdb-restful-driver/Tests/Crud.php --env=dev

Help

You Entity Schemas, Doctrine getting and compare in \Doctrine\ORM\Tools\SchemaTool::getUpdateSchemaSql, (*17)

$fromSchema - schemas from you database

$toSchema - schemas from you classes

If there is a desire to practice with queries, connect the console client to the database:, (*18)

$ /var/www/orientDB/bin/console.sh

orientdb> connect remote:localhost root You_password ( from file config/orientdb-server-config.xml )

If you are in console client and created class(table) in OrientDB with RESTful driver, you may need to see this update in orientDB console. For this action, please run:, (*19)

orientdb {YouDatabase}> reload schema

and than:, (*20)

orientdb {YouDatabase}> info

The Versions

11/06 2014

dev-master

9999999-dev http://github.com/yapro/doctrine2-orientdb-restful-driver

Doctrine2 PHP RESTful driver for OrientDB graph database.

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

restful driver doctrine2 orientdb