Possible mentors: Brian Shire, Andrei Zmievski
Currently, PHP extensions that have dependencies on other extensions use compile-time configure checks to verify availability. This has several problems:
/* expose API to other extensions * we'll be exposing a fetch() function and a store() function * from our extension. This could be any calls we want to expose. * extension_api_t is a custom structure for this extension with * function pointers defining this extension's API. */ struct extension_api_t api; api.version = 1; api.fetch = my_fetch; api.store = my_store; php_register_api(&api)
/* fetch external extension API */ int rval; int version = 2; struct extension_api_t *api; rval = php_get_api('myextension', version, &api); if (rval == PHP_EXT_UNAVAIL) { zend_error(E_WARNING, "myextension is not loaded or available, disabling feature"); return NULL; } else if (rval == PHP_EXT_NOVERSION) { zend_error(E_WARNING, "myextension version %d is required, disabling feature", version); return NULL; } else { return api->fetch(key); }
Unknown.
Unknown.