From 85eaa93dd692c2462ee019913675f5033f730300 Mon Sep 17 00:00:00 2001 From: saxmatt Date: Tue, 23 Dec 2003 21:31:09 +0000 Subject: [PATCH] Moved gzip stuff into options. git-svn-id: http://svn.automattic.com/wordpress/trunk@646 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/upgrade-072-to-080.php | 12 ++++++++++++ wp-blog-header.php | 5 ++--- wp-includes/functions.php | 11 +++++++++-- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/wp-admin/upgrade-072-to-080.php b/wp-admin/upgrade-072-to-080.php index aaf926c4c1..9d6c282a7b 100644 --- a/wp-admin/upgrade-072-to-080.php +++ b/wp-admin/upgrade-072-to-080.php @@ -115,6 +115,18 @@ if (!$wpdb->get_var("SELECT option_name FROM $tableoptions WHERE option_name = ' VALUES ('', '0', 'permalink_structure', 'Y', '3', '', '20', '8', 'How the permalinks for your site are constructed. See permalink options page for necessary mod_rewrite rules and more information.', '8');"); } + +if (!$wpdb->get_var("SELECT option_name FROM $tableoptions WHERE option_name = 'gzipcompression'")) { // If it's not already there + $wpdb->query("INSERT INTO `$tableoptions` + (`option_id`, `blog_id`, `option_name`, `option_can_override`, `option_type`, `option_value`, `option_width`, `option_height`, `option_description`, `option_admin_level`) + VALUES + ('', '0', 'gzipcompression', 'Y', '2', '0', '20', '8', 'Whether your output should be gzipped or not. Enable this if you don’t already have mod_gzip running.', '8');"); + $optionid = $wpdb->get_var("SELECT option_id FROM $tableoptions WHERE option_name = 'gzipcompression'"); + $wpdb->query("INSERT INTO $tableoptiongroup_options + (group_id, option_id, seq) + VALUES + (2, $optionid, 5)"); + } ?> Done with the name game. Now a little option action.

Now on to step 2.

diff --git a/wp-blog-header.php b/wp-blog-header.php index a87bbaf317..ec842d716f 100644 --- a/wp-blog-header.php +++ b/wp-blog-header.php @@ -1,7 +1,4 @@ = "4.0.4pl1") { - if(extension_loaded("zlib")) { ob_start("ob_gzhandler"); } + if(extension_loaded("zlib")) { + ob_start("ob_gzhandler"); + } } else if($phpver > "4.0") { if(strstr($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip')) { - if(extension_loaded("zlib")) { $do_gzip_compress = TRUE; ob_start(); ob_implicit_flush(0); header("Content-Encoding: gzip"); } + if(extension_loaded("zlib")) { + $do_gzip_compress = TRUE; + ob_start(); + ob_implicit_flush(0); + header("Content-Encoding: gzip"); + } } } //end gzip compression - that piece of script courtesy of the phpBB dev team $gzip_compressed=1;