-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from talis/handle_bad_recorddata
Handle bad recorddata
- Loading branch information
Showing
16 changed files
with
2,133 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,5 @@ | |
.idea/ | ||
atlassian-ide-plugin.xml | ||
vendor/ | ||
|
||
composer.phar | ||
composer.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
language: php | ||
php: | ||
- '5.5' | ||
- '5.6' | ||
- '7.0' | ||
- '7.1' | ||
install: | ||
- composer install | ||
- composer dumpautoload |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
SRU Client for PHP | ||
================== | ||
|
||
A PHP Client library for [SRU](http://www.loc.gov/standards/sru/) servers. | ||
|
||
[![Build Status](https://travis-ci.org/talis/SRUClient-php.svg?branch=master)](https://travis-ci.org/talis/SRUClient-php) | ||
|
||
Usage | ||
----- | ||
|
||
``` | ||
$client = new \SRU\Client('http://lx2.loc.gov:210/LCDB', ['recordSchema' => 'marcxml']); | ||
$response = $client->searchRetrieve('dinosaur', ['maximumRecords' => 5]); | ||
$response->numberOfRecords(); | ||
> 3212 | ||
$record = $response->getRecords()[0]; | ||
$record->schema(); | ||
> 'marcxml' | ||
$record->position(); | ||
> 1 | ||
$response->nextPosition(); | ||
> 11 | ||
get_class($record->getData()); | ||
> DOMElement // <-- MARC record structure here | ||
echo $record->getData(true); // Returns a string representation of the data | ||
<record xmlns="http://www.loc.gov/MARC21/slim"> | ||
<leader>01392cjm a2200325 a 4500</leader> | ||
<controlfield tag="001">18919847</controlfield> | ||
<controlfield tag="005">20160104074050.0</controlfield> | ||
<controlfield tag="007">sd fsngnnmmned</controlfield> | ||
<controlfield tag="008">151229s2012 gw mun| | eng </controlfield> | ||
<datafield tag="906" ind1=" " ind2=" "> | ||
<subfield code="a">7</subfield> | ||
<subfield code="b">cbc</subfield> | ||
<subfield code="c">orignew</subfield> | ||
<subfield code="d">2</subfield> | ||
<subfield code="e">ncip</subfield> | ||
<subfield code="f">20</subfield> | ||
<subfield code="g">y-soundrec</subfield> | ||
</datafield> | ||
<datafield tag="925" ind1="0" ind2=" "> | ||
<subfield code="a">acquire</subfield> | ||
<subfield code="b">2 shelf copies</subfield> | ||
<subfield code="x">policy default</subfield> | ||
</datafield> | ||
<datafield tag="955" ind1=" " ind2=" "> | ||
<subfield code="a">qr12 2015-12-29</subfield> | ||
</datafield> | ||
<datafield tag="010" ind1=" " ind2=" "> | ||
<subfield code="a"> 2015662372</subfield> | ||
</datafield> | ||
<datafield tag="040" ind1=" " ind2=" "> | ||
<subfield code="a">DLC</subfield> | ||
<subfield code="c">DLC</subfield> | ||
</datafield> | ||
<datafield tag="041" ind1="0" ind2=" "> | ||
<subfield code="d">eng</subfield> | ||
<subfield code="d">ger</subfield> | ||
</datafield> | ||
<datafield tag="050" ind1="0" ind2="0"> | ||
<subfield code="a">SDC 60883</subfield> | ||
</datafield> | ||
<datafield tag="245" ind1="0" ind2="0"> | ||
<subfield code="a">1212</subfield> | ||
<subfield code="h">[sound recording] :</subfield> | ||
<subfield code="b">Dezember 2012.</subfield> | ||
</datafield> | ||
<datafield tag="246" ind1="1" ind2=" "> | ||
<subfield code="i">Title on container:</subfield> | ||
<subfield code="a">Nr. 1212</subfield> | ||
</datafield> | ||
<datafield tag="260" ind1=" " ind2=" "> | ||
<subfield code="a">[Berlin] :</subfield> | ||
<subfield code="b">Musikexpress,</subfield> | ||
<subfield code="c">[2012]</subfield> | ||
</datafield> | ||
<datafield tag="300" ind1=" " ind2=" "> | ||
<subfield code="a">1 sound disc :</subfield> | ||
<subfield code="b">digital ;</subfield> | ||
<subfield code="c">4 3/4 in.</subfield> | ||
</datafield> | ||
<datafield tag="511" ind1="0" ind2=" "> | ||
<subfield code="a">Various performers.</subfield> | ||
</datafield> | ||
<datafield tag="500" ind1=" " ind2=" "> | ||
<subfield code="a">"For promotion only!"</subfield> | ||
</datafield> | ||
<datafield tag="500" ind1=" " ind2=" "> | ||
<subfield code="a">Compact disc.</subfield> | ||
</datafield> | ||
<datafield tag="500" ind1=" " ind2=" "> | ||
<subfield code="a">Issued with the Dec. 2012 issue of Musikexpress.</subfield> | ||
</datafield> | ||
<datafield tag="505" ind1="0" ind2=" "> | ||
<subfield code="a">Elephant (Tame Impala) -- Partner in crime (Ecke Schönhauser) -- Peace of mind : Musikexpress edit (Fritz Kalkbrenner) -- I follow you (Melody's Echo Chamber) -- Dinosaur (Linnea Olsson) -- Long way to run (Bernhard Eder) -- Ich schäme mich (Hans Unstern) -- Den Rosenkavalier (HGich.T) -- Mach mich traurig (Die Liga der Gewöhnlichen Gentlemen) -- Wüde Hund (Neigungsgruppe Sex, Gewalt & Gute Laune).</subfield> | ||
</datafield> | ||
<datafield tag="650" ind1=" " ind2="0"> | ||
<subfield code="a">Rock music</subfield> | ||
<subfield code="y">2011-2020.</subfield> | ||
</datafield> | ||
<datafield tag="650" ind1=" " ind2="0"> | ||
<subfield code="a">Popular music</subfield> | ||
<subfield code="y">2011-2020.</subfield> | ||
</datafield> | ||
<datafield tag="655" ind1=" " ind2="7"> | ||
<subfield code="a">Rock music.</subfield> | ||
<subfield code="2">lcgft</subfield> | ||
</datafield> | ||
<datafield tag="655" ind1=" " ind2="7"> | ||
<subfield code="a">Popular music.</subfield> | ||
<subfield code="2">lcgft</subfield> | ||
</datafield> | ||
<datafield tag="730" ind1="0" ind2=" "> | ||
<subfield code="a">Musikexpress.</subfield> | ||
</datafield> | ||
</record> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<phpunit bootstrap="tests/bootstrap.php" | ||
colors="true"> | ||
<testsuites> | ||
<testsuite name="unit"> | ||
<directory>tests/unit</directory> | ||
</testsuite> | ||
</testsuites> | ||
<filter> | ||
<whitelist addUncoveredFilesFromWhitelist="true"> | ||
<directory>./src</directory> | ||
</whitelist> | ||
</filter> | ||
</phpunit> |
Oops, something went wrong.