|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2012-01-04 17:25 UTC] astewart at online-buddies dot com
Description: ------------ Like #59564. Neither of the workarounds in that work for us: session is compiled in statically, but APC is a module, so we can't reorder them relative to each other, and an append doesn't work, and doesn't work with scripts that call exit() PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 20 21:00:02 2025 UTC |
This is actual in 5.3.10 as well. Simple code to reproduce (will log fatal errors about undefined class constant 'logging'): <?php $session = new XSession(); session_set_save_handler(array($session, 'open'), array($session, 'close'), array($session, 'read'), array($session, 'write'), array($session, 'destroy'), array($session, 'gc')); session_start(); class XSession { const logging = false; function open() {if (self::logging) echo 'OK';} function write() {if (self::logging) echo 'OK';} function read() {if (self::logging) echo 'OK';} function close() {if (self::logging) echo 'OK';} function destroy() {if (self::logging) echo 'OK';} function gc() {if (self::logging) echo 'OK';} }You should be able to work around this with register_shutdown_function('session_write_close'), or if using a class like in gedrox's example and PHP >= 5.4 you can make it implement SessionHandlerInterface and just call session_set_save_handler($session) which should also take care of this. I'm afraid it's a chicken and egg problem and if the above workarounds don't work either then I don't see a practical solution.