bugzilla.mozilla.org will be intermittently unavailable on Saturday, March 24th, from 16:00 until 20:00 UTC.
I've been working on a component for Remora that will parse OpenSearch files, validate them, and optionally convert them to Sherlock, if possible.
Created attachment 244811 [details] [diff] [review] OpenSearch component, with tests 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)
Created attachment 248588 [details] [diff] [review] updated OpenSearch component, with tests 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 #248588 - Flags: first-review?(sancus)
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+
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
Last Resolved: 11 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.