Hey Alper
Sorry for the delay - thinks all blew up yesterday with another little
project I work on :D
If we need to change the way hkit is called in order to sort out this
profiles problem, then this is a good point to do it at. However, we
should take into consideration both the case of multiple instances of
hkit and reuse of the same instance.
If you've found instances of hCard-specific stuff that should be
removed, that's great - could you point them out?
I had a read of your post - the mixins stuff looks cool. However,
let's not use a sledgehammer to crack a nut here. If the problem can
be solved simply then it should be. I've not yet looked at it myself,
but I shall this week. (I also have a patch from Gareth that I need to
look at merging in.)
It's far easier for us to change how hkit is called than to change the
output. Typically people will call hkit in just a few places, so those
are easy bits of code to update, whereas code parsing the output tends
to be way more involved.
drew.
On Jan 21, 2:39 pm, Alper Çugun <
al...@alper.nl> wrote:
> On Jan 15, 2008, at 12:28 , Drew McLellan wrote:
>
> > That'd be great, Alper. I have nothing underway for that, and it's a
> > big issue. (Although I don't think it should be too hard to solve,
> > fingers crossed.)
>
> I've got a preliminary patch which solves the big issue as seen here:
http://wordpresstest.aardverschuiving.com/hKit/hkit-read-only/test-mu...
> using a method described here:
http://www.achievo.org/blog/archives/46-Mixins-in-PHP.html
>
> It's not really finished because I have not made some design decisions
> yet which I didn't think were mine to make. (hCard is hard coded on a
> couple of places and that should be refactored.)
>
> Curently both getByURL and getByString take a $profile argument so if
> you would call them subsequently they would either try to load the
> same profile twice or try to load different profiles into the same
> hKit class. It is probably possible to make that work by resetting the
> class before loading a profile etc. etc. but it is definitely not the
> most maintainable solution.
>
> A better solution would be, I think to give hKit a profile on
> instantiation and not have it be changeable after, like:
> $hCardParser = new hKit('hCard');
> but that would change the interface of the library. Another halfway
> solution is to have the loadProfile check if it has already loaded a
> profile and if so, not do anything.
>
> Suggestions?
>
> --
> Alper Çugun
>
> Mobile:
+31-6-24553306 * E-mail:
em...@alper.nl
> See my webpage and blogs at:
http://www.alper.nl