Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:2099 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 71714 invoked from network); 30 May 2003 23:18:25 -0000 Received: from unknown (HELO mailout08.sul.t-online.com) (194.25.134.20) by pb1.pair.com with SMTP; 30 May 2003 23:18:25 -0000 Received: from fwd09.sul.t-online.de by mailout08.sul.t-online.com with smtp id 19Lt8j-0008Ay-02; Sat, 31 May 2003 01:18:25 +0200 Received: from vega.thetaphi.de (320003461825-0001@[217.229.51.188]) by fmrl09.sul.t-online.com with esmtp id 19Lt8c-1qhrtIC; Sat, 31 May 2003 01:18:18 +0200 Message-ID: <5.2.0.9.0.20030531011141.02af1838@pop3.web.de> X-Mailer: QUALCOMM Windows Eudora Version 5.2.0.9 Date: Sat, 31 May 2003 01:18:17 +0200 To: internals@lists.php.net Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Sender: 320003461825-0001@t-dialin.net Subject: OnXXXXX handlers not called in ZTS environment From: uwe@thetaphi.de (Uwe Schindler) When changing a ini entry with zend_alter_ini_entry during runtime the Callback routines OnUpdateXXXX are never called. This problem only exists in multithreaded environments. I think that the handler field in the entry is not copied when creating the copy of the ini entries after creating a new thread ressource: #ifdef ZTS ZEND_API int zend_copy_ini_directives(TSRMLS_D) { zend_ini_entry ini_entry; EG(ini_directives) = (HashTable *) malloc(sizeof(HashTable)); if (zend_hash_init_ex(EG(ini_directives), registered_zend_ini_directives->nNumOfElements, NULL, NULL, 1, 0)==FAILURE) { return FAILURE; } zend_hash_copy(EG(ini_directives), registered_zend_ini_directives, NULL, &ini_entry, sizeof(zend_ini_entry)); zend_ini_refresh_caches(ZEND_INI_STAGE_STARTUP TSRMLS_CC); return SUCCESS; } #endif I am not very familar with the Zend engine so I do not know how to implement this, but the following command does not ever call the OnUpdate handler: zend_alter_ini_entry(....., PHP_INI_SYSTEM, PHP_INI_STAGE_RUNTIME) Uwe