Skip to content
This repository has been archived by the owner on Sep 2, 2022. It is now read-only.

Commit

Permalink
add list services supports #3
Browse files Browse the repository at this point in the history
  • Loading branch information
mshd committed Jun 5, 2020
1 parent c932c88 commit 4b957a3
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,24 @@ var_dump($sruCatalog->parse([
"title" => 'Meier',
]));
```
## Services

(can be generated by ```php tests/supportByService.php```)

| . | gvkk10plus | bvb | dnb | k10plus | loc |
| all | x | | x | | x |
| title | x | x | x | x | x |
| author | x | x | x | x | x |
| subject | x | x | x | x | x |
| idn | x | x | x | x | x |
| isxn | x | x | x | x | x |
| isbn | x | x | | | x |
| issn | x | | | | x |
| publisher | x | | x | | |
| publisherPlace | x | | x | | |
| year | x | | x | x | |
| language | x | | x | | |
| corperation | x | | x | | x |

## Testing

Expand Down
24 changes: 24 additions & 0 deletions tests/supportByService.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php
require_once __DIR__ . '/../vendor/autoload.php'; // Autoload files using Composer autoload
use Libreja\SruCatalog;
$sruCatalog = new SruCatalog\ServicesList();

$table = [];
foreach($sruCatalog->supportedKeys as $key=>$val){
$table[$key] = [];
}
$html = "| . |";
foreach($sruCatalog->getServices() as $serviceKey=>$serviceValue){
$html .= " ".$serviceKey." |";
foreach($table as $searchKey => $searchValue){
array_push($table[$searchKey],array_key_exists($searchKey,$serviceValue["search"]));
}
}

foreach($table as $key => $value){
$html .= "\n| ".$key." | ";
foreach($value as $exists){
$html .= " ".($exists?"x":"")." |";
}
}
echo $html;

0 comments on commit 4b957a3

Please sign in to comment.