summaryrefslogtreecommitdiffstats
path: root/system/core
diff options
context:
space:
mode:
authorThor (atiredmachine) <thor@bandwidthbeta.com>2012-01-25 07:19:14 +0100
committerThor (atiredmachine) <thor@bandwidthbeta.com>2012-01-25 07:19:14 +0100
commitf59ec6fe4fab3bd5ff71d920e13f983454a9fb65 (patch)
tree5fee6e81c93c945a793da8e9b404e696d7889b76 /system/core
parent5de117549f69465a1ce0f2e128428d9adadd8a6d (diff)
Logs 'debug' message that shows how much % was shaved off.
Diffstat (limited to 'system/core')
-rwxr-xr-xsystem/core/Output.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/system/core/Output.php b/system/core/Output.php
index 8992fc1f1..c95f551ec 100755
--- a/system/core/Output.php
+++ b/system/core/Output.php
@@ -582,7 +582,9 @@ class CI_Output {
switch ($type)
{
case 'text/html':
-
+
+ $size_before = strlen($output);
+
// Keep track of <pre> <code> and <textarea> tags as
// they were before processing.
// We'll want to return them to this state later.
@@ -613,6 +615,11 @@ class CI_Output {
$output = str_replace($pres_messed[0],$pres_clean[0],$output);
$output = str_replace($codes_messed[0],$codes_clean[0],$output);
$output = str_replace($textareas_messed[0],$textareas_clean[0],$output);
+
+ $size_after = strlen($output);
+ $savings_percent = round(100 - ($size_after / $size_before * 100));
+
+ log_message('debug', 'Minifier shaved '.$savings_percent.'% off HTML output size.');
break;