Re: [PEPr] +1 for File Formats::File_MARC

From: Date: Fri, 27 Oct 2006 14:04:25 +0000
Subject: Re: [PEPr] +1 for File Formats::File_MARC
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-44774@lists.php.net to get a copy of this message
On 27 Oct 2006 09:28:16 -0000, Adam Harvey <aharvey@php.net> wrote:
Adam Harvey (http://pear.php.net/user/aharvey) has voted +1 on the proposal for File Formats::File_MARC. Proposal information: http://pear.php.net/pepr/pepr-proposal-show.php?id=443 Vote information: http://pear.php.net/pepr/pepr-vote-show.php?id=443&handle=aharvey Comment: There were a couple of minor issues with the examples that I noticed. marc_yaz.php tries to call File_MARC::numRecords(), which doesn't seem to exist. Also, read.php prints the message "Surname: Error -- $a subfield appears more than once in this field!" -- is this expected? Apart from that, the source itself looks good, bar the minor issues the other voters have mentioned. Throwing a random MARC file at it and hacking a script up to pull information out worked, and that's the main thing. -- Sent by PEPr, the automatic proposal system at http://pear.php.net
Nice catches! In the "marc_yaz.php" example, the numRecords() method was left over from the previous version of the package, which loaded the entire MARC file into memory before parsing the records. That didn't work so well when I tried parsing a 500M MARC file, which led to a change to stream-based processing. Unfortunately I didn't update the example to reflect that change; I'll fix that in the 0.1.0-alpha release if this package is accepted. In the "read.php" example, that error message is not expected; in the last iteration of File_MARC, I changed getSubfields() from returning either a single value or an array of values to always returning an array of values, and added the getSubfield() method to always return a single (the first) value. I'll update the example correspondingly. And thanks so much for actually throwing a random MARC file at the parser; I've been focusing mainly on my own institution's records, so it's nice to have some further confirmation that this is a generally applicable extension before it becomes a real PEAR package. Dan

« previous php.pear.dev (#44774) next »