try { $exists = $db->DBExists($dbName); } catch (OrientDBException $e) { die('Failed to execute DBExists(): ' . $e->getMessage()); } if ($exists) { echo 'Deleting DB (in case of previous run failed)...' . PHP_EOL; try { $db->DBDelete($dbName); } catch (OrientDBException $e) { die('Failed to DBDelete(): ' . $e->getMessage()); } } echo 'Creating DB...' . PHP_EOL; try { $result = $db->DBCreate($dbName, OrientDB::DB_TYPE_LOCAL); echo 'Opening DB...' . PHP_EOL; $clusters = $db->DBOpen($dbName, 'writer', 'writer'); foreach ($clusters['clusters'] as $cluster) { if ($cluster->name === $clusterName) { $clusterID = $cluster->id; } } echo 'Create record...' . PHP_EOL; $record = new OrientDBRecord(); $record->data->FirstName = 'Bruce'; $record->data->LastName = 'Wayne'; $record->data->appearance = 1938; $recordPos = $db->recordCreate($clusterID, $record); echo 'Created record position: ' . $recordPos . PHP_EOL . PHP_EOL; echo 'Load record...' . PHP_EOL;