How do I make a dependency on the sockets extension?

From: Date: Fri, 06 Sep 2013 09:02:44 +0000
Subject: How do I make a dependency on the sockets extension?
Groups: php.pecl.dev 
Request: Send a blank email to pecl-dev+get-11019@lists.php.net to get a copy of this message
Hi, I wonder what is the right way to make a dependency on another extension. Particularly, in my ext. I use PHPAPI php_sockets_le_socket() function and php_socket structure both declared in ext/sockets/php_sockets.h. The function should be resolved at run-time, and I might even declare some extern prototype. But I also need the php_socket struct. Obviously, I have to include ext/sockets/php_sockets.h: #if PHP_VERSION_ID >= 50301 && (HAVE_SOCKETS || defined(COMPILE_DL_SOCKETS)) # include <ext/sockets/php_sockets.h> # define PHP_EVENT_SOCKETS_SUPPORT #endif Sockets extension is optional, so I do the following in config.m4: PHP_ADD_EXTENSION_DEP(event, sockets, true) and the following in C: static const zend_module_dep event_deps[] = {
    ZEND_MOD_OPTIONAL("sockets")
    {NULL, NULL, NULL}
}; However, it won't work if the sockets extension is built separately, for instance. Please, give me advice, what should I reply to this bug: https://bugs.php.net/bug.php?id=65597 . Would it be fixed, if I make "sockets" required? Regards. -- Ruslan Osmanov

« previous php.pecl.dev (#11019) next »