mirror of
https://github.com/php/php-src.git
synced 2024-12-01 05:43:38 +08:00
* move logic to _assertStateDir
This commit is contained in:
parent
a927404520
commit
365505daed
@ -109,7 +109,9 @@ class PEAR_Registry extends PEAR
|
||||
function _assertStateDir()
|
||||
{
|
||||
if (!@is_dir($this->statedir)) {
|
||||
return System::mkdir("-p {$this->statedir}");
|
||||
if (!System::mkdir("-p {$this->statedir}")) {
|
||||
return $this->raiseError("could not create directory '{$this->statedir}'");
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@ -210,8 +212,8 @@ class PEAR_Registry extends PEAR
|
||||
// XXX does not check type of lock (LOCK_SH/LOCK_EX)
|
||||
return true;
|
||||
}
|
||||
if (!@$this->_assertStateDir()) {
|
||||
return $this->raiseError("could not create directory '{$this->statedir}'");
|
||||
if (PEAR::isError($err = $this->_assertStateDir())) {
|
||||
return $err;
|
||||
}
|
||||
$this->lock_fp = @fopen($this->lockfile, 'w');
|
||||
if (!is_resource($this->lock_fp)) {
|
||||
|
Loading…
Reference in New Issue
Block a user