[geos-devel] Extraction of PHP extension into PECL-style package

J Smith dark.panda+lists at gmail.com
Wed Jan 20 07:31:54 PST 2016


G'day Sandro.

I'm a bit new to all of the recent developments in PHP extension
packaging so I'll have to investigate a few things I suppose. I did
some PHP development ages ago and I have a decade of catching up to
do, but back in the day, there was basically the `pear` command and
that was the official infrastructure for installing PHP packages. I
think PECL, the PHP Extension Community Library, was wrapped within
that infrastructure. These days, `pear` and a lot of that
infrastructure has been superseded by Composer, which is a PHP package
manager akin to Ruby's gem, Node's npm, etc., and it's
still-in-development cousin Pickle, which handles the native
extensions as PECL used to do. Pickle itself is built around PECL in
the sense that PECL appears to provide the repository for packages
while Pickle aims to provide the package management tools. I don't
know if Pickle is in production yet, as the docs seem to indicate that
the aim is to merge it with Composer. I only ran across Pickle
yesterday, so it's pretty new to me -- again, just getting back into
PHP land for a client.

Now, if I've gotten all that correctly, I think the main gist of
things is that the actual hosting of the PHP extension can be done
anywhere, as I see various projects within PECL are hosted on a
combination of Github, PHP's own SVN tree, Google Code, so I don't
think that the location of the source code makes much of a difference.
To be included on the PECL page and within the PECL infrastructure,
you merely need to submit the extension for inclusion and have it
accepted.

Personally, it doesn't much matter to me where the hosting is done,
I'm just interested in getting the thing running and to make it more
easily accessible. Worst case scenario, a Github mirror could be
created for the sake of any interoperability issues, the but master
repo could be anywhere.

A few things I notice after reviewing the PECL documentation:

- "We strongly encourage contributors to choose the PHP License 3.01
for their extensions, in order to avoid possible troubles for
end-users of the extension. Other solid options are BSD and Apache
type licenses." I've never been completely comfortable with licensing
my own software under the PHP license because the terms of the license
seem to imply you have to re-assign copyright to the PHP Group. (I
think? The license itself says "Copyright (c) 1999 - 2014 The PHP
Group".) I prefer to license things under BSD or MIT licenses. For the
current example project I posted, I used a hybrid license to this end
-- the code extracted from the GEOS source is under the LGPLv2, while
the packaging itself is MIT.

- "Note: wrappers for GPL (all versions) or LGPLv3 libraries will not
be accepted. Wrappers for libraries licensed under LGPLv2 are however
allowed while being discouraged." I'm assuming since GEOS is LGPLv2
there shouldn't be any problems here, but there might be some
grumbling from PECL potentially.

If that all sounds sane, I think this would be do-able. A longer-term
goal might be to do similar extractions for the Python and Ruby SWIG
wrappers, but I'll leave that for another day.

Cheers


On Wed, Jan 20, 2016 at 4:48 AM, Sandro Santilli <strk at keybit.net> wrote:
> G'day Dark Panda !
>
> On Tue, Jan 19, 2016 at 12:58:48PM -0500, J Smith wrote:
>
>> I have pushed an initial version of the extension to Github at
>> https://github.com/dark-panda/php-geos-native for review. If given the
>> blessing, I can start the process of hopefully getting it included
>> into PECL, or at least leave it on Github so that it can be installed
>> via Pickle, which appears to be a Composer-like package manager for
>> native PHP extensions.
>
> I'm happy with both decoupling the PHP bindings from core and
> publishing into PECL.
>
> And I'm also ok with the code being on github (maybe under "libgeos"
> organization), althought if I'd prefer the "official" source of GEOS
> to be hosted by OSGeo infrastructure (not ready yet to do git).
>
> Does "Pickle" need "GitHub" specifically or could it fetch code
> from any git (or SVN) repository ?
>
> --strk;
> _______________________________________________
> geos-devel mailing list
> geos-devel at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/geos-devel


More information about the geos-devel mailing list