Esempio n. 1
0
     }
     echo "\n";
     foreach (get_object_vars($row) as $k => $v) {
         echo str_pad(substr($v, 0, 12), 12);
     }
     echo "\n";
     break;
 case 'parent':
     if (!$collection) {
         echo "Error: no collection in use.\n";
         break;
     } elseif (!$input[1]) {
         echo "Error: no node ID specified.\n";
         break;
     }
     $res = $ns->parent($input[1]);
     if (!$res) {
         echo 'Error: ' . $ns->error . "\n";
         break;
     }
     echo $res->id . "\n";
     break;
 case 'isParent':
     if (!$collection) {
         echo "Error: no collection in use.\n";
         break;
     } elseif (!$input[1]) {
         echo "Error: no parent ID specified.\n";
         break;
     } elseif (!$input[2]) {
         echo "Error: no node ID specified.\n";