]> granicus.if.org Git - php/commitdiff
silence unlink() and rmdir(). fix a bug where wasn't set due to wrong ini setting
authorChristian Dickmann <dickmann@php.net>
Sun, 2 Jun 2002 14:27:15 +0000 (14:27 +0000)
committerChristian Dickmann <dickmann@php.net>
Sun, 2 Jun 2002 14:27:15 +0000 (14:27 +0000)
pear/PEAR/Registry.php
pear/System.php

index 30f31ce6f98dacb1d7a39cb9101f4aa4bfc7bb2a..42b9c8d0cd3bfc05f233dbd525f8ef8cae20c27b 100644 (file)
@@ -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");
             }
index 47367e5441234c48f3d602e1c64e797902115aca..f9699781f390377857c382dd681076479ef272ab 100644 (file)
@@ -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;
                 }
             }