Re: How do I make a dependency on the sockets extension?

From: Date: Sun, 08 Sep 2013 14:54:48 +0000
Subject: Re: How do I make a dependency on the sockets extension?
References: 1 2 3 4 5 6 7 8 9 10 11  Groups: php.pecl.dev 
Request: Send a blank email to pecl-dev+get-11034@lists.php.net to get a copy of this message
On Sun, 2013-09-08 at 18:05 +0500, Ruslan Osmanov wrote: > Let's note, that no code can use sockets' API until HAVE_SOCKETS defined. > Thus, sockets' API is not available, if PHP is built with --disable-sockets. > > Then it doesn't matter whether we installed sockets separately. The > header code is just not available. So what should we do? The only answer I see is to > define HAVE_SOCKETS ourselves manually. Isn't it? $ cd ext/sockets/ $ ls $ phpize $ ./configure $ make $ sudo make install $ ls php-config --include-dir/ext/sockets php_sockets.h Also distributions build PHP in all "weird" ways possible, a good distribution provides the headers, many even distribute all possible headers in a common php-devel package, independently from whether an extension package is installed or not. So again, during configure one can check for the existence of the header to do the compilation, not more. > It even might be normal, if we had a macro able to determine whether > sockets ext. is installed. Let's imagine the pear installer modified/added some C > header file which is included in some common header like main/php_config.h. Then we > might use some macro which might try to include/compile and eventually determine > whether we have sockets extension installed. This won't easily work with distributions and serve no purpose as it won't guarantee a thing about a later running PHP. johannes

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