function load($values, $refresh = false) { assert($this->dir_location || $refresh); assert(!$this->loaded); $this->title_xml = BoostSiteTools::fragment_to_string($values['title_fragment']); $this->purpose_xml = BoostSiteTools::fragment_to_string($values['purpose_fragment']); $this->notice_xml = BoostSiteTools::fragment_to_string($values['notice_fragment']); $this->notice_url = $values['notice_url']; $this->pub_date = $values['pub_date']; $this->last_modified = $values['last_modified']; $this->download_item = $values['download_item']; $this->download_basename = $values['download_basename']; $this->documentation = $values['documentation']; $this->final_documentation = $values['final_documentation']; $this->id = $values['id']; if (!$this->id) { $this->id = strtolower(preg_replace('@[\\W]@', '_', $this->title_xml)); } if ($this->dir_location) { $this->location = $this->dir_location . $this->id . '.html'; $this->dir_location = null; $this->page_state = null; } $this->release_status = $values['status_item']; $this->loaded = true; $this->initialise(); if (empty($this->flags['released']) && $this->documentation) { $doc_prefix = rtrim($this->documentation, '/'); BoostSiteTools::transform_links($values['description_fragment'], function ($x) use($doc_prefix) { return preg_match('@^/(?:libs/|doc/html/)@', $x) ? $doc_prefix . $x : $x; }); } if ($this->final_documentation) { $link_pattern = '@^' . rtrim($this->final_documentation, '/') . '/@'; $replace = "{$doc_prefix}/"; BoostSiteTools::transform_links($values['description_fragment'], function ($x) use($link_pattern, $replace) { return preg_replace($link_pattern, $replace, $x); }); } $this->description_xml = BoostSiteTools::fragment_to_string($values['description_fragment']); }