diff options
author | Stig Bakken <ssb@php.net> | 2002-03-24 01:52:38 +0000 |
---|---|---|
committer | Stig Bakken <ssb@php.net> | 2002-03-24 01:52:38 +0000 |
commit | 365505daed9e3029d6496eb79462cd0ade5db788 (patch) | |
tree | d895409e1ff474ecf3ed8daaa479a7fef1f6e2dc | |
parent | a927404520e127f1caa437991e460e7edc794b6a (diff) | |
download | php-git-365505daed9e3029d6496eb79462cd0ade5db788.tar.gz |
* move logic to _assertStateDir
-rw-r--r-- | pear/PEAR/Registry.php | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/pear/PEAR/Registry.php b/pear/PEAR/Registry.php index 9167464cf3..2ae1bd89b8 100644 --- a/pear/PEAR/Registry.php +++ b/pear/PEAR/Registry.php @@ -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)) { |