PHP code example of sgpatil / orientdb-php

1. Go to this page and download the library: Download sgpatil/orientdb-php library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

sgpatil / orientdb-php example snippets



$client = new Sgpatil\Orientphp\Client(<server>, <port>, <database_name>);

$client->getTransport()
       ->setAuth(<database_user_name>, <database_password>);


$client = new Sgpatil\Orientphp\Client("localhost", 2480, <database_name>);

$client->getTransport()
       ->setAuth('root', 'root');

print_r($client->getServerInfo());

 $user = $client->makeClass("User", function($property){
        $property->string("name");
        $property->integer("age");
        $property->timestamp("datetime");
    })->save();
json
{
    "gpatil/orientdb-php": "dev-master"
    }
}