Order of knownDirectives and extensions

From: Date: Mon, 25 Oct 1999 18:11:24 +0000
Subject: Order of knownDirectives and extensions
Groups: php.dev 
Request: Send a blank email to php-dev+get-11889@lists.php.net to get a copy of this message
I'm posing this in the form of a question, as I don't know enough of the intended behavior of PHP to file this as a bug report. I am trying to code a shared extension, and took a look at php_mysql.c for guidance. The current php-ini.dist contains the following ;Windows Extensions ;extension=php_mysql.dll [MySQL] mysql.allow_persistent = On When I followed this example, my PHP_INI_MY function got called twice, both times with new_value=0. If I reversed the order of the entries in the ini file, the second call was passed the value from the ini file. Debugging the code, it appears that extension entries in the INI file are processed immediately. REGISTER_INI_ENTRIES will cause on_modify entries to be called and the entry name to be added to knownDirectives. Unfortunately, when processing of the ini file resumes, no checking is made for the subsequent entries against the knownDirectives. 1) Should processing of extensions be deferred until after parsing the configuration file is complete? 2) Should configuration-parser.y be modified to cause on_modify entries to be processed? The following logic appears to do the trick: if (parsing_mode==PARSING_MODE_CFG) { zend_hash_update(...); if (active_zend_hash_table == &configuration_hash) { php_alter_ini_entry(...) } } 3) Should the format of the ini files be modified to require extensions to be declared at the bottom (I personally don't care for this option) P.S. From what I can see, the [section] information in PHP INI files are just eye candy. Is this correct?

« previous php.dev (#11889) next »