[mapguide-commits] r9938 - sandbox/jng/vanilla_swig/Bindings/src/SwigCommon/Php
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Mon May 23 04:51:00 PDT 2022
Author: jng
Date: 2022-05-23 04:50:59 -0700 (Mon, 23 May 2022)
New Revision: 9938
Modified:
sandbox/jng/vanilla_swig/Bindings/src/SwigCommon/Php/monkey_patch.i
sandbox/jng/vanilla_swig/Bindings/src/SwigCommon/Php/pointer.i
Log:
PHP binding fixes:
- Properly handle MapGuide APIs that can return nullptr
- Fix monkey_patch.i to be more selective about what APIs are to be ignored
Modified: sandbox/jng/vanilla_swig/Bindings/src/SwigCommon/Php/monkey_patch.i
===================================================================
--- sandbox/jng/vanilla_swig/Bindings/src/SwigCommon/Php/monkey_patch.i 2022-05-23 09:48:57 UTC (rev 9937)
+++ sandbox/jng/vanilla_swig/Bindings/src/SwigCommon/Php/monkey_patch.i 2022-05-23 11:50:59 UTC (rev 9938)
@@ -31,8 +31,8 @@
%rename(CreateStateless) MgMap::Create(MgResourceIdentifier*, STRINGPARAM, INT32, INT32, double, double, double, INT32);
-%ignore MgResource::Save;
-%ignore MgMapBase::Open;
+%ignore MgResource;
+%ignore MgMapBase::Open(MgResourceService*, CREFSTRING);
/*
%ignore MgConfigurationLoadFailedException::GetExceptionMessage;
Modified: sandbox/jng/vanilla_swig/Bindings/src/SwigCommon/Php/pointer.i
===================================================================
--- sandbox/jng/vanilla_swig/Bindings/src/SwigCommon/Php/pointer.i 2022-05-23 09:48:57 UTC (rev 9937)
+++ sandbox/jng/vanilla_swig/Bindings/src/SwigCommon/Php/pointer.i 2022-05-23 11:50:59 UTC (rev 9938)
@@ -10,11 +10,15 @@
//
%typemap(out) SWIGTYPE*
{
- const char* retClassName = ResolveMgClassName(static_cast<MgObject*>($1)->GetClassId());
swig_type_info* ty = NULL;
- if (NULL != retClassName)
+ if ($1)
{
- ty = SWIG_TypeQuery(retClassName);
+ //TODO: Can we get away with not having to do this (ie. Just use $1_descriptor)?
+ const char* retClassName = ResolveMgClassName(static_cast<MgObject*>($1)->GetClassId());
+ if (NULL != retClassName)
+ {
+ ty = SWIG_TypeQuery(retClassName);
+ }
}
if (NULL == ty) //Fallback to original descriptor
{
More information about the mapguide-commits
mailing list