protected function getUrlContent($url)
    {
        $contents = '';
        $time = (int) self::MAX_TIMEOUT_MINS * 60;

        $timeout = stream_context_create(array(
            'http' => array(
                'timeout' => $time,
            ),
        ));
        set_time_limit($time);
        ini_set('max_execution_time', $time);

        // check if the URL is valid
        if($this->isValidUrl($url)) {
            // make sure we are not getting 404 when accessing the page
            if( (int) $this->getUrlStatus($url) != self::HTTP_NOT_OK ) {
                // ge the contents of the page
                $contents = @file_get_contents($url, false, $timeout);

                // if the contents has results
                if($contents === true) {
                    // convert encodings
                    $contents = mb_convert_encoding($contents, 'HTML-ENTITIES', self::ENCODING);
                }
            }
        }



        return $contents;
    }
protected function getUrlContent($url)
    {
        $contents = '';
        $time = (int) self::MAX_TIMEOUT_MINS * 60;

        $timeout = stream_context_create(array(
            'http' => array(
                'timeout' => $time,
            ),
        ));
        set_time_limit($time);
        ini_set('max_execution_time', $time);

        // check if the URL is valid
        if($this->isValidUrl($url)) {
            // make sure we are not getting 404 when accessing the page
            if( (int) $this->getUrlStatus($url) != self::HTTP_NOT_OK ) {
                // ge the contents of the page
                $contents = @file_get_contents($url, false, $timeout);

                // if the contents has results
                if($contents === true) {
                    // convert encodings
                    $contents = mb_convert_encoding($contents, 'HTML-ENTITIES', self::ENCODING);
                }
            }
        }



        return $contents;
    }
protected function getUrlContent ( $ url ) { $ contents = '' ; $ time = ( int ) self :: MAX_TIMEOUT_MINS * 60 ; $ timeout = stream_context_create ( array ( 'http' => array ( 'timeout' => $ time , ) , ) ) ; set_time_limit ( $ time ) ; ini_set ( 'max_execution_time' , $ time ) ; // check if the URL is valid if ( $ this -> isValidUrl ( $ url ) ) { // make sure we are not getting 404 when accessing the page if ( ( int ) $ this -> getUrlStatus ( $ url ) != self :: HTTP_NOT_OK ) { // ge the contents of the page $ contents = @ file_get_contents ( $ url , false , $ timeout ) ; // if the contents has results if ( $ contents === true ) { // convert encodings $ contents = mb_convert_encoding ( $ contents , 'HTML-ENTITIES' , self :: ENCODING ) ; } } } return $ contents ; }
Retrieves the content of the given url
@param String $url
Retrieves the content of the given url