grknight    15/02/04 19:58:49

  Added:                6.1.0-php-5.4.patch
  Log:
  Non-maintainer commit: Revbump to provide php5.4 and php5.5 support (only one 
at a time) using patch from https://github.com/mapserver/mapserver/issues/4309
  
  (Portage version: 2.2.15/cvs/Linux x86_64, signed Manifest commit with key 
D1F781EFF9F4A3B6)

Revision  Changes    Path
1.1                  sci-geosciences/mapserver/files/6.1.0-php-5.4.patch

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-geosciences/mapserver/files/6.1.0-php-5.4.patch?rev=1.1&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-geosciences/mapserver/files/6.1.0-php-5.4.patch?rev=1.1&content-type=text/plain

Index: 6.1.0-php-5.4.patch
===================================================================
diff -aurN mapserver-6.0.1.orig/mapscript/php/image.c 
mapserver-6.0.1/mapscript/php/image.c
--- mapserver-6.0.1.orig/mapscript/php/image.c  2011-04-05 11:15:06.000000000 
-0400
+++ mapserver-6.0.1/mapscript/php/image.c       2015-02-04 14:29:03.164357015 
-0500
@@ -303,10 +303,18 @@
     /* no filename - read stdout */
 
     /* if there is no output buffer active, set the header */
-    if (OG(ob_nesting_level)<=0)
-    {
-        php_header(TSRMLS_C);
-    }
+    //handle changes in PHP 5.4.x
+    #if PHP_VERSION_ID < 50399
+      if (OG(ob_nesting_level)<=0)
+      {
+          php_header(TSRMLS_C);
+      }
+    #else
+      if (php_output_get_level(TSRMLS_C)<=0)
+      {
+          php_header(TSRMLS_C);
+      }
+    #endif
    
 
     if (MS_RENDERER_PLUGIN(php_image->image->format))
diff -aurN mapserver-6.0.1.orig/mapscript/php/php_mapscript.c 
mapserver-6.0.1/mapscript/php/php_mapscript.c
--- mapserver-6.0.1.orig/mapscript/php/php_mapscript.c  2011-04-05 
23:05:02.000000000 -0400
+++ mapserver-6.0.1/mapscript/php/php_mapscript.c       2015-02-04 
14:27:52.296567202 -0500
@@ -899,7 +899,7 @@
 
 }
 
-function_entry mapscript_functions[] = {
+zend_function_entry mapscript_functions[] = {
     PHP_FE(ms_GetVersion, NULL)
     PHP_FE(ms_GetVersionInt,  NULL)
     PHP_FE(ms_newLineObj, NULL)
diff -aurN mapserver-6.0.1.orig/mapscript/php/php_mapscript_util.c 
mapserver-6.0.1/mapscript/php/php_mapscript_util.c
--- mapserver-6.0.1.orig/mapscript/php/php_mapscript_util.c     2011-04-04 
13:50:20.000000000 -0400
+++ mapserver-6.0.1/mapscript/php/php_mapscript_util.c  2015-02-04 
14:27:27.477341249 -0500
@@ -42,7 +42,12 @@
     zobj->ce = ce;
     ALLOC_HASHTABLE(zobj->properties);
     zend_hash_init(zobj->properties, 0, NULL, ZVAL_PTR_DTOR, 0);
-    zend_hash_copy(zobj->properties, &ce->default_properties, 
(copy_ctor_func_t) zval_add_ref,(void *) &temp, sizeof(zval *));
+    //handle changes in PHP 5.4.x
+    #if PHP_VERSION_ID < 50399
+      zend_hash_copy(zobj->properties, &ce->default_properties, 
(copy_ctor_func_t) zval_add_ref,(void *) &temp, sizeof(zval *));
+    #else
+      object_properties_init(zobj, ce);
+    #endif
     retval.handle = zend_objects_store_put(zobj, NULL, 
(zend_objects_free_object_storage_t)zend_objects_free_object, NULL TSRMLS_CC);
     retval.handlers = &mapscript_std_object_handlers;
     return retval;
@@ -59,7 +64,12 @@
     zobj->ce = ce;
     ALLOC_HASHTABLE(zobj->properties);
     zend_hash_init(zobj->properties, 0, NULL, ZVAL_PTR_DTOR, 0);
-    zend_hash_copy(zobj->properties, &ce->default_properties, 
(copy_ctor_func_t) zval_add_ref,(void *) &temp, sizeof(zval *));
+    //handle changes in PHP 5.4.x
+    #if PHP_VERSION_ID < 50399
+      zend_hash_copy(zobj->properties, &ce->default_properties, 
(copy_ctor_func_t) zval_add_ref,(void *) &temp, sizeof(zval *));
+    #else
+      object_properties_init(zobj, ce);
+    #endif
     retval.handle = zend_objects_store_put(zobj, NULL, 
(zend_objects_free_object_storage_t)zend_objects_free_object, NULL TSRMLS_CC);
     retval.handlers = object_handlers;
     return retval;




Reply via email to