Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_API.c

From: Date: Mon, 19 Jan 2004 11:15:24 +0000
Subject: Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_API.c
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to internals+get-7183@lists.php.net to get a copy of this message
The win32 build will correctly order extensions for internal_functions.c, so that solves static compiles, but that doesn't help dynamic loading (nor the unix build). Would it be ok to keep Marcus' function so that a wise extension can check if things were loaded in the correct order? Maybe adjust it a little: ZEND_API int zend_check_dependent_modules(char *mymodule, int num_modules, ...) { va_list ap; char *module_name; int i; zend_module_entry *module; va_start(ap, num_modules); for (i = 0; i < num_modules; i++) { module_name = va_arg(ap, char*); if (FAILURE == zend_hash_find(&module_registry, module_name, strlen(module_name)+1, (void**)&module) || !module->module_started) { zend_error(E_ERROR, "extension `%s' must be loaded before %s", module_name, mymodule); } } va_end(ap); return SUCCESS; } Even better would be to add an array of module names into the module structure and have the ZE apply this check when it loads the module. I think that it is reasonably important to warn the user that things will break if we can detect it. --Wez. ----- Original Message ----- From: "Andi Gutmans" <andi@zend.com> To: "Marcus Boerger" <helly@php.net> Cc: "Marcus Boerger" <helly@php.net>; <zend-engine-cvs@lists.php.net> Sent: Monday, January 19, 2004 8:40 AM Subject: Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_API.c > At 09:34 AM 1/19/2004 +0100, Marcus Boerger wrote: > >Hello Andi, > > > >Monday, January 19, 2004, 9:29:50 AM, you wrote: > > > > > Marcus, > > > > > This is something for autoconf and not for run-time. I see no reason for > > > this hack! > > > Similar things have been done like this in the past. > > > Andi > > > >Wouldn't autoconf not only change the order of compiling? > > No. Check out main/internal_functions.c. That's the order extensions are > loaded.

« previous php.internals (#7183) next »