}
}
+ if (Config::get('system', 'ipv4_resolve', false)) {
+ curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
+ }
+
if ($binary) {
@curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);
}
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
curl_setopt($ch, CURLOPT_USERAGENT, $a->get_useragent());
+ if (Config::get('system', 'ipv4_resolve', false)) {
+ curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
+ }
+
if (intval($timeout)) {
curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
} else {
$got_lock = false;
$start = time();
- if (function_exists('sem_get')) {
+ // The second parameter for "sem_acquire" doesn't exist before 5.6.1
+ if (function_exists('sem_get') && version_compare(PHP_VERSION, '5.6.1', '>=')) {
self::$semaphore[$fn_name] = sem_get(self::semaphoreKey($fn_name));
if (self::$semaphore[$fn_name]) {
return sem_acquire(self::$semaphore[$fn_name], ($timeout == 0));
* @param string $fn_name Name of the lock
*/
public static function remove($fn_name) {
- if (function_exists('sem_get')) {
+ if (function_exists('sem_get') && version_compare(PHP_VERSION, '5.6.1', '>=')) {
if (empty(self::$semaphore[$fn_name])) {
return false;
} else {