class DeployProcessorMemory in Deploy - Content Staging 7.3
Same name and namespace in other branches
- 7.2 plugins/DeployProcessorMemory.inc \DeployProcessorMemory
Class for basic memory-based processing
Hierarchy
- class \DeployProcessorMemory implements DeployProcessor
Expanded class hierarchy of DeployProcessorMemory
3 string references to 'DeployProcessorMemory'
- deploy_deploy_processors in ./
deploy.deploy.inc - Implements hook_deploy_processors().
- deploy_example_deploy_plans_default in modules/
deploy_example/ deploy_example.deploy_plans.inc - Implements hook_deploy_plans_default().
- drush_deploy_create_plan in ./
deploy.drush.inc - Command callback for creating plans.
File
- plugins/
DeployProcessorMemory.inc, line 10 - In memory plugin for deploy Processor.
View source
class DeployProcessorMemory implements DeployProcessor {
/**
* The aggregator containing the entities to be processed.
*
* @var DeployAggregator
*/
public $aggregator = NULL;
/**
* Configuration options.
*
* @var array
*/
public $config = array();
/**
* {@inheritdoc}
*/
public function __construct(DeployAggregator $aggregator, array $config = array()) {
$this->aggregator = $aggregator;
$this->config += array(
'debug' => FALSE,
);
$this->config = array_merge($this->config, $config);
}
/**
* {@inheritdoc}
*/
protected function processOperations(array $operations = array()) {
if (!empty($operations)) {
foreach ($this->aggregator as $entity) {
foreach ($operations as $operation) {
$operation['callback']($this->aggregator->plan->name, $entity);
}
}
}
}
/**
* {@inheritdoc}
*/
public function preProcess(array $operations = array()) {
$this
->processOperations($operations);
}
/**
* {@inheritdoc}
*/
public function deploy($deployment_key, DeployEndpoint $endpoint, $lock_name = NULL) {
$endpoint
->deploy($deployment_key, $this->aggregator, $lock_name);
}
/**
* {@inheritdoc}
*/
public function publish($deployment_key, DeployEndpoint $endpoint, $lock_name = NULL) {
$endpoint
->publish($deployment_key, $this->aggregator, $lock_name);
drupal_set_message(t('Plan %plan has been deployed and published to %endpoint.', array(
'%plan' => $this->aggregator->plan->title,
'%endpoint' => $endpoint->title,
)));
}
/**
* {@inheritdoc}
*/
public function postProcess(array $operations = array()) {
$this
->processOperations($operations);
}
/**
* {@inheritdoc}
*/
public function configForm(&$form_state) {
// We have no settings for this processor.
return array();
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DeployProcessorMemory:: |
public | property | The aggregator containing the entities to be processed. | |
DeployProcessorMemory:: |
public | property | Configuration options. | |
DeployProcessorMemory:: |
public | function |
Configuration form. Overrides DeployProcessor:: |
|
DeployProcessorMemory:: |
public | function |
Main processing method that should hand over the aggregator to the endpoint
to deploy all the entities. Overrides DeployProcessor:: |
2 |
DeployProcessorMemory:: |
public | function |
Runs all postprocess operations. Overrides DeployProcessor:: |
1 |
DeployProcessorMemory:: |
public | function |
Runs all preprocess operations. Overrides DeployProcessor:: |
|
DeployProcessorMemory:: |
protected | function | 1 | |
DeployProcessorMemory:: |
public | function |
Processing method that should hand over the aggregator to the endpoint
to publish all deployed entities. This method will only be called after
successful deployments. Overrides DeployProcessor:: |
2 |
DeployProcessorMemory:: |
public | function |
Constructor for a deploy processor. Overrides DeployProcessor:: |