private function addToManifest($version)
{
$manifest = $this->getManifest();
if (json_last_error() !== JSON_ERROR_NONE) {
throw new RuntimeException('Could not decode manifest json');
}
array_unshift($manifest['versions'], 'v' . $version);
$content = json_encode($manifest, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . "\n";
$result = file_put_contents($this->getManifestPath(), $content);
if (!$result) {
throw new RuntimeException('File write failed');
}
}