1
0
Fork 0

Wipe index when on configuration change

pull/668/head
Jürgen Steitz 2017-02-24 23:37:02 +01:00
parent 9067b4462f
commit 1e319c7215
3 changed files with 28 additions and 0 deletions

View File

@ -42,6 +42,9 @@ abstract class AbstractAggregateIndex implements ReadableIndex
$index->on('definition-added', function () { $index->on('definition-added', function () {
$this->emit('definition-added'); $this->emit('definition-added');
}); });
$index->on('wipe', function() {
$this->emit('wipe');
});
} }
/** /**
@ -147,4 +150,14 @@ abstract class AbstractAggregateIndex implements ReadableIndex
} }
return $refs; return $refs;
} }
/**
* Wipe all indexes for a reindex
*/
public function wipe()
{
foreach ($this->getIndexes() as $index) {
$index->wipe();
}
}
} }

View File

@ -211,4 +211,14 @@ class Index implements ReadableIndex, \Serializable
'staticComplete' => $this->staticComplete 'staticComplete' => $this->staticComplete
]); ]);
} }
public function wipe()
{
$this->definitions = [];
$this->references = [];
$this->complete = false;
$this->staticComplete = false;
$this->emit('wipe');
}
} }

View File

@ -170,4 +170,9 @@ class Workspace
} }
return $dependencyReferences; return $dependencyReferences;
} }
public function didChangeConfiguration($settings = null)
{
$this->index->wipe();
}
} }