From cc5e798aa47467477d1574428bbf77030d221562 Mon Sep 17 00:00:00 2001 From: Jan Schneider Date: Thu, 13 Aug 2009 00:45:52 +0200 Subject: [PATCH] MFB: Start output compression conditionally (Bug #7769). --- chora/lib/base.php | 7 ++++++- ingo/lib/base.php | 5 ++++- kronolith/lib/base.php | 5 ++++- nag/lib/base.php | 7 ++++++- turba/lib/base.php | 5 ++++- 5 files changed, 24 insertions(+), 5 deletions(-) diff --git a/chora/lib/base.php b/chora/lib/base.php index 7b7435ca8..c193f371d 100644 --- a/chora/lib/base.php +++ b/chora/lib/base.php @@ -4,6 +4,9 @@ * * This file brings in all of the dependencies that every Chora script * will need, and sets up objects that all scripts use. + * + * The following global variables are used: + * $no_compress - Controls whether the page should be compressed */ $chora_dir = dirname(__FILE__); @@ -47,4 +50,6 @@ $notification->attach('status'); Chora::initialize(); // Start compression. -Horde::compressOutput(); +if (!Util::nonInputVar('no_compress')) { + Horde::compressOutput(); +} diff --git a/ingo/lib/base.php b/ingo/lib/base.php index 5a29e3973..d8522bee8 100644 --- a/ingo/lib/base.php +++ b/ingo/lib/base.php @@ -15,6 +15,7 @@ * Global variables defined: * $ingo_shared - TODO * $ingo_storage - The Ingo_Storage:: object to use for storing rules. + * $no_compress - Controls whether the page should be compressed * * See the enclosed file LICENSE for license information (ASL). If you * did not receive this file, see http://www.horde.org/licenses/asl.php. @@ -44,7 +45,9 @@ $notification = Horde_Notification::singleton(); $notification->attach('status'); // Start compression. -Horde::compressOutput(); +if (!Util::nonInputVar('no_compress')) { + Horde::compressOutput(); +} // Load the Ingo_Storage driver. It appears in the global variable // $ingo_storage. diff --git a/kronolith/lib/base.php b/kronolith/lib/base.php index 68ae6f515..75c4e2ac5 100644 --- a/kronolith/lib/base.php +++ b/kronolith/lib/base.php @@ -14,6 +14,7 @@ * 'none' - Do not start a session * 'readonly' - Start session readonly * [DEFAULT] - Start read-write session + * $no_compress - Controls whether the page should be compressed * * * @package Kronolith @@ -51,7 +52,9 @@ $notification = Horde_Notification::singleton(); $GLOBALS['kronolith_notify'] = $notification->attach('status', null, 'Kronolith_Notification_Listener_Status'); /* Start compression. */ -Horde::compressOutput(); +if (!Util::nonInputVar('no_compress')) { + Horde::compressOutput(); +} /* Set the timezone variable, if available. */ Horde_Nls::setTimeZone(); diff --git a/nag/lib/base.php b/nag/lib/base.php index 69c21f9a7..760ff8ab2 100644 --- a/nag/lib/base.php +++ b/nag/lib/base.php @@ -4,6 +4,9 @@ * * This file brings in all of the dependencies that every Nag * script will need and sets up objects that all scripts use. + * + * The following global variables are used: + * $no_compress - Controls whether the page should be compressed */ // Determine BASE directories. @@ -38,7 +41,9 @@ $notification = Horde_Notification::singleton(); $notification->attach('status', null, 'Nag_Notification_Listener_Status'); // Start compression. -Horde::compressOutput(); +if (!Util::nonInputVar('no_compress')) { + Horde::compressOutput(); +} // Set the timezone variable. Horde_Nls::setTimeZone(); diff --git a/turba/lib/base.php b/turba/lib/base.php index 3d553584c..067921717 100644 --- a/turba/lib/base.php +++ b/turba/lib/base.php @@ -10,6 +10,7 @@ * $ingo_authentication - The type of authentication to use: * 'none' - Do not authenticate * [DEFAULT] - Authenticate; on failed auth redirect to login screen + * $no_compress - Controls whether the page should be compressed * */ @@ -97,4 +98,6 @@ foreach ($copymoveSources as $key => $curSource) { $GLOBALS['addSources'] = $addSources; // Start compression, if requested. -Horde::compressOutput(); +if (!Util::nonInputVar('no_compress')) { + Horde::compressOutput(); +} -- 2.11.0