Skip to content

Commit

Permalink
Add filter to allow cache locking to be disabled.
Browse files Browse the repository at this point in the history
  • Loading branch information
raamdev committed Dec 27, 2014
1 parent e772199 commit c79e423
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion quick-cache-pro/includes/share.php
Original file line number Diff line number Diff line change
Expand Up @@ -1789,7 +1789,7 @@ public function delete_all_files_dirs_in($dir, $delete_dir_too = FALSE)
*
* @since 140422 First documented version.
*
* @return array Lock type & resource handle needed to unlock later.
* @return array Lock type & resource handle needed to unlock later or FALSE if disabled by filter.
*
* @throws \exception If {@link \sem_get()} not available and there's
* no writable tmp directory for {@link \flock()} either.
Expand All @@ -1801,6 +1801,9 @@ public function delete_all_files_dirs_in($dir, $delete_dir_too = FALSE)
*/
public function cache_lock()
{
if((boolean)apply_filters('quick_cache_disable_cache_locking', FALSE))
return false;

if(!($wp_config_file = $this->find_wp_config_file()))
throw new \exception(__('Unable to find the wp-config.php file.', $this->text_domain));

Expand Down Expand Up @@ -1831,6 +1834,9 @@ public function cache_lock()
*/
public function cache_unlock(array $lock)
{
if((boolean)apply_filters('quick_cache_disable_cache_locking', FALSE))
return;

if(!is_array($lock))
return; // Not possible.

Expand Down

0 comments on commit c79e423

Please sign in to comment.