From: Wez Furlong Date: Thu, 16 Jun 2005 15:36:39 +0000 (+0000) Subject: Don't emit the E_STRICT dl-is-deprecated notice on SAPI's where dl() is widely (and... X-Git-Tag: php-5.1.0b2~153 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b680c5c5e1806a2bea42e0494a6c87b78ce578b7;p=php Don't emit the E_STRICT dl-is-deprecated notice on SAPI's where dl() is widely (and safely) used. This allows our test-suite to run in E_STRICT mode. --- diff --git a/ext/standard/dl.c b/ext/standard/dl.c index 4a6068621c..8d311aa2df 100644 --- a/ext/standard/dl.c +++ b/ext/standard/dl.c @@ -63,24 +63,27 @@ PHP_FUNCTION(dl) convert_to_string_ex(file); -#ifdef ZTS + if (!PG(enable_dl)) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Dynamically loaded extensions aren't enabled"); + RETURN_FALSE; + } else if (PG(safe_mode)) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Dynamically loaded extensions aren't allowed when running in Safe Mode"); + RETURN_FALSE; + } + if ((strncmp(sapi_module.name, "cgi", 3)!=0) && (strcmp(sapi_module.name, "cli")!=0) && (strncmp(sapi_module.name, "embed", 5)!=0)) { +#ifdef ZTS php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not supported in multithreaded Web servers - use extension=%s in your php.ini", Z_STRVAL_PP(file)); RETURN_FALSE; - } +#else + php_error_docref(NULL TSRMLS_CC, E_STRICT, "dl() is deprecated - use extension=%s in your php.ini", Z_STRVAL_PP(file)); #endif - - if (!PG(enable_dl)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Dynamically loaded extensions aren't enabled"); - } else if (PG(safe_mode)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Dynamically loaded extensions aren't allowed when running in Safe Mode"); - } else { - zend_error(E_STRICT, "dl() is deprecated - use extension=%s in your php.ini", Z_STRVAL_PP(file)); - php_dl(*file, MODULE_TEMPORARY, return_value TSRMLS_CC); - EG(full_tables_cleanup) = 1; } + + php_dl(*file, MODULE_TEMPORARY, return_value TSRMLS_CC); + EG(full_tables_cleanup) = 1; } /* }}} */