本文整理汇总了PHP中Browser::singleton方法的典型用法代码示例。如果您正苦于以下问题:PHP Browser::singleton方法的具体用法?PHP Browser::singleton怎么用?PHP Browser::singleton使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Browser
的用法示例。
在下文中一共展示了Browser::singleton方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: allowOutputCompression
/**
* 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';
}
示例2: nocacheUrl
/**
* 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;
}
}
示例3: ini_set
*
* 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();