? boost-204174.patch Index: boost.admin.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/boost/boost.admin.inc,v retrieving revision 1.1.2.1.2.3.2.22 diff -u -p -r1.1.2.1.2.3.2.22 boost.admin.inc --- boost.admin.inc 6 Jun 2009 07:50:23 -0000 1.1.2.1.2.3.2.22 +++ boost.admin.inc 8 Jun 2009 02:30:14 -0000 @@ -16,38 +16,27 @@ */ function boost_admin_settings($form = array()) { // Take over the relevant existing settings - $form['#title'] = t('Static page cache'); - $form['cache'] = array('#type' => 'hidden','#value' => CACHE_DISABLED); - unset($form['page_compression']); // we don't support this - // Inject Boost-specific settings + $form['boost'] = array( '#type' => 'radios', - '#title' => t('Static page cache'), + '#title' => t('Boost - Static page cache'), '#default_value' => variable_get('boost', CACHE_DISABLED), '#options' => array(CACHE_DISABLED => t('Disabled'), 1 => t('Enabled')), '#description' => t('Static page caching is a mechanism that stores dynamically generated web pages as HTML files in a special cache directory located under the Drupal installation directory. By caching a web page in this manner, the web server can serve it out in the fastest possible manner, without invoking PHP or Drupal at all. While this does provide a significant performance and scalability boost, you should note that it could have negative usability side-effects unless your site is targeted at an audience consisting mostly of "anonymous" visitors.'), '#weight' => -10, ); - $form['boost_file_path'] = array( - '#type' => 'textfield', - '#title' => t('Cache file path'), - '#default_value' => BOOST_FILE_PATH, - '#size' => 60, - '#maxlength' => 255, - '#required' => TRUE, - '#description' => t('A file system path where the static cache files will be stored. This directory has to exist and be writable by Drupal. The default setting is to store the files in a directory named %default-path under the Drupal installation directory. If you change this, you must also change the URL rewrite rules in your web server configuration (.htaccess for Apache, lighttpd.conf for Lighttpd), or caching will not work.', array('%default-path' => boost_cache_directory(NULL, FALSE))), - '#weight' => -5, + $form['cache'] = array( + '#type' => 'radios', + '#title' => t('Core - Database page cache'), + '#default_value' => variable_get('cache', CACHE_DISABLED), + '#options' => array(CACHE_DISABLED => t('Disabled'), CACHE_NORMAL => t('Normal')), + '#description' => t("If boost can not or will not cache the page, then the database will try to cache it. If boost can cache the page then it will not appear in the database cache. This is the standard Drupal cache."), + '#weight' => -8, ); $period = drupal_map_assoc(array(0, 60, 180, 300, 600, 900, 1800, 2700, 3600, 10800, 21600, 32400, 43200, 64800, 86400, 2*86400, 3*86400, 4*86400, 5*86400, 6*86400, 7*86400, 14*86400, 21*86400, 28*86400), 'format_interval'); $period[0] = t('none'); $form['cache_lifetime']['#options'] = $period; - $form['boost_gzip'] = array( - '#type' => 'checkbox', - '#title' => t('Gzip cached pages'), - '#default_value' => BOOST_GZIP, - '#description' => t('This reduces bandwith used and allows for faster page loads. The full effects of this setting do no take place until the cache has been cleared and .htaccess has the correct set of rules in place.'), - ); // Cacheability settings // TODO: update to use Drupal 6.x core code. @@ -59,13 +48,13 @@ function boost_admin_settings($form = ar } $form['cacheability'] = array( '#type' => 'fieldset', - '#title' => t('Cacheability settings'), + '#title' => t('Boost cacheability settings'), '#collapsible' => TRUE, '#collapsed' => TRUE, ); $form['cacheability']['boost_cacheability_option'] = array( '#type' => 'radios', - '#title' => t('Cache specific pages'), + '#title' => t('Statically cache specific pages'), '#options' => $options, '#default_value' => BOOST_CACHEABILITY_OPTION, ); @@ -79,10 +68,19 @@ function boost_admin_settings($form = ar // Advanced settings $form['advanced'] = array( '#type' => 'fieldset', - '#title' => t('Advanced settings'), + '#title' => t('Boost advanced settings'), '#collapsible' => TRUE, '#collapsed' => TRUE, ); + $form['advanced']['boost_file_path'] = array( + '#type' => 'textfield', + '#title' => t('Cache file path'), + '#default_value' => BOOST_FILE_PATH, + '#size' => 60, + '#maxlength' => 255, + '#required' => TRUE, + '#description' => t('A file system path where the static cache files will be stored. This directory has to exist and be writable by Drupal. The default setting is to store the files in a directory named %default-path under the Drupal installation directory. If you change this, you must also change the URL rewrite rules in your web server configuration (.htaccess for Apache, lighttpd.conf for Lighttpd), or caching will not work.', array('%default-path' => boost_cache_directory(NULL, FALSE))), + ); $form['advanced']['boost_expire_cron'] = array( '#type' => 'radios', '#title' => t('Purge expired cache files on cron runs'), @@ -150,7 +148,7 @@ function boost_admin_settings($form = ar $htaccess = boost_admin_generate_htaccess(); $form['htaccess'] = array( '#type' => 'fieldset', - '#title' => t('Apache .htaccess settings generation'), + '#title' => t('Boost Apache .htaccess settings generation'), '#collapsible' => TRUE, '#collapsed' => TRUE, ); @@ -188,9 +186,6 @@ function boost_admin_settings_submit($fo variable_del('boost_previously'); extract($form_state['values'], EXTR_SKIP | EXTR_REFS); - // Forcibly disable Drupal's built-in SQL caching to prevent any conflicts of interest: - variable_set('cache', CACHE_DISABLED); - if (empty($boost) && !empty($boost_previously)) { // the cache was previously enabled if (boost_cache_clear_all()) { drupal_set_message(t('Static page cache cleared.')); Index: boost.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/boost/boost.module,v retrieving revision 1.3.2.2.2.5.2.48 diff -u -p -r1.3.2.2.2.5.2.48 boost.module --- boost.module 6 Jun 2009 07:50:23 -0000 1.3.2.2.2.5.2.48 +++ boost.module 8 Jun 2009 02:30:14 -0000 @@ -23,7 +23,7 @@ define('BOOST_PRE_PROCESS_FUNCTION', var define('BOOST_POST_UPDATE_COMMAND', variable_get('boost_post_update_command', '')); define('BOOST_CRON_LIMIT', variable_get('boost_cron_limit', 100)); define('BOOST_ONLY_ASCII_PATH', variable_get('boost_only_ascii_path', TRUE)); -define('BOOST_GZIP', variable_get('boost_gzip', TRUE)); +define('BOOST_GZIP', variable_get('page_compression', TRUE)); define('BOOST_GZIP_FILE_PATH', str_replace(BOOST_ROOT_CACHE_PATH . '/', BOOST_ROOT_CACHE_PATH . '/gz/', BOOST_FILE_PATH)); define('BOOST_CLEAR_CACHE_OFFLINE', variable_get('boost_clear_cache_offline', TRUE)); define('BOOST_HALT_ON_ERRORS', variable_get('boost_halt_on_errors', FALSE)); @@ -76,11 +76,10 @@ function boost_init() { } // Make sure the page is/should be cached according to our current configuration - if ( strpos($_SERVER['SCRIPT_FILENAME'], 'index.php') === FALSE - || variable_get('site_offline', 0) - || $_SERVER['REQUEST_METHOD'] != 'GET' + if ( strpos($_SERVER['SCRIPT_FILENAME'], 'index.php') === FALSE + || variable_get('site_offline', 0) + || $_SERVER['REQUEST_METHOD'] != 'GET' || $_SERVER['SERVER_SOFTWARE'] === 'PHP CLI' - || variable_get('cache', CACHE_DISABLED) || !BOOST_ENABLED || isset($_GET['nocache']) || !boost_is_cacheable($GLOBALS['_boost_path']) @@ -95,6 +94,7 @@ function boost_init() { } // We only generate cached pages for anonymous visitors. else { + $GLOBALS['conf']['cache'] = CACHE_DISABLED; ob_start('_boost_ob_handler'); } } @@ -145,6 +145,7 @@ function boost_form_alter(&$form, $form_ // CACHE_DISABLED), and inject our own settings in its stead. case 'system_performance_settings': module_load_include('inc', 'boost', 'boost.admin'); + variable_set('cache', (variable_get('cache', CACHE_DISABLED) == CACHE_AGGRESSIVE) ? CACHE_NORMAL : variable_get('cache', CACHE_DISABLED)); $form['page_cache'] = boost_admin_settings($form['page_cache']); $form['#validate'][] = 'boost_admin_settings_validate'; $form['#submit'][] = 'boost_admin_settings_submit';