Closed Bug 359686 Opened 18 years ago Closed 17 years ago

OpenSearch component for Remora (validation and OS->Sherlock conversion)

Categories

(addons.mozilla.org Graveyard :: Search Plugins, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: Gavin, Assigned: Gavin)

Details

Attachments

(1 file, 1 obsolete file)

I've been working on a component for Remora that will parse OpenSearch files, validate them, and optionally convert them to Sherlock, if possible.
Attached patch OpenSearch component, with tests (obsolete) — Splinter Review
I'm very much not familiar with PHP, so please feel free to point out if I've done anything stupid, or if there are better ways to do things that I'm not aware of.
Assignee: nobody → gavin.sharp
Status: NEW → ASSIGNED
Attachment #244811 - Flags: first-review?(sancus)
This includes a minor fix to make getImage work (and an added test for it), and fixes a few problems with the data: URIs in the tests.

One thing that I'm particularly unsure about is that trying to add arbitrarily named entries (e.g. $this->attrs['ShortName']) to arrays results in lots of "undefined index" warnings, so I resorted to initializing the arrays with the right key names and empty elements (see reset()). Should I be using some other type of object for a simple key->value hash?
Attachment #244811 - Attachment is obsolete: true
Attachment #244811 - Flags: first-review?(sancus)
Attachment #248588 - Flags: first-review?(sancus)
Whiteboard: [patch-r?]
Comment on attachment 248588 [details] [diff] [review]
updated OpenSearch component, with tests

Per the discussion in IRC, the code causes errors without array index initializations because there's a few places where operations are performed on array indexes that may not exist at that time, such as the increment at line 330. That said, the code works fine with the initializations and I don't think they're a problem, so I'm landing this as-is.
Attachment #248588 - Flags: first-review?(sancus) → first-review+
Whiteboard: [patch-r?]
I'm going to mark this FIXED, because the code's landed. Integration of the component into Remora will be dealt separately.
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: