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:
- When performing a deposit, the client now sets the ‘Content-Disposition:filename’ header so that the SWORD server knows what to name the file. This is required by SWORD implementations (such as the Intrallect implementation) that store the deposited file verbatim (as per http://www.swordapp.org/docs/sword-profile-1.3.html#b.9.2)
- When performing a deposit, the optional X-No-Op (pretend to perform the deposit) and X-Verbose (provide a verbose response) headers can now be sent (as per http://www.swordapp.org/docs/sword-profile-1.3.html#b.9.2)
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.
Posted on June 23, 2009 at 9:03 pm by Stuart · Permalink
In: Uncategorized · Tagged with: repositories, sword
In: Uncategorized · Tagged with: repositories, sword



on June 25, 2009 at 4:37 pm
Permalink
[...] Here's an excerpt from the announcement: [...]
on January 9, 2010 at 12:29 am
Permalink
[...] DigitalKoans signale la mise à disposition de SWORD PHP Library Version 0.7 (.zip) | voir annonce [...]