Beispiel #1
0
        // redefine
        $timeout = (int) $timeout;
        // validate
        if ($timeout == 0) {
            throw new Exception('Invalid timeout. Timeout shouldn\'t be 0.');
        }
        // set property
        self::$timeout = $timeout;
    }
    /**
     * Set the user agent
     *
     * @return	void
     * @param	string $newUserAgent
     */
    public static function setUserAgent($newUserAgent)
    {
        self::$userAgent .= ' ' . (string) $newUserAgent;
    }
    /**
     * Set a new object to use as ServerListCache
     * @param ServerListCache $cache
     */
    public static function setServerListCache($cache)
    {
        self::$serverListCache = $cache;
    }
}
$cachefile = dirname(__FILE__) . '/servers.txt';
Mollom::setServerListCache(new ServerListFileCache($cachefile));