[Live-demo] [OSGeo] #1717: GeoMoose fails to start in Xenial due to PHP7 (due to no MapScript)

OSGeo trac_osgeo at osgeo.org
Fri Jun 3 16:57:45 PDT 2016


#1717: GeoMoose fails to start in Xenial due to PHP7 (due to no MapScript)
---------------------+----------------------------
 Reporter:  kalxas   |       Owner:  live-demo@…
     Type:  defect   |      Status:  new
 Priority:  blocker  |   Milestone:  OSGeoLive10.0
Component:  LiveDVD  |  Resolution:
 Keywords:           |
---------------------+----------------------------

Comment (by sebastic):

 Replying to [comment:1 jimk]:
 > 1. !MapScript is updated to work with PHP 7 in a way that doesn't
 significantly change the API.

 That should be doable, although in the [https://lists.osgeo.org/pipermail
 /mapserver-dev/2016-April/014840.html related discussion on the mapserver-
 dev list] Thomas Bonfort expressed preference to switch to SWIG for PHP
 !MapScript when it gets support for PHP 7
 ([https://github.com/swig/swig/issues/571#issuecomment-211785179 SWIG #571
 Support for PHP 7]).

 PHP !MapScript doesn't have an active maintainer currently, so people
 relying on it are strongly encouraged to help port PHP !MapScript to PHP
 7.

 With the following patch can get you started, but it doesn't handle the
 `zend_object_value` changes and `zend_register_internal_class_ex` yet:
 {{{
 --- a/mapscript/php/php_mapscript_util.h
 +++ b/mapscript/php/php_mapscript_util.h
 @@ -59,7 +59,9 @@
  #define Z_SET_REFCOUNT_P(pz, rc)    zval_set_refcount_p(pz, rc)
  #define Z_ADDREF_P(pz)          zval_addref_p(pz)
  #define Z_DELREF_P(pz)          zval_delref_p(pz)
 +#if PHP_MAJOR_VERSION < 7
  #define Z_ISREF_P(pz)         zval_isref_p(pz)
 +#endif
  #define Z_SET_ISREF_P(pz)       zval_set_isref_p(pz)
  #define Z_UNSET_ISREF_P(pz)       zval_unset_isref_p(pz)
  #define Z_SET_ISREF_TO_P(pz, isref)   zval_set_isref_to_p(pz, isref)
 @@ -68,7 +70,9 @@
  #define Z_SET_REFCOUNT(z, rc)     Z_SET_REFCOUNT_P(&(z), rc)
  #define Z_ADDREF(z)           Z_ADDREF_P(&(z))
  #define Z_DELREF(z)           Z_DELREF_P(&(z))
 +#if PHP_MAJOR_VERSION < 7
  #define Z_ISREF(z)            Z_ISREF_P(&(z))
 +#endif
  #define Z_SET_ISREF(z)          Z_SET_ISREF_P(&(z))
  #define Z_UNSET_ISREF(z)        Z_UNSET_ISREF_P(&(z))
  #define Z_SET_ISREF_TO(z, isref)    Z_SET_ISREF_TO_P(&(z), isref)
 @@ -81,6 +85,7 @@
  #define zend_always_inline inline
  #endif

 +#if PHP_MAJOR_VERSION < 7
  static zend_always_inline zend_uint zval_refcount_p(zval* pz)
  {
    return pz->refcount;
 @@ -120,6 +125,7 @@ static zend_always_inline zend_bool zval
  {
    return pz->is_ref = isref;
  }
 +#endif

  #endif

 }}}

--
Ticket URL: <https://trac.osgeo.org/osgeo/ticket/1717#comment:3>
OSGeo <http://www.osgeo.org/>
OSGeo committee and general foundation issue tracker.


More information about the Osgeolive mailing list