Skip to content

Commit ec50b17

Browse files
authored
Update ext/session spl dependency (#14410)
The spl dependency is configured so the spl_autoload_register is available when session_start() is used, meaning the spl extension needs to be loaded before the session. It is marked as optional to be more explicit as spl is not directly used nor required in the session extension.
1 parent 4fca8a6 commit ec50b17

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

ext/session/config.m4

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ if test "$PHP_SESSION" != "no"; then
1515
PHP_PWRITE_TEST
1616
PHP_PREAD_TEST
1717
PHP_NEW_EXTENSION(session, mod_user_class.c session.c mod_files.c mod_mm.c mod_user.c, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
18-
PHP_ADD_EXTENSION_DEP(session, spl)
18+
dnl https://bugs.php.net/53141
19+
PHP_ADD_EXTENSION_DEP(session, spl, true)
1920
PHP_SUBST(SESSION_SHARED_LIBADD)
2021
PHP_INSTALL_HEADERS([ext/session], [php_session.h mod_files.h mod_user.h])
2122
AC_DEFINE(HAVE_PHP_SESSION,1,[ ])

ext/session/config.w32

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ ARG_ENABLE("session", "session support", "yes");
44

55
if (PHP_SESSION == "yes") {
66
EXTENSION("session", "mod_user_class.c session.c mod_files.c mod_mm.c mod_user.c", false /* never shared */, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
7+
// https://bugs.php.net/53141
8+
ADD_EXTENSION_DEP('session', 'spl', true);
79
AC_DEFINE("HAVE_PHP_SESSION", 1, "Session support");
810
PHP_INSTALL_HEADERS("ext/session", "mod_mm.h php_session.h mod_files.h mod_user.h");
911
}

ext/session/session.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2998,7 +2998,7 @@ static PHP_MINFO_FUNCTION(session) /* {{{ */
29982998
/* }}} */
29992999

30003000
static const zend_module_dep session_deps[] = { /* {{{ */
3001-
ZEND_MOD_REQUIRED("spl")
3001+
ZEND_MOD_OPTIONAL("spl")
30023002
ZEND_MOD_END
30033003
};
30043004
/* }}} */

0 commit comments

Comments
 (0)