Ejemplo n.º 1
0
 /** Kind of hacky way to fill in details that probably shouldn't be
  *  stored here anyway. */
 public function fill_in_details_from_previous_version($previous = null)
 {
     if (empty($this->details['boost-version'])) {
         $this->details['boost-version'] = isset($previous->details['boost-version']) ? $previous->details['boost-version'] : BoostVersion::unreleased();
     }
 }
Ejemplo n.º 2
0
 /**
  *
  * @param array $libs Array of lib details, can contain multiple historical
  *      entries, using 'update-version' to indicate their historical order.
  * @param array $categories
  * @param array $version Optional update version to use when version info
  *                       is missing.
  */
 private function __construct(array $flat_libs, array $categories, $version = null)
 {
     $this->db = array();
     $this->categories = $categories;
     foreach ($flat_libs as $details) {
         $update_version = isset($details['update-version']) ? $details['update-version'] : ($version ? $version : (isset($details['boost-version']) ? $details['boost-version'] : null));
         $update_version = $update_version ? BoostVersion::from($update_version) : BoostVersion::unreleased();
         if (!$update_version->is_release()) {
             throw new BoostLibraries_exception("No version info for {$details['key']}");
         }
         if (isset($details['update-version'])) {
             unset($details['update-version']);
         }
         $lib = new BoostLibrary($details);
         $lib->update_version = $update_version;
         $this->db[$details['key']][(string) $update_version] = $lib;
     }
     ksort($this->db);
     foreach (array_keys($this->db) as $key) {
         $this->sort_versions($key);
     }
 }