Re: cvs: php4 /ext/sablot php_sablot.h

From: Date: Fri, 10 Aug 2001 13:12:02 +0000
Subject: Re: cvs: php4 /ext/sablot php_sablot.h
References: 1  Groups: php.cvs 
Request: Send a blank email to php-cvs+get-6705@lists.php.net to get a copy of this message
At 16:07 10-08-01, Rasmus Lerdorf wrote:
Keep trying. You still didn't get them all.
I'd appreciate some help as I don't have an environment to build this. It built just fine before you touched it. I don't agree with your changes.
You added bloat into php.h. The fact it built fine isn't relevant, this bloat had to go.
They don't have to name them at all. They should just be using the macros, and using them everywhere. That's the whole point of the macros - making changes at one centralized place. Having two sets of macros is simply a bad thing - 2x places to fix and more opportunities to mess up. Regardless, the way you committed sablot.c was a hybrid of using macros and not using them, which just happened to build because you defined a variable of a certain name. It was still conceptually wrong. ?? No more wrong than your mysql extension:
        STD_PHP_INI_BOOLEAN("mysql.allow_persistent",   "1",
PHP_INI_SYSTEM,         OnUpdateInt,
allow_persistent,       zend_mysql_globals,             mysql_globals)
        STD_PHP_INI_ENTRY_EX("mysql.max_persistent",    "-1",
PHP_INI_SYSTEM,         OnUpdateInt,
max_persistent,         zend_mysql_globals,             mysql_globals,
display_link_numbers)
        STD_PHP_INI_ENTRY_EX("mysql.max_links",                 "-1",
PHP_INI_SYSTEM,         OnUpdateInt,            max_links,
zend_mysql_globals,             mysql_globals,  display_link_numbers)
        STD_PHP_INI_ENTRY("mysql.default_host",                 NULL,
PHP_INI_ALL,            OnUpdateString,         default_host,
zend_mysql_globals,             mysql_globals)
        STD_PHP_INI_ENTRY("mysql.default_user",                 NULL,
PHP_INI_ALL,            OnUpdateString,         default_user,
zend_mysql_globals,             mysql_globals)
        STD_PHP_INI_ENTRY("mysql.default_password",             NULL,
PHP_INI_ALL,            OnUpdateString,         default_password,
zend_mysql_globals,             mysql_globals)
        STD_PHP_INI_ENTRY("mysql.default_socket",               NULL,
PHP_INI_ALL,            OnUpdateStringUnempty,  default_socket,
zend_mysql_globals,             mysql_globals)
static void php_mysql_init_globals(zend_mysql_globals *mysql_globals) This happens to work because you happened to name them zend_mysql_globals. I don't see how what I did in sablot.c was different from this at all. In fact it was identical to that.
Again, making a bad situation worse is not a good thing. I never said that my code's perfect, and indeed there are some places where there's still direct reference to auto-defined variable names, which is not a good thing. Instead of making the situation worse though, when I face something like this, I tend to try and improve it. Zeev

« previous php.cvs (#6705) next »