class DeployProcessorQueue in Deploy - Content Staging 7.2
Same name and namespace in other branches
- 7.3 plugins/DeployProcessorQueue.inc \DeployProcessorQueue
Processor class using the Queue API
Hierarchy
- class \DeployProcessorMemory implements DeployProcessor
- class \DeployProcessorQueue
Expanded class hierarchy of DeployProcessorQueue
2 string references to 'DeployProcessorQueue'
- DeployQueuedDeploymentTestCase::testDeployment in ./
deploy.test - deploy_deploy_processors in ./
deploy.deploy.inc - Implements hook_deploy_processors().
File
- plugins/
DeployProcessorQueue.inc, line 10 - Queue API plugin for deploy Processor.
View source
class DeployProcessorQueue extends DeployProcessorMemory {
/**
* {@inheritdoc}
*/
public function deploy($deployment_key, DeployEndpoint $endpoint, $lock_name = NULL) {
deploy_log($deployment_key, DEPLOY_STATUS_PROCESSING);
$queue = DrupalQueue::get('deploy_deploy');
foreach ($this->aggregator as $entity) {
// We don't want entities that has a cause, i.e. not dependencies, because
// those'll be taken care of when the service iterates over the queue.
if (empty($entity->__metadata['cause'])) {
$entity_info = entity_get_info($entity->__metadata['type']);
$id_key = $entity_info['entity keys']['id'];
$entity->__metadata['id'] = $entity->{$id_key};
$entity->__metadata['deployment_key'] = $deployment_key;
$entity->__metadata['plan_name'] = $this->aggregator->plan->name;
$entity->__metadata['endpoint_name'] = $endpoint->name;
$entity->__metadata['lock_name'] = $lock_name;
$queue
->createItem($entity);
}
}
}
/**
* {@inheritdoc}
*/
public function publish($deployment_key, DeployEndpoint $endpoint, $lock_name = NULL) {
$queue = DrupalQueue::get('deploy_publish');
foreach ($this->aggregator as $entity) {
// We don't want entities that has a cause, i.e. not dependencies, because
// those'll be taken care of when the service iterates over the queue.
if (empty($entity->__metadata['cause'])) {
$entity_info = entity_get_info($entity->__metadata['type']);
$id_key = $entity_info['entity keys']['id'];
$entity->__metadata['id'] = $entity->{$id_key};
$entity->__metadata['deployment_key'] = $deployment_key;
$entity->__metadata['plan_name'] = $this->aggregator->plan->name;
$entity->__metadata['endpoint_name'] = $endpoint->name;
$entity->__metadata['lock_name'] = $lock_name;
$queue
->createItem($entity);
}
}
}
}
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 |
Runs all postprocess operations. Overrides DeployProcessor:: |
1 |
DeployProcessorMemory:: |
public | function |
Runs all preprocess operations. Overrides DeployProcessor:: |
|
DeployProcessorMemory:: |
protected | function | 1 | |
DeployProcessorMemory:: |
public | function |
Constructor for a deploy processor. Overrides DeployProcessor:: |
|
DeployProcessorQueue:: |
public | function |
Main processing method that should hand over the aggregator to the endpoint
to deploy all the entities. Overrides DeployProcessorMemory:: |
|
DeployProcessorQueue:: |
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 DeployProcessorMemory:: |