summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Piotrowski <aaron@trowski.com>2015-07-03 09:44:48 -0500
committerAaron Piotrowski <aaron@trowski.com>2015-07-03 09:44:48 -0500
commita812a74c2e60a0ba080057067a7634e4da3f2b9b (patch)
tree7cd6fd55b3fdfe61b22c9370fe23427c6b344243
parentf9e9d3a43792846a483092bce409bc9927d24848 (diff)
downloadphp-git-a812a74c2e60a0ba080057067a7634e4da3f2b9b.tar.gz
Change zend_exception_get_default() to zend_exception_ce
-rw-r--r--Zend/zend_generators.c2
-rw-r--r--ext/com_dotnet/com_extension.c2
-rw-r--r--ext/dom/php_dom.c2
-rw-r--r--ext/intl/intl_error.c11
-rw-r--r--ext/mysqli/mysqli.c8
-rw-r--r--ext/pdo/pdo.c2
-rw-r--r--ext/pgsql/pgsql.c6
-rw-r--r--ext/phar/phar_object.c6
-rw-r--r--ext/reflection/php_reflection.c2
-rw-r--r--ext/simplexml/simplexml.c2
-rw-r--r--ext/snmp/snmp.c4
-rw-r--r--ext/soap/soap.c4
-rw-r--r--ext/spl/spl_exceptions.c2
-rw-r--r--ext/sqlite3/sqlite3.c16
-rw-r--r--sapi/cli/php_cli.c2
15 files changed, 33 insertions, 38 deletions
diff --git a/Zend/zend_generators.c b/Zend/zend_generators.c
index 6e847fb7c0..2c68a3ad7e 100644
--- a/Zend/zend_generators.c
+++ b/Zend/zend_generators.c
@@ -1124,7 +1124,7 @@ void zend_register_generator_ce(void) /* {{{ */
zend_generator_handlers.get_constructor = zend_generator_get_constructor;
INIT_CLASS_ENTRY(ce, "ClosedGeneratorException", NULL);
- zend_ce_ClosedGeneratorException = zend_register_internal_class_ex(&ce, zend_exception_get_default());
+ zend_ce_ClosedGeneratorException = zend_register_internal_class_ex(&ce, zend_exception_ce);
}
/* }}} */
diff --git a/ext/com_dotnet/com_extension.c b/ext/com_dotnet/com_extension.c
index eeaf75399f..42b6477c14 100644
--- a/ext/com_dotnet/com_extension.c
+++ b/ext/com_dotnet/com_extension.c
@@ -358,7 +358,7 @@ PHP_MINIT_FUNCTION(com_dotnet)
php_com_persist_minit(INIT_FUNC_ARGS_PASSTHRU);
INIT_CLASS_ENTRY(ce, "com_exception", NULL);
- php_com_exception_class_entry = zend_register_internal_class_ex(&ce, zend_exception_get_default());
+ php_com_exception_class_entry = zend_register_internal_class_ex(&ce, zend_exception_ce);
php_com_exception_class_entry->ce_flags |= ZEND_ACC_FINAL;
/* php_com_exception_class_entry->constructor->common.fn_flags |= ZEND_ACC_PROTECTED; */
diff --git a/ext/dom/php_dom.c b/ext/dom/php_dom.c
index 795dff21d7..3394a9284d 100644
--- a/ext/dom/php_dom.c
+++ b/ext/dom/php_dom.c
@@ -614,7 +614,7 @@ PHP_MINIT_FUNCTION(dom)
zend_hash_init(&classes, 0, NULL, NULL, 1);
INIT_CLASS_ENTRY(ce, "DOMException", php_dom_domexception_class_functions);
- dom_domexception_class_entry = zend_register_internal_class_ex(&ce, zend_exception_get_default());
+ dom_domexception_class_entry = zend_register_internal_class_ex(&ce, zend_exception_ce);
dom_domexception_class_entry->ce_flags |= ZEND_ACC_FINAL;
zend_declare_property_long(dom_domexception_class_entry, "code", sizeof("code")-1, 0, ZEND_ACC_PUBLIC);
diff --git a/ext/intl/intl_error.c b/ext/intl/intl_error.c
index d5e246efb1..0118ef652d 100644
--- a/ext/intl/intl_error.c
+++ b/ext/intl/intl_error.c
@@ -232,16 +232,13 @@ void intl_errors_set_code( intl_error* err, UErrorCode err_code )
void intl_register_IntlException_class( void )
{
- zend_class_entry ce,
- *default_exception_ce;
-
- default_exception_ce = zend_exception_get_default( );
-
+ zend_class_entry ce;
+
/* Create and register 'IntlException' class. */
INIT_CLASS_ENTRY_EX( ce, "IntlException", sizeof( "IntlException" ) - 1, NULL );
IntlException_ce_ptr = zend_register_internal_class_ex( &ce,
- default_exception_ce );
- IntlException_ce_ptr->create_object = default_exception_ce->create_object;
+ zend_exception_ce );
+ IntlException_ce_ptr->create_object = zend_exception_ce->create_object;
}
smart_str intl_parse_error_to_string( UParseError* pe )
diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c
index 9682b35152..3665ddc27f 100644
--- a/ext/mysqli/mysqli.c
+++ b/ext/mysqli/mysqli.c
@@ -606,7 +606,7 @@ PHP_MINIT_FUNCTION(mysqli)
#ifdef HAVE_SPL
mysqli_exception_class_entry = zend_register_internal_class_ex(&cex, spl_ce_RuntimeException);
#else
- mysqli_exception_class_entry = zend_register_internal_class_ex(&cex, zend_exception_get_default());
+ mysqli_exception_class_entry = zend_register_internal_class_ex(&cex, zend_exception_ce);
#endif
mysqli_exception_class_entry->ce_flags |= ZEND_ACC_FINAL;
zend_declare_property_long(mysqli_exception_class_entry, "code", sizeof("code")-1, 0, ZEND_ACC_PROTECTED);
@@ -1302,7 +1302,7 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags
* single value is an array. Also we'd have to make that one
* argument passed by reference.
*/
- zend_throw_exception(zend_exception_get_default(), "Parameter ctor_params must be an array", 0);
+ zend_throw_exception(zend_exception_ce, "Parameter ctor_params must be an array", 0);
return;
}
}
@@ -1314,7 +1314,7 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags
fcc.object = Z_OBJ_P(return_value);
if (zend_call_function(&fci, &fcc) == FAILURE) {
- zend_throw_exception_ex(zend_exception_get_default(), 0, "Could not execute %s::%s()", ZSTR_VAL(ce->name), ZSTR_VAL(ce->constructor->common.function_name));
+ zend_throw_exception_ex(zend_exception_ce, 0, "Could not execute %s::%s()", ZSTR_VAL(ce->name), ZSTR_VAL(ce->constructor->common.function_name));
} else {
zval_ptr_dtor(&retval);
}
@@ -1322,7 +1322,7 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags
efree(fci.params);
}
} else if (ctor_params) {
- zend_throw_exception_ex(zend_exception_get_default(), 0, "Class %s does not have a constructor hence you cannot use ctor_params", ZSTR_VAL(ce->name));
+ zend_throw_exception_ex(zend_exception_ce, 0, "Class %s does not have a constructor hence you cannot use ctor_params", ZSTR_VAL(ce->name));
}
}
}
diff --git a/ext/pdo/pdo.c b/ext/pdo/pdo.c
index 61055e6193..3c8b529f3f 100644
--- a/ext/pdo/pdo.c
+++ b/ext/pdo/pdo.c
@@ -93,7 +93,7 @@ PDO_API zend_class_entry *php_pdo_get_exception_base(int root) /* {{{ */
}
}
#endif
- return zend_exception_get_default();
+ return zend_exception_ce;
}
/* }}} */
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c
index 5681d2f2a8..f8ad8067a7 100644
--- a/ext/pgsql/pgsql.c
+++ b/ext/pgsql/pgsql.c
@@ -2808,7 +2808,7 @@ static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_
* single value is an array. Also we'd have to make that one
* argument passed by reference.
*/
- zend_throw_exception(zend_exception_get_default(), "Parameter ctor_params must be an array", 0);
+ zend_throw_exception(zend_exception_ce, "Parameter ctor_params must be an array", 0);
return;
}
}
@@ -2820,7 +2820,7 @@ static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_
fcc.object = Z_OBJ_P(return_value);
if (zend_call_function(&fci, &fcc) == FAILURE) {
- zend_throw_exception_ex(zend_exception_get_default(), 0, "Could not execute %s::%s()", ce->name, ce->constructor->common.function_name);
+ zend_throw_exception_ex(zend_exception_ce, 0, "Could not execute %s::%s()", ce->name, ce->constructor->common.function_name);
} else {
zval_ptr_dtor(&retval);
}
@@ -2828,7 +2828,7 @@ static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_
efree(fci.params);
}
} else if (ctor_params) {
- zend_throw_exception_ex(zend_exception_get_default(), 0, "Class %s does not have a constructor hence you cannot use ctor_params", ce->name);
+ zend_throw_exception_ex(zend_exception_ce, 0, "Class %s does not have a constructor hence you cannot use ctor_params", ce->name);
}
}
}
diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c
index f93738f60c..8330261699 100644
--- a/ext/phar/phar_object.c
+++ b/ext/phar/phar_object.c
@@ -1118,7 +1118,7 @@ static spl_other_handler phar_spl_foreign_handler = {
PHP_METHOD(Phar, __construct)
{
#if !HAVE_SPL
- zend_throw_exception_ex(zend_exception_get_default(), 0, "Cannot instantiate Phar object without SPL extension");
+ zend_throw_exception_ex(zend_exception_ce, 0, "Cannot instantiate Phar object without SPL extension");
#else
char *fname, *alias = NULL, *error, *arch = NULL, *entry = NULL, *save_fname;
size_t fname_len, alias_len = 0;
@@ -5290,14 +5290,12 @@ zend_function_entry phar_exception_methods[] = {
#define REGISTER_PHAR_CLASS_CONST_LONG(class_name, const_name, value) \
zend_declare_class_constant_long(class_name, const_name, sizeof(const_name)-1, (zend_long)value);
-#define phar_exception_get_default() zend_exception_get_default()
-
void phar_object_init(void) /* {{{ */
{
zend_class_entry ce;
INIT_CLASS_ENTRY(ce, "PharException", phar_exception_methods);
- phar_ce_PharException = zend_register_internal_class_ex(&ce, phar_exception_get_default());
+ phar_ce_PharException = zend_register_internal_class_ex(&ce, zend_exception_ce);
#if HAVE_SPL
INIT_CLASS_ENTRY(ce, "Phar", php_archive_methods);
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index 0a65d60d21..36fe531612 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -6572,7 +6572,7 @@ PHP_MINIT_FUNCTION(reflection) /* {{{ */
reflection_object_handlers.write_property = _reflection_write_property;
INIT_CLASS_ENTRY(_reflection_entry, "ReflectionException", reflection_exception_functions);
- reflection_exception_ptr = zend_register_internal_class_ex(&_reflection_entry, zend_exception_get_default());
+ reflection_exception_ptr = zend_register_internal_class_ex(&_reflection_entry, zend_exception_ce);
INIT_CLASS_ENTRY(_reflection_entry, "Reflection", reflection_functions);
reflection_ptr = zend_register_internal_class(&_reflection_entry);
diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c
index 6fe6b940fc..aa52c2d9a6 100644
--- a/ext/simplexml/simplexml.c
+++ b/ext/simplexml/simplexml.c
@@ -2285,7 +2285,7 @@ SXE_METHOD(__construct)
if (!docp) {
((php_libxml_node_object *)sxe)->document = NULL;
- zend_throw_exception(zend_exception_get_default(), "String could not be parsed as XML", 0);
+ zend_throw_exception(zend_exception_ce, "String could not be parsed as XML", 0);
return;
}
diff --git a/ext/snmp/snmp.c b/ext/snmp/snmp.c
index 5f34ac4fcb..08917ae917 100644
--- a/ext/snmp/snmp.c
+++ b/ext/snmp/snmp.c
@@ -1820,7 +1820,7 @@ PHP_METHOD(snmp, __construct)
case SNMP_VERSION_3:
break;
default:
- zend_throw_exception(zend_exception_get_default(), "Unknown SNMP protocol version", 0);
+ zend_throw_exception(zend_exception_ce, "Unknown SNMP protocol version", 0);
return;
}
@@ -2419,7 +2419,7 @@ PHP_MINIT_FUNCTION(snmp)
#ifdef HAVE_SPL
php_snmp_exception_ce = zend_register_internal_class_ex(&cex, spl_ce_RuntimeException);
#else
- php_snmp_exception_ce = zend_register_internal_class_ex(&cex, zend_exception_get_default());
+ php_snmp_exception_ce = zend_register_internal_class_ex(&cex, zend_exception_ce);
#endif
return SUCCESS;
diff --git a/ext/soap/soap.c b/ext/soap/soap.c
index 7fc9ed67bb..ad9f6774b7 100644
--- a/ext/soap/soap.c
+++ b/ext/soap/soap.c
@@ -683,7 +683,7 @@ PHP_MINIT_FUNCTION(soap)
/* Register SoapFault class */
INIT_CLASS_ENTRY(ce, PHP_SOAP_FAULT_CLASSNAME, soap_fault_functions);
- soap_fault_class_entry = zend_register_internal_class_ex(&ce, zend_exception_get_default());
+ soap_fault_class_entry = zend_register_internal_class_ex(&ce, zend_exception_ce);
/* Register SoapParam class */
INIT_CLASS_ENTRY(ce, PHP_SOAP_PARAM_CLASSNAME, soap_param_functions);
@@ -3280,7 +3280,7 @@ static void set_soap_fault(zval *obj, char *fault_code_ns, char *fault_code, cha
}
add_property_string(obj, "faultstring", fault_string ? fault_string : "");
- zend_update_property_string(zend_exception_get_default(), obj, "message", sizeof("message")-1, (fault_string ? fault_string : ""));
+ zend_update_property_string(zend_exception_ce, obj, "message", sizeof("message")-1, (fault_string ? fault_string : ""));
if (fault_code != NULL) {
int soap_version = SOAP_GLOBAL(soap_version);
diff --git a/ext/spl/spl_exceptions.c b/ext/spl/spl_exceptions.c
index c466e0f4c1..e6c5eb6efc 100644
--- a/ext/spl/spl_exceptions.c
+++ b/ext/spl/spl_exceptions.c
@@ -47,7 +47,7 @@ PHPAPI zend_class_entry *spl_ce_RangeException;
PHPAPI zend_class_entry *spl_ce_UnderflowException;
PHPAPI zend_class_entry *spl_ce_UnexpectedValueException;
-#define spl_ce_Exception zend_exception_get_default()
+#define spl_ce_Exception zend_exception_ce
/* {{{ PHP_MINIT_FUNCTION(spl_exceptions) */
PHP_MINIT_FUNCTION(spl_exceptions)
diff --git a/ext/sqlite3/sqlite3.c b/ext/sqlite3/sqlite3.c
index 8161690ead..42ce4ce94f 100644
--- a/ext/sqlite3/sqlite3.c
+++ b/ext/sqlite3/sqlite3.c
@@ -54,7 +54,7 @@ static void php_sqlite3_error(php_sqlite3_db_object *db_obj, char *format, ...)
va_end(arg);
if (db_obj && db_obj->exception) {
- zend_throw_exception(zend_exception_get_default(), message, 0);
+ zend_throw_exception(zend_exception_ce, message, 0);
} else {
php_error_docref(NULL, E_WARNING, "%s", message);
}
@@ -111,7 +111,7 @@ PHP_METHOD(sqlite3, open)
}
if (db_obj->initialised) {
- zend_throw_exception(zend_exception_get_default(), "Already initialised DB Object", 0);
+ zend_throw_exception(zend_exception_ce, "Already initialised DB Object", 0);
}
if (strlen(filename) != filename_len) {
@@ -119,20 +119,20 @@ PHP_METHOD(sqlite3, open)
}
if (memcmp(filename, ":memory:", sizeof(":memory:")) != 0) {
if (!(fullpath = expand_filepath(filename, NULL))) {
- zend_throw_exception(zend_exception_get_default(), "Unable to expand filepath", 0);
+ zend_throw_exception(zend_exception_ce, "Unable to expand filepath", 0);
return;
}
#if PHP_API_VERSION < 20100412
if (PG(safe_mode) && (!php_checkuid(fullpath, NULL, CHECKUID_CHECK_FILE_AND_DIR))) {
- zend_throw_exception_ex(zend_exception_get_default(), 0, "safe_mode prohibits opening %s", fullpath);
+ zend_throw_exception_ex(zend_exception_ce, 0, "safe_mode prohibits opening %s", fullpath);
efree(fullpath);
return;
}
#endif
if (php_check_open_basedir(fullpath)) {
- zend_throw_exception_ex(zend_exception_get_default(), 0, "open_basedir prohibits opening %s", fullpath);
+ zend_throw_exception_ex(zend_exception_ce, 0, "open_basedir prohibits opening %s", fullpath);
efree(fullpath);
return;
}
@@ -145,7 +145,7 @@ PHP_METHOD(sqlite3, open)
#else
if (sqlite3_open(fullpath, &(db_obj->db)) != SQLITE_OK) {
#endif
- zend_throw_exception_ex(zend_exception_get_default(), 0, "Unable to open database: %s", sqlite3_errmsg(db_obj->db));
+ zend_throw_exception_ex(zend_exception_ce, 0, "Unable to open database: %s", sqlite3_errmsg(db_obj->db));
if (fullpath) {
efree(fullpath);
}
@@ -155,7 +155,7 @@ PHP_METHOD(sqlite3, open)
#if SQLITE_HAS_CODEC
if (encryption_key_len > 0) {
if (sqlite3_key(db_obj->db, encryption_key, encryption_key_len) != SQLITE_OK) {
- zend_throw_exception_ex(zend_exception_get_default(), 0, "Unable to open database: %s", sqlite3_errmsg(db_obj->db));
+ zend_throw_exception_ex(zend_exception_ce, 0, "Unable to open database: %s", sqlite3_errmsg(db_obj->db));
return;
}
}
@@ -1807,7 +1807,7 @@ PHP_METHOD(sqlite3result, finalize)
__constructor for SQLite3Result. */
PHP_METHOD(sqlite3result, __construct)
{
- zend_throw_exception(zend_exception_get_default(), "SQLite3Result cannot be directly instantiated", 0);
+ zend_throw_exception(zend_exception_ce, "SQLite3Result cannot be directly instantiated", 0);
}
/* }}} */
diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c
index e48481dd0c..c1bfc74d99 100644
--- a/sapi/cli/php_cli.c
+++ b/sapi/cli/php_cli.c
@@ -1090,7 +1090,7 @@ static int do_cli(int argc, char **argv) /* {{{ */
zval tmp, *msg, rv;
ZVAL_OBJ(&tmp, EG(exception));
- msg = zend_read_property(zend_exception_get_default(), &tmp, "message", sizeof("message")-1, 0, &rv);
+ msg = zend_read_property(zend_exception_ce, &tmp, "message", sizeof("message")-1, 0, &rv);
zend_printf("Exception: %s\n", Z_STRVAL_P(msg));
zval_ptr_dtor(&tmp);
EG(exception) = NULL;