code/objects/Website.php
/**
     * Check for status of website, if no $response send a notification with the HTTP code.
     *
     * @return bool
     */
Check for status of website, if no $response send a notification with the HTTP code.
@return bool
Check for status of website if no $response send a notification with the HTTP code . @return bool
protected function currentStatus()
    {
        $curlInit = curl_init($this->URL);
        curl_setopt($curlInit, CURLOPT_CONNECTTIMEOUT, 10);
        curl_setopt($curlInit, CURLOPT_HEADER, true);
        curl_setopt($curlInit, CURLOPT_NOBODY, true);
        curl_setopt($curlInit, CURLOPT_RETURNTRANSFER, true);
        $response = curl_exec($curlInit);
        if (!$response) {
            $httpCode = curl_getinfo($curlInit, CURLINFO_HTTP_CODE);
            $didRecord = $this->recordError($httpCode);
            return false;
        }
        curl_close($curlInit);
        return true;
    }
protected function currentStatus ( ) { $ curlInit = curl_init ( $ this -> URL ) ; curl_setopt ( $ curlInit , CURLOPT_CONNECTTIMEOUT , 10 ) ; curl_setopt ( $ curlInit , CURLOPT_HEADER , true ) ; curl_setopt ( $ curlInit , CURLOPT_NOBODY , true ) ; curl_setopt ( $ curlInit , CURLOPT_RETURNTRANSFER , true ) ; $ response = curl_exec ( $ curlInit ) ; if ( ! $ response ) { $ httpCode = curl_getinfo ( $ curlInit , CURLINFO_HTTP_CODE ) ; $ didRecord = $ this -> recordError ( $ httpCode ) ; return false ; } curl_close ( $ curlInit ) ; return true ; }
Check for status of website, if no $response send a notification with the HTTP code.
Check for status of website if no $response send a notification with the HTTP code .