I wouldn’t cause the plugin to die like that. Just check for cURL each time you need to make a call or fall back on wp_remote_(post|get)
(eg. write a wrapper function that takes care of the check and send the data/headers you want).
BUT, if you really really want to disable the plugin if cURL is not installed, you can use an activation hook to check for the curl_exec
function and deactivate the plugin if not.
<?php
register_activation_hook(__FILE__, 'wpse51312_activation');
function wpse51312_activation()
{
if(!function_exists('curl_exec'))
{
// Deactivate the plugin
deactivate_plugins(__FILE__);
// Show the error page, Maybe this shouldn't happen?
wp_die(
__('You must enable cURL support to use INSERT PLUGIN NAME'),
__('Error')
);
}
}
For what it’s worth, I believe that the HTTP api tries to use cURL if it’s available.