-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Functional tag/path/everything purger.
- Loading branch information
Showing
10 changed files
with
803 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
modules/quant_purger/config/schema/quant_purger.data_types.schema.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
quant_purge_header: | ||
type: mapping | ||
label: 'Quant Header' | ||
mapping: | ||
field: | ||
type: string | ||
translatable: false | ||
value: | ||
type: string | ||
translatable: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
<?php | ||
|
||
namespace Drupal\quant_purger\Entity; | ||
|
||
use Drupal\purge\Plugin\Purge\Purger\PurgerSettingsBase; | ||
use Drupal\purge\Plugin\Purge\Purger\PurgerSettingsInterface; | ||
|
||
/** | ||
* Defines the QuantCDN purger settings entity. | ||
* | ||
* @ConfigEntityType( | ||
* id = "quantpurgersettings", | ||
* label = @Translation("QuantCDN"), | ||
* config_prefix = "settings", | ||
* static_cache = TRUE, | ||
* entity_keys = {"id" = "id"}, | ||
* config_export = { | ||
* "id", | ||
* "label", | ||
* "description", | ||
* "name", | ||
* "invalidationtype", | ||
* "runtime_measurement", | ||
* "timeout", | ||
* "connect_timeout", | ||
* "cooldown_time", | ||
* "max_requests", | ||
* "http_errors" | ||
* }, | ||
* ) | ||
*/ | ||
class QuantPurgeSettings extends PurgerSettingsBase implements PurgerSettingsInterface { | ||
|
||
/** | ||
* Instance metadata. | ||
*/ | ||
|
||
/** | ||
* The readable name of this purger. | ||
* | ||
* @var string | ||
*/ | ||
public $name = ''; | ||
|
||
/** | ||
* The invalidation plugin ID that this purger invalidates. | ||
* | ||
* @var string | ||
*/ | ||
public $invalidationtype = 'tag'; | ||
|
||
/** | ||
* Runtime measurement. | ||
* | ||
* When FALSE, dynamic capacity calculation will be disabled and based upon | ||
* the connect_timeout and timeout settings. | ||
* | ||
* @var bool | ||
*/ | ||
// @phpcs:ignore | ||
public $runtime_measurement = TRUE; | ||
|
||
/** | ||
* The timeout of the request in seconds. | ||
* | ||
* @var float | ||
*/ | ||
public $timeout = 1.0; | ||
|
||
/** | ||
* The number of seconds to wait while trying to connect to a server. | ||
* | ||
* @var float | ||
*/ | ||
// @phpcs:ignore | ||
public $connect_timeout = 1.0; | ||
|
||
/** | ||
* Cooldown time. | ||
* | ||
* Number of seconds to wait after one or more invalidations took place (so | ||
* that other purgers get fresh content).' | ||
* | ||
* @var float | ||
*/ | ||
// @phpcs:ignore | ||
public $cooldown_time = 0.0; | ||
|
||
/** | ||
* Maximum requests. | ||
* | ||
* Maximum number of HTTP requests that can be made during Drupal's execution | ||
* lifetime. Usually PHP resource restraints lower this value dynamically, but | ||
* can be met at the CLI. | ||
* | ||
* @var int | ||
*/ | ||
// @phpcs:ignore | ||
public $max_requests = 250; | ||
|
||
/** | ||
* Success resolution. | ||
*/ | ||
|
||
/** | ||
* Whether 4xx and 5xx responses need to be treated as failures or not. | ||
* | ||
* @var bool | ||
* | ||
* @see http://docs.guzzlephp.org/en/latest/request-options.html#http-errors | ||
*/ | ||
// @phpcs:ignore | ||
public $http_errors = TRUE; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
namespace Drupal\quant_purger\Form; | ||
|
||
/** | ||
* Configuration form for the HTTP Bundled Purger. | ||
*/ | ||
class QuantPurgeForm extends QuantPurgeFormBase { | ||
|
||
/** | ||
* The token group names this purger supports replacing tokens for. | ||
* | ||
* @var string[] | ||
* | ||
* @see purge_tokens_token_info() | ||
*/ | ||
protected $tokenGroups = ['invalidation']; | ||
|
||
} |
Oops, something went wrong.