From 672266c735aec36f18d0b8b828e6179b46bd7eb6 Mon Sep 17 00:00:00 2001 From: foobar Date: Mon, 10 Apr 2006 15:06:51 +0000 Subject: [PATCH] - Cleanup --- ext/session/php_session.h | 2 - ext/session/session.c | 23 --------- ext/session/tests/007.phpt | 62 ------------------------ ext/session/tests/008-php4.2.3.phpt | 71 ---------------------------- ext/session/tests/008.phpt | 60 ------------------------ ext/session/tests/009.phpt | 4 +- ext/session/tests/010.phpt | 2 - ext/session/tests/011.phpt | 2 - ext/session/tests/012.phpt | 34 -------------- ext/session/tests/013.phpt | 2 - ext/session/tests/014.phpt | 2 - ext/session/tests/019.phpt | 73 ----------------------------- ext/session/tests/skipif.inc | 2 +- 13 files changed, 2 insertions(+), 337 deletions(-) delete mode 100644 ext/session/tests/007.phpt delete mode 100644 ext/session/tests/008-php4.2.3.phpt delete mode 100644 ext/session/tests/008.phpt delete mode 100644 ext/session/tests/012.phpt delete mode 100644 ext/session/tests/019.phpt diff --git a/ext/session/php_session.h b/ext/session/php_session.h index ac70ff7885d..643be135dcc 100644 --- a/ext/session/php_session.h +++ b/ext/session/php_session.h @@ -111,8 +111,6 @@ typedef struct _php_ps_globals { long gc_maxlifetime; int module_number; long cache_expire; - zend_bool bug_compat; /* Whether to behave like PHP 4.2 and earlier */ - zend_bool bug_compat_warn; /* Whether to warn about it */ const struct ps_serializer_struct *serializer; zval *http_session_vars; zend_bool auto_start; diff --git a/ext/session/session.c b/ext/session/session.c index f7d891096a2..194380edffd 100644 --- a/ext/session/session.c +++ b/ext/session/session.c @@ -145,8 +145,6 @@ static PHP_INI_MH(OnUpdateSaveDir) /* {{{ PHP_INI */ PHP_INI_BEGIN() - STD_PHP_INI_BOOLEAN("session.bug_compat_42", "1", PHP_INI_ALL, OnUpdateBool, bug_compat, php_ps_globals, ps_globals) - STD_PHP_INI_BOOLEAN("session.bug_compat_warn", "1", PHP_INI_ALL, OnUpdateBool, bug_compat_warn, php_ps_globals, ps_globals) STD_PHP_INI_ENTRY("session.save_path", "", PHP_INI_ALL, OnUpdateSaveDir,save_path, php_ps_globals, ps_globals) STD_PHP_INI_ENTRY("session.name", "PHPSESSID", PHP_INI_ALL, OnUpdateString, session_name, php_ps_globals, ps_globals) PHP_INI_ENTRY("session.save_handler", "files", PHP_INI_ALL, OnUpdateSaveHandler) @@ -723,27 +721,6 @@ static void php_session_save_current_state(TSRMLS_D) int ret = FAILURE; IF_SESSION_VARS() { - if (PS(bug_compat)) { - HashTable *ht = Z_ARRVAL_P(PS(http_session_vars)); - HashPosition pos; - zval **val; - int do_warn = 0; - - zend_hash_internal_pointer_reset_ex(ht, &pos); - - while (zend_hash_get_current_data_ex(ht, - (void **) &val, &pos) != FAILURE) { - if (Z_TYPE_PP(val) == IS_NULL) { - if (migrate_global(ht, &pos TSRMLS_CC)) - do_warn = 1; - } - zend_hash_move_forward_ex(ht, &pos); - } - - if (do_warn && PS(bug_compat_warn)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively."); - } - } if (PS(mod_data)) { char *val; diff --git a/ext/session/tests/007.phpt b/ext/session/tests/007.phpt deleted file mode 100644 index a406826161c..00000000000 --- a/ext/session/tests/007.phpt +++ /dev/null @@ -1,62 +0,0 @@ ---TEST-- -bug compatibility: unset($c) with enabled register_globals ---SKIPIF-- - ---INI-- -session.use_cookies=0 -session.cache_limiter= -session.bug_compat_42=1 -session.serialize_handler=php -session.save_handler=files ---FILE-- - ---EXPECT-- -float(3.14) -array(1) { - ["c"]=> - &float(3.14) -} -float(3.14) -array(1) { - ["c"]=> - &float(3.14) -} diff --git a/ext/session/tests/008-php4.2.3.phpt b/ext/session/tests/008-php4.2.3.phpt deleted file mode 100644 index 1d4bb20899b..00000000000 --- a/ext/session/tests/008-php4.2.3.phpt +++ /dev/null @@ -1,71 +0,0 @@ ---TEST-- -bug compatibility: global is used albeit register_globals=0 ---SKIPIF-- -= 4.2.3"); -?> ---INI-- -session.use_cookies=0 -session.cache_limiter= -session.bug_compat_42=1 -session.bug_compat_warn=1 -track_errors=1 -log_errors=0 -html_errors=0 -display_errors=1 -error_reporting=2039; -session.serialize_handler=php -session.save_handler=files ---FILE-- - ---EXPECTF-- -NULL -Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively. -array(1) { - ["c"]=> - float(3.14) -} -NULL -array(1) { - ["c"]=> - float(3.14) -} diff --git a/ext/session/tests/008.phpt b/ext/session/tests/008.phpt deleted file mode 100644 index 60c10a5297b..00000000000 --- a/ext/session/tests/008.phpt +++ /dev/null @@ -1,60 +0,0 @@ ---TEST-- -bug compatibility: global is used albeit register_globals=0 ---SKIPIF-- -=")) die("skip this is for PHP < 4.2.3"); -?> ---INI-- -session.use_cookies=0 -session.cache_limiter= -session.bug_compat_42=1 -session.bug_compat_warn=0 ---FILE-- - ---EXPECT-- -NULL -array(1) { - ["c"]=> - float(3.14) -} -NULL -array(1) { - ["c"]=> - float(3.14) -} diff --git a/ext/session/tests/009.phpt b/ext/session/tests/009.phpt index 7af6e41d942..c251de2aadf 100644 --- a/ext/session/tests/009.phpt +++ b/ext/session/tests/009.phpt @@ -1,12 +1,10 @@ --TEST-- -unset($_SESSION["name"]); should work with register_globals=off +unset($_SESSION["name"]); should work --SKIPIF-- --INI-- session.use_cookies=0 session.cache_limiter= -session.bug_compat_42=1 -session.bug_compat_warn=0 session.serialize_handler=php session.save_handler=files --FILE-- diff --git a/ext/session/tests/010.phpt b/ext/session/tests/010.phpt index 9ece4e187ba..79638d283d7 100644 --- a/ext/session/tests/010.phpt +++ b/ext/session/tests/010.phpt @@ -5,8 +5,6 @@ $session_array = explode(";", session_encode()); should not segfault --INI-- session.use_cookies=0 session.cache_limiter= -session.bug_compat_42=1 -session.bug_compat_warn=0 --FILE-- ---INI-- -session.use_cookies=0 -session.cache_limiter= -session.bug_compat_42=1 -session.bug_compat_warn=0 -session.serialize_handler=php -session.save_handler=files ---FILE-- - ---EXPECT-- -I live diff --git a/ext/session/tests/013.phpt b/ext/session/tests/013.phpt index e67a115604c..8d0f284b173 100644 --- a/ext/session/tests/013.phpt +++ b/ext/session/tests/013.phpt @@ -5,8 +5,6 @@ redefining SID should not cause warnings --INI-- session.use_cookies=0 session.cache_limiter= -session.bug_compat_42=1 -session.bug_compat_warn=0 session.serialize_handler=php session.save_handler=files --FILE-- diff --git a/ext/session/tests/014.phpt b/ext/session/tests/014.phpt index 20273aea71d..297a885ccb3 100644 --- a/ext/session/tests/014.phpt +++ b/ext/session/tests/014.phpt @@ -6,8 +6,6 @@ a script should not be able to modify session.use_trans_sid session.use_trans_sid=1 session.use_cookies=0 session.cache_limiter= -session.bug_compat_42=1 -session.bug_compat_warn=0 session.name=PHPSESSID session.serialize_handler=php session.save_handler=files diff --git a/ext/session/tests/019.phpt b/ext/session/tests/019.phpt deleted file mode 100644 index 9e8037ac6c6..00000000000 --- a/ext/session/tests/019.phpt +++ /dev/null @@ -1,73 +0,0 @@ ---TEST-- -serializing references test case using globals ---SKIPIF-- - ---INI-- -session.use_cookies=0 -session.cache_limiter= -session.serialize_handler=php -session.save_handler=files ---FILE-- -c = $c; - } - function inc() { - $this->c++; - } -} - -session_id("abtest"); -session_start(); -$_SESSION['o1'] = $o1; -$_SESSION['o2'] = $o2; - -$o1 = new TFoo(42); -$o2 =& $o1; - -session_write_close(); - -unset($o1); -unset($o2); - -session_start(); - -var_dump($_SESSION); - -$o1->inc(); -$o2->inc(); - -var_dump($_SESSION); - -session_destroy(); -?> ---EXPECTF-- -array(2) { - ["o1"]=> - &object(TFoo)#%d (1) { - ["c"]=> - int(42) - } - ["o2"]=> - &object(TFoo)#%d (1) { - ["c"]=> - int(42) - } -} -array(2) { - ["o1"]=> - &object(TFoo)#%d (1) { - ["c"]=> - int(44) - } - ["o2"]=> - &object(TFoo)#%d (1) { - ["c"]=> - int(44) - } -} diff --git a/ext/session/tests/skipif.inc b/ext/session/tests/skipif.inc index 6e3eae0862c..2a9b012fce9 100644 --- a/ext/session/tests/skipif.inc +++ b/ext/session/tests/skipif.inc @@ -1,6 +1,6 @@