Example #1
0
function get_reader_config()
{
    $config = new ReaderConfig();
    $config->setTimezone(get('timezone'));
    // Client
    $config->setClientTimeout(HTTP_TIMEOUT);
    $config->setClientUserAgent(HTTP_USER_AGENT);
    $config->setGrabberUserAgent(HTTP_USER_AGENT);
    // Proxy
    $config->setProxyHostname(PROXY_HOSTNAME);
    $config->setProxyPort(PROXY_PORT);
    $config->setProxyUsername(PROXY_USERNAME);
    $config->setProxyPassword(PROXY_PASSWORD);
    // Filter
    $config->setFilterIframeWhitelist(get_iframe_whitelist());
    if ((bool) get('debug_mode')) {
        Logger::enable();
    }
    // Parser
    $config->setParserHashAlgo('crc32b');
    return $config;
}