summaryrefslogtreecommitdiff
path: root/ext/session/session.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/session/session.c')
-rw-r--r--ext/session/session.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/ext/session/session.c b/ext/session/session.c
index ef17b86bad..e77aee9574 100644
--- a/ext/session/session.c
+++ b/ext/session/session.c
@@ -40,6 +40,7 @@
#include "rfc1867.h"
#include "php_variables.h"
#include "php_session.h"
+#include "zend_exceptions.h"
#include "ext/standard/md5.h"
#include "ext/standard/sha1.h"
#include "ext/standard/php_var.h"
@@ -339,7 +340,7 @@ PHPAPI zend_string *php_session_create_id(PS_CREATE_SID_ARGS) /* {{{ */
case PS_HASH_FUNC_OTHER:
if (!PS(hash_ops)) {
efree(buf);
- php_error_docref(NULL, E_ERROR, "Invalid session hash function");
+ zend_throw_error(zend_ce_error, "Invalid session hash function");
return NULL;
}
@@ -351,7 +352,7 @@ PHPAPI zend_string *php_session_create_id(PS_CREATE_SID_ARGS) /* {{{ */
#endif /* HAVE_HASH_EXT */
default:
efree(buf);
- php_error_docref(NULL, E_ERROR, "Invalid session hash function");
+ zend_throw_error(zend_ce_error, "Invalid session hash function");
return NULL;
}
efree(buf);
@@ -480,7 +481,7 @@ static void php_session_initialize(void) /* {{{ */
zend_string *val = NULL;
if (!PS(mod)) {
- php_error_docref(NULL, E_ERROR, "No storage module chosen - failed to initialize session");
+ zend_throw_error(zend_ce_error, "No storage module chosen - failed to initialize session");
return;
}
@@ -488,7 +489,7 @@ static void php_session_initialize(void) /* {{{ */
if (PS(mod)->s_open(&PS(mod_data), PS(save_path), PS(session_name)) == FAILURE
/* || PS(mod_data) == NULL */ /* FIXME: open must set valid PS(mod_data) with success */
) {
- php_error_docref(NULL, E_ERROR, "Failed to initialize storage module: %s (path: %s)", PS(mod)->s_name, PS(save_path));
+ zend_throw_error(zend_ce_error, "Failed to initialize storage module: %s (path: %s)", PS(mod)->s_name, PS(save_path));
return;
}
@@ -496,7 +497,7 @@ static void php_session_initialize(void) /* {{{ */
if (!PS(id)) {
PS(id) = PS(mod)->s_create_sid(&PS(mod_data));
if (!PS(id)) {
- php_error_docref(NULL, E_ERROR, "Failed to create session ID: %s (path: %s)", PS(mod)->s_name, PS(save_path));
+ zend_throw_error(zend_ce_error, "Failed to create session ID: %s (path: %s)", PS(mod)->s_name, PS(save_path));
return;
}
if (PS(use_cookies)) {
@@ -1829,7 +1830,7 @@ static PHP_FUNCTION(session_set_save_handler)
add_next_index_zval(&PS(mod_user_names).names[i], obj);
add_next_index_str(&PS(mod_user_names).names[i], zend_string_copy(func_name));
} else {
- php_error_docref(NULL, E_ERROR, "Session handler's function table is corrupt");
+ zend_throw_error(zend_ce_error, "Session handler's function table is corrupt");
RETURN_FALSE;
}