Ejemplo n.º 1
0
	/**
	 * Returns true if the current request was initiated by Ajax.
	 *
	 * @return bool
	 */
	public static function isAjaxRequest()
	{
		if (self::$isAjaxRequest === null)
		{
			self::$isAjaxRequest = (
				(isset($_SERVER["HTTP_BX_CACHE_MODE"]) && $_SERVER["HTTP_BX_CACHE_MODE"] === "HTMLCACHE")
				||
				(defined("CACHE_MODE") && constant("CACHE_MODE") === "HTMLCACHE")
			);
		}

		return self::$isAjaxRequest;
	}