#718 closed defect (fixed)
Support for php 5
Reported by: | Owned by: | mapserverbugs | |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | MapScript-PHP | Version: | unspecified |
Severity: | normal | Keywords: | VERIFIED |
Cc: | pspencer@…, sylvain.pasche@…, gdallaire@… |
Description
I can't compile mapserver with php 5. I think zend_* functions have changed. TODO : use the new zend_engine or wait swig on php 5
Attachments (1)
Change History (11)
comment:2 by , 20 years ago
Hello, I tried to compile php mapscript with php 5, and hacked around to see what was needed to get it compile, and in fact, the porting was not too much pain :-). I dont know the Zend API, but I greped php sources to find porting examples. I did not test extensively the generated mapscript, but it looks like to be able to generate an image out of a mapfile. See the attached file for the patch. Only two needed changes: 1) macros BYREF_FORCE|NONE have been replaced by BEGIN_ARG_INFO +#ifdef ZEND_ENGINE_2 +ZEND_BEGIN_ARG_INFO(one_arg_force_ref, 0) + ZEND_ARG_PASS_INFO(1) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO(two_args_first_arg_force_ref, 0) + ZEND_ARG_PASS_INFO(1) + ZEND_ARG_PASS_INFO(0) +ZEND_END_ARG_INFO() +#else static unsigned char one_arg_force_ref[] = { 1, BYREF_FORCE}; static unsigned char two_args_first_arg_force_ref[] = { 2, BYREF_FORCE, BYREF_NONE }; +#endif 2) some macros are needed to access zval properties. perl -pi -e 's/pObj->value.obj.properties/Z_OBJPROP_P(pObj)/g' php_mapscript_util.c perl -pi -e 's/pThis->value.obj.properties/Z_OBJPROP_P(pThis)/g' php_mapscript.c I found these conversions in ./scripts/dev/conv_z_macros of the php sources, and adapted a bit. It compiles then with both php-4.3.8 and php-5.0.0.
comment:4 by , 20 years ago
I'm testing this patch. It compiles. I will come back with more results.
comment:5 by , 20 years ago
Tested OK with gmap-4.0 demo application. (http://www.maptools.org/dl/gmap-ms40.tar.gz) Tested OK with Chameleon 1.99 beta 1 but Chameleon needs some adjustments to work with php 5.0.
comment:6 by , 20 years ago
Cc: | added |
---|---|
Status: | new → assigned |
Sounds great. I will try to apply the patch in CVS today.
comment:7 by , 20 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
The patch has been applied in both 4.3 (CVS) and the 4.2 branch (will be in 4.2.2). Thank you Sylvain for the patch! :)
comment:8 by , 20 years ago
Cc: | added |
---|
That's greats news, you're welcome. Thanks all for the testing and the commit ;-)
comment:9 by , 20 years ago
Keywords: | VERIFIED added |
---|
Verified CVS version with both PHP v4.3.7 and v5.0.0 : OK Verified branch-4-2 version with both PHP v4.3.7 and v5.0.0 : OK I used gmap demo application.
comment:10 by , 19 years ago
dependson: | → 1100 |
---|
Note:
See TracTickets
for help on using tickets.