public function updateAfterRenameFolder($old, $new)
{
if (!$this->_cache->hasNamespace()) {
// Cache not synchronized yet.
return;
}
$folder_list = $this->_cache->getFolders();
$folder_list = array_diff($folder_list, array($old));
$folder_list[] = $new;
$annotations = $this->_cache->getFolderTypes();
if (isset($annotations[$old])) {
$annotations[$new] = $annotations[$old];
unset($annotations[$old]);
}
$namespace = unserialize($this->_cache->getNamespace());
// Using array_values() here to make testing across PHP versions
// easier.
$this->_synchronize($namespace, array_values($folder_list), $annotations);
}