diff options
author | Stanislav Malyshev <stas@php.net> | 2000-10-29 16:25:16 +0000 |
---|---|---|
committer | Stanislav Malyshev <stas@php.net> | 2000-10-29 16:25:16 +0000 |
commit | ca07586e1ec2b6443221dd2a6139b27e562a6789 (patch) | |
tree | 1d368a39c139023a9f734c4ea4c008b3e6e0d9ef /Zend/zend_extensions.c | |
parent | 009e5df0301a28805c1059385cba7be11923a5a5 (diff) | |
download | php-git-ca07586e1ec2b6443221dd2a6139b27e562a6789.tar.gz |
Allow module to proclaim compatibility with any Zend version
Diffstat (limited to 'Zend/zend_extensions.c')
-rw-r--r-- | Zend/zend_extensions.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/Zend/zend_extensions.c b/Zend/zend_extensions.c index 794728adb5..06d4d5c738 100644 --- a/Zend/zend_extensions.c +++ b/Zend/zend_extensions.c @@ -64,17 +64,19 @@ int zend_load_extension(char *path) return FAILURE; } - if (extension_version_info->zend_extension_api_no > ZEND_EXTENSION_API_NO) { - fprintf(stderr, "%s requires Zend Engine API version %d\n" + + /* allow extension to proclaim compatibility with any Zend version */ + if(extension_version_info->zend_extension_api_no != ZEND_EXTENSION_API_NO &&(!new_extension->api_no_check || new_extension->api_no_check(ZEND_EXTENSION_API_NO) != SUCCESS)) { + if (extension_version_info->zend_extension_api_no > ZEND_EXTENSION_API_NO) { + fprintf(stderr, "%s requires Zend Engine API version %d\n" "The installed Zend Engine API version is %d\n\n", new_extension->name, extension_version_info->zend_extension_api_no, ZEND_EXTENSION_API_NO); - DL_UNLOAD(handle); - return FAILURE; - } else if (extension_version_info->zend_extension_api_no < ZEND_EXTENSION_API_NO) { - /* we may be able to allow for downwards compatability in some harmless cases. */ - fprintf(stderr, "%s designed to be used with the Zend Engine API %d is outdated\n" + DL_UNLOAD(handle); + return FAILURE; + } else if (extension_version_info->zend_extension_api_no < ZEND_EXTENSION_API_NO) { + fprintf(stderr, "%s designed to be used with the Zend Engine API %d is outdated\ n" "It requires a more recent version of the Zend Engine\n" "The installed Zend Engine API version is %d\n" "Contact %s at %s for a later version of this module.\n\n", @@ -83,8 +85,9 @@ int zend_load_extension(char *path) ZEND_EXTENSION_API_NO, new_extension->author, new_extension->URL); - DL_UNLOAD(handle); - return FAILURE; + DL_UNLOAD(handle); + return FAILURE; + } } else if (ZTS_V!=extension_version_info->thread_safe) { fprintf(stderr, "Cannot load %s - it %s thread safe, whereas Zend %s\n", new_extension->name, |