This document describes the PHP language binding for the MapGuide API
This binding targets the Windows release of PHP 7.1.19, the current PHP version in the 7.1 series.
The binding is built against the non-thread-safe release of PHP, meaning it currently can only be used in Apache httpd server via FastCGI with the mod_fcgid
module
No binding is provided for PHP 7.1 on Linux at this point in time as none of the Linux distros where we provide MapGuide binaries for (CentOS 6.x / Ubuntu 14.04), provide an official PHP 7.x package.
NOTE:
As MapGuide currently does not bundle PHP 7.1, these instructions assume you already have PHP 7.1 installed. How to install PHP 7.1 is beyond the scope of this document
- Copy
php_MapGuideApi.dll
and supporting dlls to theext
subdirectory of your PHP 7.1 installation. - Modify
php.ini
and add the lineextension=php_MapGuideApi.dll
to the extensions section of the file.
-
Some APIs with many overloads may have incorrect wrapper code generated by vanilla SWIG. We've been working around this by monkey-patching away such problematic APIs. Please report any APIs that do not behave as they did in the official PHP 5.x binding.
-
If you have multiple try/catch blocks within the same scope, make sure to use different exception variable names. For example:
try {
//Some code that throws
} catch (MgException $ex) {
//Handle this exception
}
try {
//Some more code that throws
} catch (MgException $ex) {
//$ex from previous catch block is not properly cleaned up and will leak memory. You should use a different variable name here
}
-
Usage
- You will need to include
MapGuideApi.php
to access the MapGuide API.
- You will need to include
-
Removed classes/APIs
MgLayerBase::MgLayerBase
MgMapBase::Open
MgResource::Save
MgConfigurationException::GetExceptionMessage
MgSerializable
This is only a "marker" class for server/webtier serialization plumbing. Needed to be removed so thatMgException
can be rebased against PHPException
to make it throwable.