Browse Source

silence unlink() and rmdir(). fix a bug where wasn't set due to wrong ini setting

experimental/new_apache_hooks
Christian Dickmann 24 years ago
parent
commit
0220472176
  1. 4
      pear/PEAR/Registry.php
  2. 6
      pear/System.php

4
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");
}

6
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;
}
}

Loading…
Cancel
Save