Skip to content

Commit

Permalink
avoid nonexisting key warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ashnazg committed Nov 24, 2024
1 parent 9ae078e commit 9b19afc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion PEAR/DependencyDB.php
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,11 @@ function _lock($mode = LOCK_EX)
}

if (!is_resource($this->_lockFp)) {
$last_errormsg = error_get_last()["message"];
$last_errormsg = '';
$last_error = error_get_last();
if (!empty($last_error['message'])) {
$last_errormsg = $last_error['message'];
}
return PEAR::raiseError("could not create Dependency lock file" .
(isset($last_errormsg) ? ": " . $last_errormsg : ""));
}
Expand Down
6 changes: 5 additions & 1 deletion PEAR/Registry.php
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,11 @@ function _readFileMap()

$fp = @fopen($this->filemap, 'r');
if (!$fp) {
$last_errormsg = error_get_last()["message"];
$last_errormsg = '';
$last_error = error_get_last();
if (!empty($last_error['message'])) {
$last_errormsg = $last_error['message'];
}
return $this->raiseError('PEAR_Registry: could not open filemap "' . $this->filemap . '"', PEAR_REGISTRY_ERROR_FILE, null, null, $last_errormsg);
}

Expand Down

0 comments on commit 9b19afc

Please sign in to comment.