SWORD PHP Library version 0.7 released

I have just released version 0.7 of the SWORD PHP library. It can be downloaded from http://php.swordapp.org/

This latest version adds two new features:

To show how easy it is to use the library, see the following code which requests a service document, creates a package, and then deposits it:

// Import the library
require('swordappclient.php');

// Create an instance of the client
$sac = new SWORDAPPClient();

// Request a service document
$sdr = $sac->servicedocument($url, $user, $password, $onbehalfof);

// Import the packager library
require('packager_mets_swap.php');

// Create a new package with the root and directory of the input files, and the root and directory of the package
$package = new PackagerMetsSwap($rootin, $dirin, $rootout, $fileout);

// Add metadata to the package
$package->setType($test_type);
$package->setTitle($title);
$package->setAbstract($abstract);
foreach ($creators as $creator) {
    $package->addCreator($creator);
}

// Add a file to the package
$package->addFile($filename, $mimetype);

// Now deposit the package
$dr = $sac->deposit($depositurl, $username, $password, $onbehalfof, $filename, $packageformat, $pacakgecontenttype);

Please send requests or leave a comment for features for the next version.

Bookmark and Share
Posted on June 23, 2009 at 9:03 pm by Stuart · Permalink
In: Uncategorized · Tagged with: ,

2 Responses

Subscribe to comments via RSS

  1. [...] Here's an excerpt from the announcement: [...]

  2. Written by SWORD PHP Library Version 0.7 « pintiniblog
    on January 9, 2010 at 12:29 am
    Permalink

    [...] DigitalKoans signale la mise à disposition de SWORD PHP Library Version 0.7 (.zip) | voir annonce [...]

Subscribe to comments via RSS

Leave a Reply