/** * Handles the fsock session. * * @param string URL to connect with * * @return Recipe_HTTP_Session_Fsock */ public function __construct($webpage) { parent::__construct($webpage); if (!function_exists("fsockopen") && ini_get("allow_url_fopen")) { throw new Recipe_Exception_Generic("The server does not allow to fetch contents from a different webpage."); } return $this; }
/** * Handles the cURL session. * * @param string URL to connect with * * @return Recipe_HTTP_Session_Curl */ public function __construct($webpage) { if (!function_exists("curl_init")) { throw new Recipe_Exception_Generic("The cURL library is not available on the server."); } parent::__construct($webpage); return $this; }