Ejemplo n.º 1
0
 /**
  * @depends testconnect
  */
 public function test_whether_cluster(SequoiaDB $sdb)
 {
     $isCluster = TRUE;
     $snapshot = $sdb->getSnapshot(SDB_SNAP_DATABASE);
     $array = $sdb->getError();
     $this->assertEquals(0, $array['errno']);
     $record = $snapshot->getNext();
     if (array_key_exists("Role", $record)) {
         $isCluster = false;
     } else {
         $isCluster = true;
     }
     return $isCluster;
 }
Ejemplo n.º 2
0
         echo "<br><br>";
     }
     // if $cl
     echo '<p>23. delete collection space</p>';
     // delete collection
     var_dump($cs->drop());
     echo "<br><br>";
 }
 // if $cs
 echo '<p>24. reset snapshot</p>';
 // reset Snapshot
 var_dump($sdb->resetSnapshot());
 echo "<br><br>";
 echo '<p>25. get snapshot</p>';
 // reset Snapshot
 $sdb_cursor = $sdb->getSnapshot(SDB_SNAP_DATABASE);
 if ($sdb_cursor) {
     while ($arr = $sdb_cursor->getNext()) {
         var_dump($arr);
         echo "<br><br>";
     }
 }
 echo '<p>26. get list</p>';
 // reset Snapshot
 $sdb_cursor = $sdb->getList(SDB_LIST_STORAGEUNITS);
 if ($sdb_cursor) {
     while ($arr = $sdb_cursor->getNext()) {
         var_dump($arr);
         echo "<br><br>";
     }
 }
Ejemplo n.º 3
0
     if ($cursor) {
         $cursor->getNext();
         var_dump($cursor->updateCurrent($rule));
     }
 } else {
     if ($work == "del_current") {
         $cs = $sequoia_db->selectCS($space);
         $cl = $cs->selectCollection($collectname);
         $cursor = $cl->find($condition, $selected, $orderBy, $hint, $numToSkip, $numToReturn);
         if ($cursor) {
             $cursor->getNext();
             var_dump($cursor->deleteCurrent());
         }
     } else {
         if ($work == "getSnapshot") {
             $cursor = $sequoia_db->getSnapshot($listType, $condition, $selected, $orderBy);
             if ($cursor) {
                 //$cursor->install ( array ( "install"=>false ) ) ;
                 while ($srt = $cursor->getNext()) {
                     var_dump($srt);
                     echo "<br />";
                 }
             }
         } else {
             if ($work == "resetSnapshot") {
                 var_dump($sequoia_db->resetSnapshot());
             } else {
                 if ($work == "getList") {
                     $cursor = $sequoia_db->getList($listType, $condition, $selected, $orderBy);
                     if ($cursor) {
                         while ($srt = $cursor->getNext()) {