|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-04-05 04:45 UTC] kyrael at web dot de
Taken from php.ini-dist: ; Define the probability that the 'garbage collection' process is started ; on every session initialization. ; The probability is calculated by using gc_probability/gc_dividend, ; e.g. 1/100 means 1%. session.gc_probability = 1 session.gc_dividend = 100 Is this really true? Because, if it really was that way, gc_dividend should be named gc_divisor... dividend is the latin form for something to be divided. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 19:00:02 2025 UTC |
That is a typo in the php4/php.ini-dist that comes from a typo in the code in php4/ext/session/session.c (introduced in revision 1.329) The 'diff -u' output for the fixes is below: $ diff -u php4/php.ini-dist-orig php4/php.ini-dist --- php4/php.ini-dist-orig 2003-04-05 02:51:07.000000000 -0800 +++ php4/php.ini-dist 2003-04-05 02:56:01.000000000 -0800 @@ -850,11 +850,11 @@ ; Define the probability that the 'garbage collection' process is started ; on every session initialization. -; The probability is calculated by using gc_probability/gc_dividend, +; The probability is calculated by using gc_probability/gc_divisor, ; e.g. 1/100 means 1%. session.gc_probability = 1 -session.gc_dividend = 100 +session.gc_divisor = 100 ; After this number of seconds, stored data will be seen as 'garbage' and ; cleaned up by the garbage collection process. $ diff -u php4/ext/session/session.c-orig php4/ext/session/session.c --- php4/ext/session/session.c-orig 2003-04-05 02:57:33.000000000 -0800 +++ php4/ext/session/session.c 2003-04-05 02:58:04.000000000 -0800 @@ -138,7 +138,7 @@ PHP_INI_ENTRY("session.save_handler", "files", PHP_INI_ALL, OnUpdateSaveHandler) STD_PHP_INI_BOOLEAN("session.auto_start", "0", PHP_INI_ALL, OnUpdateBool, auto_start, php_ps_globals, ps_globals) STD_PHP_INI_ENTRY("session.gc_probability", "1", PHP_INI_ALL, OnUpdateLong, gc_probability, php_ps_globals, ps_globals) - STD_PHP_INI_ENTRY("session.gc_dividend", "100", PHP_INI_ALL, OnUpdateLong, gc_dividend, php_ps_globals, ps_globals) + STD_PHP_INI_ENTRY("session.gc_divisor", "100", PHP_INI_ALL, OnUpdateLong, gc_divisor, php_ps_globals, ps_globals) STD_PHP_INI_ENTRY("session.gc_maxlifetime", "1440", PHP_INI_ALL, OnUpdateLong, gc_maxlifetime, php_ps_globals, ps_globals) PHP_INI_ENTRY("session.serialize_handler", "php", PHP_INI_ALL, OnUpdateSerializer) STD_PHP_INI_ENTRY("session.cookie_lifetime", "0", PHP_INI_ALL, OnUpdateLong, cookie_lifetime, php_ps_globals, ps_globals) @@ -1154,7 +1154,7 @@ if (PS(mod_data) && PS(gc_probability) > 0) { int nrdels = -1; - nrand = (int) ((float) PS(gc_dividend) * php_combined_lcg(TSRMLS_C)); + nrand = (int) ((float) PS(gc_divisor) * php_combined_lcg(TSRMLS_C)); if (nrand < PS(gc_probability)) { PS(mod)->s_gc(&PS(mod_data), PS(gc_maxlifetime), &nrdels TSRMLS_CC); #if 0