Download the PHP package hebis/picareader without Composer

On this page you can find all versions of the php package hebis/picareader. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package picareader

+TITLE: PicaReader -- Classes for reading Pica+ records

+AUTHOR: David Maus

+EMAIL: [email protected]

PicaReader provides classes for reading Pica+ records encoded in PicaXML and PicaPlain.

PicaReader is copyright (c) 2012-2016 by Herzog August Bibliothek Wolfenbüttel and released under the terms of the GNU General Public License v3.

You can install PicaReader via Composer.

+BEGIN_EXAMPLE

composer require hab/picareader

+END_EXAMPLE

All readers adhere to the same interface. You open the reader with a string of input data by calling =Reader::open()= and can call =Reader::read()= to read the next record in the input data. If the input does not contain (anymore) records =Reader::read()= returns =FALSE=. Otherwise it returns either a record object created with PicaRecord's =Record::factory()= function.

+BEGIN_SRC php

$reader = new \HAB\Pica\Reader\PicaXmlReader() $reader->open(file_get_contents('http://unapi.gbv.de?id=opac-de-23:ppn:635012286&format=picaxml')); $record = $reader->read(); $reader->close();

+END_SRC

To filter out records or fields you can attach a filter to the reader via =Reader::setFilter()=. A filter is any valid PHP callback that takes an associative array representing the record as argument and returns a possibly modified array or =FALSE= if the entire record should be skipped.

The array representation of a record is defined as follows:

+BEGIN_EXAMPLE

RECORD := array('fields' => array(FIELD, …)) FIELD := array('tag' => TAG, 'occurrence' => OCCURRENCE, 'subfields' => array(SUBFIELD, …)) SUBFIELD := array('code' => CODE, 'value' => VALUE)

+END_EXAMPLE

Where =TAG=, =OCCURRENCE=, =CODE=, and =VALUE= are the respective properties of a Pica+ field or subfield.

For example, if your source delivers malformed PicaXML records like so:

+BEGIN_SRC xml

<?xml version="1.0" encoding="UTF-8"?>

0001:14-09-10

+END_SRC

You can attach a filter function to remove these fields with an invalid tag:

+BEGIN_SRC php

$reader = new PicaXmlReader(); $reader->setFilter(function (array $r) { return array('fields' => array_filter($r['fields'], function (array $f) { return isset($f['tag']) && \HAB\Pica\Record\Field::isValidFieldTag($f['tag']); })); }); $record = $reader->read(…); $reader->close();

+END_SRC

Large parts of this package would not have been possible without studying the source of [[http://search.cpan.org/dist/PICA-Record/][Pica::Record]], an open source Perl library for handling Pica+ records by Jakob Voß, and the practical knowledge of our library's catalogers.


All versions of picareader with dependencies

PHP Build Version
Package Version
Requires hab/picarecord Version ~1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package hebis/picareader contains the following files

Loading the files please wait ....