summaryrefslogtreecommitdiff
path: root/Zend/zend_extensions.c
diff options
context:
space:
mode:
authorStanley Sufficool <ssufficool@php.net>2014-10-20 21:33:32 -0700
committerStanley Sufficool <ssufficool@php.net>2014-10-20 21:33:32 -0700
commit8defcb855ab01d9c8ab4759cb793d80149b55a8c (patch)
treeed51eb30a2cbc92b102557498fb3e4113da1bb07 /Zend/zend_extensions.c
parent9c7dbb0487f5991fde03873ea8f5e66d6688415f (diff)
parentbaddb1c73a170ef1d2c31bd54cddbc6e1ab596b9 (diff)
downloadphp-git-8defcb855ab01d9c8ab4759cb793d80149b55a8c.tar.gz
Merge branch 'master' of https://git.php.net/push/php-src
* 'master' of https://git.php.net/push/php-src: (6215 commits) Extra comma Moved proxy object support in ASSIGN_ADD (and family) from VM to slow paths of corresponding operators Simplification zend_get_property_info_quick() cleanup and optimization initialize lineno before calling compile file file in phar Use ADDREF instead of DUP, it must be enough. Removed old irrelevant comment fixed compilation error Fix bug #68262: Broken reference across cloned objects export functions needed for phpdbg Fixed compilation Optimized property access handlers. Removed EG(std_property_info). Fixed bug #68199 (PDO::pgsqlGetNotify doesn't support NOTIFY payloads) Don't make difference between undefined and unaccessible properies when call __get() and family Don't make useless CSE array_pop/array_shift optimization check for zlib headers as well as lib for mysqlnd a realpath cache key can be int or float, catching this News entry for new curl constants News entry for new curl constants ...
Diffstat (limited to 'Zend/zend_extensions.c')
-rw-r--r--Zend/zend_extensions.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/Zend/zend_extensions.c b/Zend/zend_extensions.c
index 2dd7cd4c59..04150920af 100644
--- a/Zend/zend_extensions.c
+++ b/Zend/zend_extensions.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
- | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
+ | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -24,7 +24,7 @@
ZEND_API zend_llist zend_extensions;
static int last_resource_number;
-int zend_load_extension(const char *path)
+int zend_load_extension(const char *path TSRMLS_DC)
{
#if ZEND_EXTENSIONS_SUPPORT
DL_HANDLE handle;
@@ -105,9 +105,17 @@ int zend_load_extension(const char *path)
#endif
DL_UNLOAD(handle);
return FAILURE;
+ } else if (zend_get_extension(new_extension->name)) {
+ fprintf(stderr, "Cannot load %s - it was already loaded\n", new_extension->name);
+/* See http://support.microsoft.com/kb/190351 */
+#ifdef PHP_WIN32
+ fflush(stderr);
+#endif
+ DL_UNLOAD(handle);
+ return FAILURE;
}
- return zend_register_extension(new_extension, handle);
+ return zend_register_extension(new_extension, handle TSRMLS_CC);
#else
fprintf(stderr, "Extensions are not supported on this platform.\n");
/* See http://support.microsoft.com/kb/190351 */
@@ -119,7 +127,7 @@ int zend_load_extension(const char *path)
}
-int zend_register_extension(zend_extension *new_extension, DL_HANDLE handle)
+int zend_register_extension(zend_extension *new_extension, DL_HANDLE handle TSRMLS_DC)
{
#if ZEND_EXTENSIONS_SUPPORT
zend_extension extension;
@@ -127,7 +135,7 @@ int zend_register_extension(zend_extension *new_extension, DL_HANDLE handle)
extension = *new_extension;
extension.handle = handle;
- zend_extension_dispatch_message(ZEND_EXTMSG_NEW_EXTENSION, &extension);
+ zend_extension_dispatch_message(ZEND_EXTMSG_NEW_EXTENSION, &extension TSRMLS_CC);
zend_llist_add_element(&zend_extensions, &extension);
@@ -187,7 +195,7 @@ void zend_shutdown_extensions(TSRMLS_D)
void zend_extension_dtor(zend_extension *extension)
{
#if ZEND_EXTENSIONS_SUPPORT && !ZEND_DEBUG
- if (extension->handle) {
+ if (extension->handle && !getenv("ZEND_DONT_UNLOAD_MODULES")) {
DL_UNLOAD(extension->handle);
}
#endif
@@ -208,10 +216,8 @@ static void zend_extension_message_dispatcher(const zend_extension *extension, i
}
-ZEND_API void zend_extension_dispatch_message(int message, void *arg)
+ZEND_API void zend_extension_dispatch_message(int message, void *arg TSRMLS_DC)
{
- TSRMLS_FETCH();
-
zend_llist_apply_with_arguments(&zend_extensions, (llist_apply_with_args_func_t) zend_extension_message_dispatcher TSRMLS_CC, 2, message, arg);
}