]> granicus.if.org Git - php/commitdiff
Added ability to check build_id by extension
authorDmitry Stogov <dmitry@php.net>
Wed, 8 Apr 2009 12:19:13 +0000 (12:19 +0000)
committerDmitry Stogov <dmitry@php.net>
Wed, 8 Apr 2009 12:19:13 +0000 (12:19 +0000)
Zend/zend_extensions.c
Zend/zend_extensions.h

index e20f1596fdd9b4d917634a13ecc7be30dda1054e..47f1ef58891a66078241766549f769e902a98800 100644 (file)
@@ -79,7 +79,8 @@ int zend_load_extension(const char *path) /* {{{ */
                        DL_UNLOAD(handle);
                        return FAILURE;
                }
-       } else if (strcmp(ZEND_EXTENSION_BUILD_ID, extension_version_info->build_id)) {
+       } else if (strcmp(ZEND_EXTENSION_BUILD_ID, extension_version_info->build_id) &&
+                  (!new_extension->build_id_check || new_extension->build_id_check(ZEND_EXTENSION_BUILD_ID) != SUCCESS)) {
                fprintf(stderr, "Cannot load %s - it was build with configuration %s, whereas running engine is %s\n",
                                        new_extension->name, extension_version_info->build_id, ZEND_EXTENSION_BUILD_ID);
                DL_UNLOAD(handle);
index a93d048965c3621b7a4186f128f7216edc45a0e4..84026b777be212908d25718119afed0c36a5a89f 100644 (file)
@@ -81,7 +81,7 @@ struct _zend_extension {
        op_array_dtor_func_t op_array_dtor;
 
        int (*api_no_check)(int api_no);
-       void *reserved2;
+       int (*build_id_check)(const char* build_id);
        void *reserved3;
        void *reserved4;
        void *reserved5;