Esempio n. 1
0
 /**
  * Whether this class can be used for retrieving an URL.
  *
  * @static
  * @access public
  * @since 2.7.0
  *
  * @return boolean False means this class can not be used, true means it can.
  */
 public static function test(\Leeflets\Hook $hook, $args = array())
 {
     if (!function_exists('fopen')) {
         return false;
     }
     if (!function_exists('ini_get') || true != ini_get('allow_url_fopen')) {
         return false;
     }
     $is_ssl = isset($args['ssl']) && $args['ssl'];
     if ($is_ssl && !extension_loaded('openssl')) {
         return false;
     }
     return $hook->apply('use_streams_transport', true, $args);
 }
Esempio n. 2
0
 /**
  * Whether this class can be used for retrieving an URL.
  *
  * @static
  * @since 2.7.0
  *
  * @return boolean False means this class can not be used, true means it can.
  */
 public static function test(\Leeflets\Hook $hook, $args = array())
 {
     if (!function_exists('curl_init') || !function_exists('curl_exec')) {
         return false;
     }
     $is_ssl = isset($args['ssl']) && $args['ssl'];
     if ($is_ssl) {
         $curl_version = curl_version();
         if (!(CURL_VERSION_SSL & $curl_version['features'])) {
             // Does this cURL version support SSL requests?
             return false;
         }
     }
     return $hook->apply('use_curl_transport', true, $args);
 }
Esempio n. 3
0
 /**
  * Whether this class can be used for retrieving an URL.
  *
  * @since 2.7.0
  * @static
  * @return boolean False means this class can not be used, true means it can.
  */
 public static function test(\Leeflets\Hook $hook, $args = array())
 {
     if (!function_exists('fsockopen')) {
         return false;
     }
     //if ( false !== ( $option = get_option( 'disable_fsockopen' ) ) && time() - $option < 12 * HOUR_IN_SECONDS )
     //return false;
     $is_ssl = isset($args['ssl']) && $args['ssl'];
     if ($is_ssl && !extension_loaded('openssl')) {
         return false;
     }
     return $hook->apply('use_fsockopen_transport', true, $args);
 }