public function dump($fname = null)
{
if (!$this->package) {
$this->load();
}
if ($fname) {
$this->jsonPath = $fname;
}
$version = new Header\Version($this->package);
if ($version != $this->package->getPrettyVersion()) {
throw new \Exception("Version mismatch - '" . $version . "' != '" . $this->package->getVersion() . '. in source vs JSON');
}
$dumper = new Dumper();
$dumper->dumpToFile($this->package, $this->jsonPath, false);
}