It's unfortunate that Debian packages do not contain symbolic links for base libraries to their
versioned counterparts, and we need to install the `-dev` packages for that. All required packages
are now included in the Docker image's runtime dependencies, and the `static` build tag is made to
include the correct ones.
This allows for building binaries against `go-php` without needing an accompanying version of the
PHP library. To build a static version of `go-php`, simply set `STATIC=true` as a Make flag, e.g.:
make docker-build STATIC=true
The resulting `go-php` library will be placed in `.build/env/GOPATH/pkg/...` by default, and can be
used directly, but using the Docker image as a build environment will also work.
This adds PHP 7.2.1 as a new target, and updates existing PHP versions to their latest numbers. Be
aware that PHP 7.2.x is as-of-yet untested -- and expected to be buggy.
All PHP builds in Docker are now made against a single-unified Dockerfile, which accepts the PHP
version to target in the `PHP_VERSION` argument. Source files are currently not verified (other than
being downloaded from a secure location, as we will eventually move to using the official `php`
Docker images as a base, as soon as these catch up to latest versions of Debian.
This commit adds a Dockerfile for PHP 5.6.x and PHP 7.1.x versions, allowing for tests, package
builds etc. to run against an isolated, controlled environment. PHP is currently built as a shared
library, in the future we may build as a static library to allow bundling with Go applications.
Also included is a Makefile, containing targets for common operations, such as testing, building
packages etc. Two undocumented targets related to Docker are included, `docker-image` and
`docker-test`. Moving these as documented targets is a future task.
The initial rationale behind pushing all files into a subdirectory was keeping
the repository root clean, however there's probably better, and move meaningful
ways of doing so (splitting `engine`, `context`, and `value` to separate
packages, moving all `.c` files into the `src` directory etc.
The additional `php7.debian` build tag allows Go-PHP to be built against
PHP7 on Debian (and Debian-derived, such as Ubuntu) distributions. This
additional build tag is required due to the non-standard include and
library file locations.
Relates-To: #26
Currently, large parts of the C source use pre-processor tricks for
maintaining compatibility between versions 5 and 7 of PHP. This contains
work for cleaning the dependencies up by introducing an extra level of C
source, tailored to each supported version of PHP.
Certain distributions, such as Debian, ship include files for version 5
of PHP in the `/usr/include/php5` directory. This commit adds directives
necessary for building go-php against packages provided by such distros.
Several API-breaking changes:
* Define method and related functionality moved back to Engine package
* Exported functions for receivers moved to the engine package
* Receiver API cleaned up and made public
Receivers no longer store Go pointers in C contexts, and instead use the
C engine_receiver pointer as reference in the Go context (similar to what
we do for Contexts). Some changes have been made to the C code to accomodate
the above.
This fixes compatibility with Go 1.6, which specifies stricter rules for
passing Go pointers to C and vice versa. Exported methods now use the
C context's pointer hexadecimal representation to find the parent Go
Context.