承接 hebis/picareader 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

hebis/picareader

Composer 安装命令:

composer require hebis/picareader

包简介

Classes for reading Pica+ records encoded in Pica, PicaXML and PicaPlain

README 文档

README

About

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.

Installation

You can install PicaReader via Composer.

composer require hab/picareader

Usage

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.

$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();

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:

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

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:

<?xml version="1.0" encoding="UTF-8"?>
<record xmlns="info:srw/schema/5/picaXML-v1.0">
  <datafield tag="">
  </datafield>
  <datafield tag="001A">
    <subfield code="0">0001:14-09-10</subfield>
  </datafield>
  …
</record>

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

$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();

Acknowledgements

Large parts of this package would not have been possible without studying the source of Pica::Record, an open source Perl library for handling Pica+ records by Jakob Voß, and the practical knowledge of our library’s catalogers.

Footnotes

hebis/picareader 适用场景与选型建议

hebis/picareader 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 4.96k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2016 年 02 月 10 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 hebis/picareader 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 hebis/picareader 我们能提供哪些服务?
定制开发 / 二次开发

基于 hebis/picareader 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 4.96k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 8
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 2
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0
  • 更新时间: 2016-02-10