/** * Determines if output compression can be used. * * @return boolean True if output compression can be used, false if not. */ function allowOutputCompression() { require_once 'Horde/Browser.php'; $browser =& Browser::singleton(); /* Turn off compression for buggy browsers. */ if ($browser->hasQuirk('buggy_compression')) { return false; } return ini_get('zlib.output_compression') == '' && ini_get('zend_accelerator.compress_all') == '' && ini_get('output_handler') != 'ob_gzhandler'; }
/** * Returns a url with the 'nocache' parameter added, if the browser is * buggy and caches old URLs. * * @param string $url The URL to modify. * @param boolean $encode Encode the argument separator? (since * Horde 3.2) * * @return string The requested URI. */ function nocacheUrl($url, $encode = true) { static $rand_num; require_once 'Horde/Browser.php'; $browser =& Browser::singleton(); /* We may need to set a dummy parameter 'nocache' since some * browsers do not always honor the 'no-cache' header. */ if ($browser->hasQuirk('cache_same_url')) { if (!isset($rand_num)) { $rand_num = base_convert(microtime(), 10, 36); } return Util::addParameter($url, 'nocache', $rand_num, $encode); } else { return $url; } }
* * See the enclosed file COPYING for license information (LGPL). If you * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html. */ /* Turn PHP stuff off that can really screw things up. */ ini_set('magic_quotes_sybase', 0); ini_set('magic_quotes_runtime', 0); // Define the include prefix for all Horde libaries. This should be // empty if you have the libraries installed in your include path, // either through the PEAR installer or otherwise. If you are using a // tarball distribution, or a custom version of Horde, it should // probably set to dirname(__FILE__). // // This path MUST end in a trailing slash, or be entirely empty. // // Explicitly check for prior definitions so as to allow prepend_file // customizations. if (!defined('HORDE_LIBS')) { define('HORDE_LIBS', ''); } // Horde core classes. include_once HORDE_LIBS . 'Horde.php'; include_once HORDE_LIBS . 'Horde/Registry.php'; include_once HORDE_LIBS . 'Horde/String.php'; include_once HORDE_LIBS . 'Horde/Notification.php'; include_once HORDE_LIBS . 'Horde/Auth.php'; include_once HORDE_LIBS . 'Horde/Browser.php'; include_once HORDE_LIBS . 'Horde/Perms.php'; // Browser detection object. $browser =& Browser::singleton();