vufind-org/vufindharvest
Composer 安装命令:
composer require vufind-org/vufindharvest
包简介
VuFind Harvest Tools
README 文档
README
VuFindHarvest
Introduction
VuFindHarvest contains OAI-PMH harvesting logic. This is part of the VuFind project (https://vufind.org) but may be used as a stand-alone tool or incorporated into other software dealing with metadata harvesting.
Installation
The recommended method for incorporating this library into your project is to use
Composer (http://getcomposer.org). If you wish to use this as a stand-alone tool,
simply clone the repository and run composer install or php composer.phar install
(depending on your Composer setup) to download dependencies.
Concept
This tool is designed to allow for a pipeline approach to OAI-PMH record processing. Its job is to harvest metadata from one or more repositories into one or more directories. It can support a one-file-per-record or a multiple-records-per-file approach. Records can be manipulated and augmented with the help of certain configuration options (primarily to copy data from the OAI-PMH header into the harvested record itself when necessary).
Each directory containing harvested records also includes a last_harvest.txt file which remembers the most recently harvested record date. This allows the tool to be re-run on subsequent occasions to perform an incremental update and retrieve new content.
Interrupted harvests may sometimes be resumed with the help of a last_state.txt file, that will exist in the harvest directory after an abnormal termination of the tool.
Deleted records are supported through the creation of ".delete" files containing the IDs of records that have been removed from the system.
Usage
This package includes a bin/harvest_oai.php script which provides a command-line
interface for OAI-PMH harvesting. All harvesting options may be provided at the
command-line, or else a .ini file containing saved options may be loaded using the
--ini switch.
Harvesting without an .ini file
For the most basic harvest, you need to specify the --url and --metadataPrefix
options and include a target parameter specifying where records should be
harvested. For additional options, run php bin/harvest_oai.php --help.
Example:
php bin/harvest_oai.php --url=http://example.com/oai_server --metadataPrefix=oai_dc my_target_dir
Harvesting with an .ini file
When specifying many complex options, or when harvesting multiple repositories at once, configuring the harvest with an .ini file is the best option. The .ini option offers more flexibility than the pure command-line option. Note that any command line options passed to the harvester during an .ini-driven harvest will override the equivalent settings in the .ini file.
For a full list of .ini options and some example configurations, see the sample file found in /etc/oai.ini.
If you specify a parameter following the option list when using an .ini file, only the section of the configuration file matching the parameter will be used, and records will be harvested to a directory with a matching name. For example:
php bin/harvest_oai.php --ini=/etc/oai.ini OJS
If you omit the parameter, all sections of the .ini file will be harvested in sequence.
Architecture
If you wish to incorporate this code into another project, or extend it to support more options, here are the most important top-level classes:
- VuFindHarvester\OaiPmh\HarvesterCommand - Provides command-line interface around VuFindHarvester\OaiPmh\Harvester
- VuFindHarvester\OaiPmh\HarvesterFactory - Factory class to create VuFindHarvester\OaiPmh\Harvester objects with all dependencies injected
- VuFindHarvester\OaiPmh\Harvester - Class to perform a single harvest of a single OAI-PMH repository.
Here are key dependencies used by VuFindHarvester\OaiPmh\Harvester:
- VuFindHarvester\OaiPmh\Communicator - Wrapper around the HTTP communication used by the OAI-PMH protocol (also uses a response processor to manipulate retrieved results)
- VuFindHarvester\OaiPmh\RecordWriter - Class to manage writing OAI-PMH records to disk; utilizes one of the available record writer strategies
- VuFindHarvester\OaiPmh\RecordXmlFormatter - Class to process/fix/augment harvested XML data prior to writing it to disk
- VuFindHarvester\OaiPmh\SetLoader - Class to retrieve a list of set information from an OAI-PMH server (used for certain types of optional XML augmentation)
- VuFindHarvester\OaiPmh\StateManager - Class for managing harvest state (last harvest date, current resumption token) on disk to assist incremental harvests and recovery from problems
Several classes make use of the traits and classes in the VuFindHarvester\ConsoleOutput namespace to help with standard status output tasks.
History
See CHANGELOG.md
vufind-org/vufindharvest 适用场景与选型建议
vufind-org/vufindharvest 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 309.19k 次下载、GitHub Stars 达 23, 最近一次更新时间为 2016 年 06 月 08 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 vufind-org/vufindharvest 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 vufind-org/vufindharvest 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 309.19k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 23
- 点击次数: 15
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0-only
- 更新时间: 2016-06-08