if (($testdr->sac_status >= 200) || ($testdr->sac_status < 300)) {
        $testdr->toString();
    }

   print "\n\n";
}
*/
if (false) {
    print "About to delete container at " . $edit_iri . "\n";
    if (empty($testuser)) {
        print "As: anonymous\n";
    } else {
        print "As: " . $testuser . "\n";
    }
    try {
        $deleteresponse = $testsac->deleteContainer($edit_iri, $testuser, $testpw, $testobo);
        print " - Container successfully deleted, HTTP code 204\n";
    } catch (Exception $e) {
        echo $e->getMessage();
    }
    print "\n\n";
}
if (false) {
    print "About to deposit atom entry (" . $testatomentry . ") to " . $testdepositurl . "\n";
    if (empty($testuser)) {
        print "As: anonymous\n";
    } else {
        print "As: " . $testuser . "\n";
    }
    $testdr = $testsac->depositAtomEntry($testdepositurl, $testuser, $testpw, $testobo, $testatomentry, false);
    print "Received HTTP status code: " . $testdr->sac_status . " (" . $testdr->sac_statusmessage . ")\n";
Ejemplo n.º 2
0
<?php

// Load the PHP library
include_once '../../../../swordappclient.php';
include_once '../../utils.php';
// Store the values
session_start();
// Try and delete the edit-iri package
$client = new SWORDAPPClient();
$response = $client->deleteContainer($_POST['editiri'], $_SESSION['u'], $_SESSION['p'], $_SESSION['obo']);
if ($response->sac_status != 204) {
    $error = 'Unable to delete container. HTTP response code: ' . $response->sac_status;
} else {
    $_SESSION['error'] = '';
}
?>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title>SWORD v2 exerciser - DELETE a container</title>
        <link rel='stylesheet' type='text/css' media='all' href='../../css/style.css' />
    </head>
    <body>

        <div id="header">
            <h1>SWORD v2 exerciser</h1>
        </div>

        <div class="section">
            <h2>Response:</h2>
            <pre>Status code: <?php