Update to drupal 8.0.0-rc1. For more information, see https://www.drupal.org/node/2582663

This commit is contained in:
Greg Anderson 2015-10-08 11:40:12 -07:00
parent eb34d130a8
commit f32e58e4b1
8476 changed files with 211648 additions and 170042 deletions

View file

@ -83,13 +83,6 @@ class Migration extends ConfigEntityBase implements MigrationInterface, Requirem
*/
protected $process;
/**
* The configuration describing the load plugins.
*
* @var array
*/
protected $load;
/**
* The cached process plugins.
*
@ -394,7 +387,7 @@ class Migration extends ConfigEntityBase implements MigrationInterface, Requirem
$missing_migrations = array_diff($this->requirements, array_keys($required_migrations));
// Check if the dependencies are in good shape.
foreach ($required_migrations as $migration_id => $required_migration) {
if (!$required_migration->isComplete()) {
if (!$required_migration->allRowsProcessed()) {
$missing_migrations[] = $migration_id;
}
}
@ -446,15 +439,15 @@ class Migration extends ConfigEntityBase implements MigrationInterface, Requirem
/**
* {@inheritdoc}
*/
public function setMigrationResult($result) {
\Drupal::keyValue('migrate_result')->set($this->id(), $result);
public function getInterruptionResult() {
return \Drupal::keyValue('migrate_interruption_result')->get($this->id(), static::RESULT_INCOMPLETE);
}
/**
* {@inheritdoc}
*/
public function getMigrationResult() {
return \Drupal::keyValue('migrate_result')->get($this->id(), static::RESULT_INCOMPLETE);
public function clearInterruptionResult() {
\Drupal::keyValue('migrate_interruption_result')->delete($this->id());
}
/**
@ -462,14 +455,24 @@ class Migration extends ConfigEntityBase implements MigrationInterface, Requirem
*/
public function interruptMigration($result) {
$this->setStatus(MigrationInterface::STATUS_STOPPING);
$this->setMigrationResult($result);
\Drupal::keyValue('migrate_interruption_result')->set($this->id(), $result);
}
/**
* {@inheritdoc}
*/
public function isComplete() {
return $this->getMigrationResult() === static::RESULT_COMPLETED;
public function allRowsProcessed() {
$source_count = $this->getSourcePlugin()->count();
// If the source is uncountable, we have no way of knowing if it's
// complete, so stipulate that it is.
if ($source_count < 0) {
return TRUE;
}
$processed_count = $this->getIdMap()->processedCount();
// We don't use == because in some circumstances (like unresolved stubs
// being created), the processed count may be higher than the available
// source rows.
return $source_count <= $processed_count;
}
/**
@ -587,6 +590,6 @@ class Migration extends ConfigEntityBase implements MigrationInterface, Requirem
$this->addDependency('config', $this->getEntityType()->getConfigPrefix() . '.' . $dependency);
}
return $this->dependencies;
return $this;
}
}