Skip to content

Commit 61ffb66

Browse files
committed
'$php_errormsg' is deprecated since PHP 7.2
Using error_get_last() instead
1 parent 5b1ea74 commit 61ffb66

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

PEAR/DependencyDB.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,8 +501,9 @@ function _lock($mode = LOCK_EX)
501501
}
502502

503503
if (!is_resource($this->_lockFp)) {
504+
$last_errormsg = error_get_last();
504505
return PEAR::raiseError("could not create Dependency lock file" .
505-
(isset($php_errormsg) ? ": " . $php_errormsg : ""));
506+
(isset($last_errormsg) ? ": " . $last_errormsg : ""));
506507
}
507508

508509
if (!(int)flock($this->_lockFp, $mode)) {

PEAR/Registry.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -780,7 +780,8 @@ function _readFileMap()
780780

781781
$fp = @fopen($this->filemap, 'r');
782782
if (!$fp) {
783-
return $this->raiseError('PEAR_Registry: could not open filemap "' . $this->filemap . '"', PEAR_REGISTRY_ERROR_FILE, null, null, $php_errormsg);
783+
$last_errormsg = error_get_last();
784+
return $this->raiseError('PEAR_Registry: could not open filemap "' . $this->filemap . '"', PEAR_REGISTRY_ERROR_FILE, null, null, $last_errormsg);
784785
}
785786

786787
clearstatcache();

0 commit comments

Comments
 (0)