/** * We're storing metadata about a package in the database. * * @param TreeUpdate $update * @param int $treeUpdateID */ protected function updatePackageQueue(TreeUpdate $update, int $treeUpdateID) { $packageId = $this->db->cell('SELECT packageid FROM airship_package_cache WHERE packagetype = ? AND supplier = ? AND name = ? ', $update->getPackageType(), $update->getSupplierName(), $update->getPackageName()); if (empty($packageId)) { $packageId = $this->db->insertGet('airship_package_cache', ['packagetype' => $update->getPackageType(), 'supplier' => $update->getSupplierName(), 'name' => $update->getPackageName()], 'packageid'); } $data = $update->getNodeData(); $this->db->insert('airship_package_versions', ['package' => $packageId, 'version' => $data['version'], 'checksum' => $data['checksum'], 'commithash' => $data['commit'] ?? null, 'date_released' => $data['date_released'], 'treeupdateid' => $treeUpdateID]); }
public function testZCleanup() { try { $db = Database::factory($this->getConfig()); } catch (DBException $ex) { $this->markTestSkipped('Database not configured'); return; } $db->safeQuery('DELETE FROM test_values'); }
/** * Dependency-Injectable constructor * * @param \PDO $pdo * @param string $dbengine */ public function __construct(\PDO $pdo = null, $dbengine = '') { if (IDE_HACKS) { parent::__construct($pdo, $dbengine); } }