Skip to content

Commit

Permalink
Added Update Blocker support, fixes #2
Browse files Browse the repository at this point in the history
  • Loading branch information
Rarst committed Jun 29, 2014
1 parent 285a3a5 commit cb47e32
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
3 changes: 3 additions & 0 deletions composer.json
Expand Up @@ -21,6 +21,9 @@
"php" : ">=5.3",
"pimple/pimple" : "~2.0"
},
"suggest": {
"rarst/update-blocker": "Prevents invalid updates from official repositories"
},
"autoload" : {
"classmap": ["php/"]
}
Expand Down
15 changes: 15 additions & 0 deletions php/class-plugin.php
Expand Up @@ -15,6 +15,7 @@ class Plugin extends \Pimple {
public function run() {

add_action( 'init', array( $this, 'init' ) );
add_filter( 'update_blocker_blocked', array( $this, 'update_blocker_blocked' ) );
}

/**
Expand All @@ -34,6 +35,20 @@ public function init() {
}
}

/**
* @see https://github.com/Rarst/update-blocker
*
* @param array $blocked
*
* @return array
*/
public function update_blocker_blocked( $blocked ) {

$blocked['plugins'][] = plugin_basename( dirname( __DIR__ ) . '/fragment-cache.php' );

return $blocked;
}

/**
* Add (or override) cache handler and enable it.
*
Expand Down
4 changes: 4 additions & 0 deletions readme.md
Expand Up @@ -46,6 +46,10 @@ add_filter( 'fc_skip_cache', function ( $skip, $type, $name, $args, $salt ) {

# Changelog

## 1.2

- added [Update Blocker](https://github.com/Rarst/update-blocker) support

## 1.1

- anonymized fragment generation in front end for consistency
Expand Down

0 comments on commit cb47e32

Please sign in to comment.