mirror of
https://github.com/php/web-pecl.git
synced 2026-03-23 23:02:08 +01:00
Avoid warnings when there's no records in releases/files
This commit is contained in:
committed by
Derick Rethans
parent
cf57e93708
commit
374961fb4a
@@ -245,7 +245,8 @@ class Release
|
||||
?, ?, ?, ?, ?, NOW(), ?
|
||||
)";
|
||||
|
||||
$id = $this->database->run("SELECT id FROM releases ORDER BY id DESC")->fetch()['id'];
|
||||
$old = $this->database->run("SELECT id FROM releases ORDER BY id DESC")->fetch();
|
||||
$id = $old ? $old['id'] : 0;
|
||||
$release_id = (!$id) ? 1 : $id + 1;
|
||||
|
||||
$statement = $this->database->run($sql, [$release_id, $package_id, $version, $state, $this->authUser->handle, $relnotes]);
|
||||
@@ -255,7 +256,8 @@ class Release
|
||||
(`id`,`package`,`release`,`md5sum`,`basename`,`fullpath`,`packagexml`)
|
||||
VALUES (?, ?, ?, ?, ?, ?, ?)";
|
||||
|
||||
$id = $this->database->run("SELECT id FROM files ORDER BY id DESC")->fetch()['id'];
|
||||
$old = $this->database->run("SELECT id FROM files ORDER BY id DESC")->fetch();
|
||||
$id = $old ? $old['id'] : 0;
|
||||
$file_id = !$id ? 1 : $id + 1;
|
||||
|
||||
// TODO: Code duplication with deps error. Should be dropped sooner or later
|
||||
|
||||
Reference in New Issue
Block a user