summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorfoobar <sniper@php.net>2005-06-03 22:09:22 +0000
committerfoobar <sniper@php.net>2005-06-03 22:09:22 +0000
commitfd07bc5e6ba275d90c7d375bdb43991bd7b5fcea (patch)
tree8d2c1ea601c62fadb0e18ba038a32c42e9e27daa /ext
parente3cfb42bbdc7c9d14120977ce008975dd38dc383 (diff)
downloadphp-git-fd07bc5e6ba275d90c7d375bdb43991bd7b5fcea.tar.gz
nuke duplicate code
Diffstat (limited to 'ext')
-rw-r--r--ext/session/session.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/ext/session/session.c b/ext/session/session.c
index 9c6940e02a..55ef6f2448 100644
--- a/ext/session/session.c
+++ b/ext/session/session.c
@@ -1342,9 +1342,17 @@ PHP_FUNCTION(session_module_name)
zval **p_name;
int ac = ZEND_NUM_ARGS();
- if (ac < 0 || ac > 1 || zend_get_parameters_ex(ac, &p_name) == FAILURE)
+ if (ac < 0 || ac > 1 || zend_get_parameters_ex(ac, &p_name) == FAILURE) {
WRONG_PARAM_COUNT;
+ }
+ /* Set return_value to current module name */
+ if (PS(mod) && PS(mod)->s_name) {
+ RETVAL_STRING(safe_estrdup(PS(mod)->s_name), 0);
+ } else {
+ RETVAL_EMPTY_STRING();
+ }
+
if (ac == 1) {
convert_to_string_ex(p_name);
if (!_php_find_ps_module(Z_STRVAL_PP(p_name) TSRMLS_CC)) {
@@ -1357,19 +1365,7 @@ PHP_FUNCTION(session_module_name)
}
PS(mod_data) = NULL;
- if (PS(mod) && PS(mod)->s_name) {
- RETVAL_STRING(safe_estrdup(PS(mod)->s_name), 0);
- } else {
- RETVAL_EMPTY_STRING();
- }
-
zend_alter_ini_entry("session.save_handler", sizeof("session.save_handler"), Z_STRVAL_PP(p_name), Z_STRLEN_PP(p_name), PHP_INI_USER, PHP_INI_STAGE_RUNTIME);
- } else {
- if (PS(mod) && PS(mod)->s_name) {
- RETURN_STRING(safe_estrdup(PS(mod)->s_name), 0);
- } else {
- RETURN_EMPTY_STRING();
- }
}
}
/* }}} */