/** * This is the constractor function. It checks the all the requirements * before creating the object, including php version checking. * * ### Warning * * @param int $timeOut provide the timeout in seconds. * (Leave it or set it to null if you do not know what you are doing, risky.) * @param string $userAgent provide a valid user agent. * (Same here, leave it or set it to null if you do not know what you are doing, risky.) */ public function __construct($timeOut = null, $userAgent = null) { if ($timeOut >= 0) { self::$timeout = $timeOut; } if (is_string($userAgent)) { self::$userAgent = $userAgent; } //now check the php version. if (version_compare(PHP_VERSION, '5.3', '<')) { trigger_error("PHP version 5.3+ require."); } if (!function_exists('curl_init')) { trigger_error("curl extention require to run."); } }