public static function releaseConn(RODSConn $conn)
 {
     $manager = $GLOBALS['RODSConnManager'];
     $conn_sig = $conn->getSignature();
     //echo "id:".$conn->getId()." ".implode(",",array_keys($manager->conn_map[$conn_sig]))."<br/>\n";
     if (isset($manager->conn_map[$conn_sig][$conn->getId()])) {
         $manager->conn_map[$conn_sig][$conn->getId()]->unlock();
     }
 }
$home_dir_str = '/tempZone/home/rods';
try {
    echo "--- trying to connect --- " . microtime() . " <br/>\n";
    $conn = RODSConnManager::getConn($account);
    echo "--- trying temp password #1 --- " . microtime() . " <br/>\n";
    $key = $conn->connect();
    $key = $conn->getKeyForTempPassword();
    echo "key = {$key} <br/> \n";
    $temppass = $conn->getTempPassword($key);
    echo "temppass = {$temppass} <br/> \n";
    $account2 = clone $account;
    $account2->pass = $temppass;
    echo "--- trying to connect with temp password--- " . microtime() . " <br/>\n";
    $conn2 = new RODSConn($account2);
    $conn2->connect();
    echo "--- temp password #1 passed --- " . microtime() . " <br/>\n";
    echo "--- trying temp password #2 --- " . microtime() . " <br/>\n";
    $temppass = $account->getTempPassword();
    echo "temppass#2 = {$temppass} <br/> \n";
    $account2 = clone $account;
    $account2->pass = $temppass;
    echo "--- trying to connect with temp password #2 --- " . microtime() . " <br/>\n";
    $conn2 = new RODSConn($account2);
    $conn2->connect();
    echo "--- temp password #2 passed --- " . microtime() . " <br/>\n";
    echo "--- test successful! --- " . microtime() . " <br/>\n";
} catch (RODSException $e) {
    echo "--- test failed! --- " . microtime() . " <br/>\n";
    echo $e;
    echo $e->showStackTrace();
}
<?php

require_once "../src/Prods.inc.php";
$account = new RODSAccount("localhost", 1247, "rods", "rods", "tempZone");
$rule_body = "printHello||print_hello|nop";
$input_params = array();
$out_params = array('ruleExecOut');
try {
    $start_time = microtime(true);
    $conn = new RODSConn($account);
    $conn->connect();
    $results = $conn->execUserRule($rule_body, $input_params, $out_params);
    var_dump($results);
    $conn->disconnect();
    $rule = new ProdsRule($account, $rule_body, $input_params, $out_params);
    $results = $rule->execute();
    var_dump($results);
    $end_time = microtime(true);
    $exec_time = $end_time - $start_time;
    echo "--- test successful!  in ({$exec_time} sec) --- <br/>\n";
} catch (RODSException $e) {
    echo "--- test failed! --- <br/>\n";
    echo $e;
    echo $e->showStackTrace();
}
 public function dirExists($dir)
 {
     parent::dirExists($dir);
 }
示例#5
0
} else {
    echo "Error: RODS URI expected but not found!";
    exit(0);
}
$collection = ProdsDir::fromURI($ruri, false);
if (empty($collection->account->pass)) {
    $acct = $_SESSION['acct_manager']->findAcct($collection->account);
    if (empty($acct)) {
        echo "Error: RODS URI expected but not found!";
        exit(0);
    }
    $collection->account = $acct;
}
$resources_json = "";
try {
    $conn = new RODSConn($collection->account);
    $conn->connect();
    $resources = $conn->getResources();
    $resources_arr_no_keys = array();
    foreach ($resources as $resource) {
        $resources_arr_no_keys[] = array_values($resource);
    }
    $resources_with_status = array("success" => true, "total_count" => count($resources), "que_results" => $resources_arr_no_keys);
    $resources_json = json_encode($resources_with_status);
    $conn->disconnect();
} catch (Exception $e) {
    $response = array('success' => false, 'error' => $e->getMessage());
    $resources_json = json_encode($response);
}
?>