[getdns-users] [PATCH] remove GETDNS_COMPILATION_COMMENT

Daniel Kahn Gillmor dkg at fifthhorseman.net
Wed Jul 8 19:02:56 UTC 2015


On Wed 2015-07-08 14:54:33 -0400, Melinda Shore wrote:
> On 7/8/15 10:19 AM, Hollenbeck, Scott wrote:
>> That means I would need to create a context, send a query, parse the
>> returned dictionary, and destroy the context every time PHP loads the
>> extension. I'd much rather use a defined constant (just the version
>> number would be useful) that could be available when the extension is
>> compiled.
>
> Well, as Daniel points out that tells you which version you compiled
> against, not which you're running against, and I'm not sure that's
> actually useful (runtime version would be).  Library version string is
> associated with a context in the API definition and that may not have
> been a great decision but it's what we've got.

We could also add a version info function without breaking backward API
compatibility, if the concern is that the cost of making a context and
parsing the response is too expensive.

During build time, it's also possible (albeit a little bit of
hoop-jumping) to extract the library's runtime version if you want to
embed that in your binding. (though i'm still not sure how useful that
is).

        --dkg



More information about the Users mailing list