From: Christian Dickmann Date: Sun, 2 Jun 2002 14:27:15 +0000 (+0000) Subject: silence unlink() and rmdir(). fix a bug where wasn't set due to wrong ini setting X-Git-Tag: RELEASE_0_90~64 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=022047217667dfcbe971db57250231f6c7237778;p=php silence unlink() and rmdir(). fix a bug where wasn't set due to wrong ini setting --- diff --git a/pear/PEAR/Registry.php b/pear/PEAR/Registry.php index 30f31ce6f9..42b9c8d0cd 100644 --- a/pear/PEAR/Registry.php +++ b/pear/PEAR/Registry.php @@ -224,7 +224,11 @@ class PEAR_Registry extends PEAR } $open_mode = 'r'; } + + @ini_set('track_errors', true); $this->lock_fp = @fopen($this->lockfile, $open_mode); + @ini_restore('track_errors'); + if (!is_resource($this->lock_fp)) { return $this->raiseError("could not create lock file: $php_errormsg"); } diff --git a/pear/System.php b/pear/System.php index 47367e5441..f9699781f3 100644 --- a/pear/System.php +++ b/pear/System.php @@ -182,19 +182,19 @@ class System if (isset($do_recursive)) { $struct = System::_multipleToStruct($opts[1]); foreach($struct['files'] as $file) { - if (!unlink($file)) { + if (!@unlink($file)) { $ret = false; } } foreach($struct['dirs'] as $dir) { - if (!rmdir($dir)) { + if (!@rmdir($dir)) { $ret = false; } } } else { foreach ($opts[1] as $file) { $delete = (is_dir($file)) ? 'rmdir' : 'unlink'; - if (!$delete($file)) { + if (!@$delete($file)) { $ret = false; } }