? boost-478644_0.patch
? boost-623516.patch
? boost-623578.patch
? boost-6240265.patch
Index: boost.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/boost/boost.module,v
retrieving revision 1.3.2.2.2.5.2.233
diff -u -p -r1.3.2.2.2.5.2.233 boost.module
--- boost.module 6 Nov 2009 12:55:11 -0000 1.3.2.2.2.5.2.233
+++ boost.module 6 Nov 2009 23:37:28 -0000
@@ -938,9 +938,18 @@ function boost_block_flush_form() {
'#type' => 'hidden',
'#value' => $GLOBALS['_boost_path'],
);
+ $filename = boost_file_path($GLOBALS['_boost_path']);
+ $ttl = boost_db_get_ttl($filename);
+ if ($ttl < 0) {
+ $form['boost_clear']['kill'] = array(
+ '#type' => 'hidden',
+ '#value' => TRUE,
+ );
+ }
+
$form['boost_cache']['clear'] = array(
'#type' => 'submit',
- '#value' => t('Flush Page'),
+ '#value' => BOOST_EXPIRE_NO_FLUSH && $ttl >= 0 ? t('Expire Page') : t('Flush Page'),
'#submit' => array('boost_block_form_flush_submit'),
);
return ($form);
@@ -954,15 +963,29 @@ function boost_block_form_flush_submit(&
}
$data[] = array('base_dir' => BOOST_FILE_PATH, 'page_callback' => $form['values']['page_callback'], 'page_type' => $form['values']['page_type'], 'page_id' => $form['values']['page_id']);
$flushed = 0;
- if ($data) {
- $flushed += boost_cache_expire_router($data, TRUE);
- }
- if (array_key_exists('path', $form['values'])) {
- $flushed += boost_cache_expire_derivative(array($form['values']['path']), TRUE, TRUE);
+ if (array_key_exists('kill', $form['values'])) {
+ if ($data) {
+ $flushed += boost_cache_expire_router($data, TRUE);
+ }
+ if (array_key_exists('path', $form['values'])) {
+ $flushed += boost_cache_expire_derivative(array($form['values']['path']), TRUE, TRUE);
+ }
+ if (BOOST_VERBOSE >= 7) {
+ watchdog('boost', 'Debug: boost_block_form_flush_submit()
Page !path was deleted resulting in !flushed pages being flushed from the cache', array('!path' => $form['values']['path'], '!flushed' => $flushed));
+ }
}
- if (BOOST_VERBOSE >= 7) {
- watchdog('boost', 'Debug: boost_block_form_flush_submit()
Page !path was deleted resulting in !flushed pages being expired from the cache', array('!path' => $form['values']['path'], '!flushed' => $flushed));
+ else {
+ if ($data) {
+ $flushed += boost_cache_expire_router($data);
+ }
+ if (array_key_exists('path', $form['values'])) {
+ $flushed += boost_cache_expire_derivative(array($form['values']['path']), TRUE);
+ }
+ if (BOOST_VERBOSE >= 7) {
+ watchdog('boost', 'Debug: boost_block_form_flush_submit()
Page !path was expired resulting in !flushed pages being expired from the cache', array('!path' => $form['values']['path'], '!flushed' => $flushed));
+ }
}
+
}
function boost_block_db_settings_form() {