logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

cvs: pear-core /PEAR RunTest.php: msg#00094

Subject: cvs: pear-core /PEAR RunTest.php
cellog          Mon Mar 27 04:37:02 2006 UTC

  Modified files:              
    /pear-core/PEAR     RunTest.php 
  Log:
  remove all @ from PEAR/RunTest.php
  
http://cvs.php.net/viewcvs.cgi/pear-core/PEAR/RunTest.php?r1=1.20&r2=1.21&diff_format=u
Index: pear-core/PEAR/RunTest.php
diff -u pear-core/PEAR/RunTest.php:1.20 pear-core/PEAR/RunTest.php:1.21
--- pear-core/PEAR/RunTest.php:1.20     Fri Feb  3 02:08:11 2006
+++ pear-core/PEAR/RunTest.php  Mon Mar 27 04:37:02 2006
@@ -16,7 +16,7 @@
  * @author     Greg Beaver <cellog@xxxxxxx>
  * @copyright  1997-2006 The PHP Group
  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
- * @version    CVS: $Id: RunTest.php,v 1.20 2006/02/03 02:08:11 cellog Exp $
+ * @version    CVS: $Id: RunTest.php,v 1.21 2006/03/27 04:37:02 cellog Exp $
  * @link       http://pear.php.net/package/PEAR
  * @since      File available since Release 1.3.3
  */
@@ -139,15 +139,29 @@
         $tmp_file   = ereg_replace('\.phpt$','.php',$file);
         $tmp_post   = $tmp . uniqid('/phpt.');
 
-        @unlink($tmp_skipif);
-        @unlink($tmp_file);
-        @unlink($tmp_post);
+        if (file_exists($tmp_skipif)) {
+            unlink($tmp_skipif);
+        }
+        if (file_exists($tmp_file)) {
+            unlink($tmp_file);
+        }
+        if (file_exists($tmp_post)) {
+            unlink($tmp_post);
+        }
 
         // unlink old test results
-        @unlink(ereg_replace('\.phpt$','.diff',$file));
-        @unlink(ereg_replace('\.phpt$','.log',$file));
-        @unlink(ereg_replace('\.phpt$','.exp',$file));
-        @unlink(ereg_replace('\.phpt$','.out',$file));
+        if (file_exists(ereg_replace('\.phpt$','.diff',$file))) {
+            unlink(ereg_replace('\.phpt$','.diff',$file));
+        }
+        if (file_exists(ereg_replace('\.phpt$','.log',$file))) {
+            unlink(ereg_replace('\.phpt$','.log',$file));
+        }
+        if (file_exists(ereg_replace('\.phpt$','.exp',$file))) {
+            unlink(ereg_replace('\.phpt$','.exp',$file));
+        }
+        if (file_exists(ereg_replace('\.phpt$','.out',$file))) {
+            unlink(ereg_replace('\.phpt$','.out',$file));
+        }
 
         // Check if test should be skipped.
         $info = '';
@@ -207,7 +221,9 @@
             system($cmd, $return_value);
             $out = ob_get_contents();
             ob_end_clean();
-            @unlink($tmp_post);
+            if (file_exists($tmp_post)) {
+                unlink($tmp_post);
+            }
             $section_text['RETURNS'] = (int) trim($section_text['RETURNS']);
             $returnfail = ($return_value != $section_text['RETURNS']);
         } else {
@@ -220,7 +236,9 @@
             // perform test cleanup
             $this->save_text($clean = $tmp . uniqid('/phpt.'), 
$section_text['CLEAN']);
             `$php $clean`;
-            @unlink($clean);
+            if (file_exists($clean)) {
+                unlink($clean);
+            }
         }
         // Does the output match what is expected?
         $output = trim($out);
@@ -250,7 +268,9 @@
             var_dump($output);
     */
             if (!$returnfail && preg_match("/^$wanted_re\$/s", $output)) {
-                @unlink($tmp_file);
+                if (file_exists($tmp_file)) {
+                    unlink($tmp_file);
+                }
                 if (!isset($this->_options['quiet'])) {
                     $this->_logger->log(0, "PASS $tested$info");
                 }
@@ -266,7 +286,9 @@
         // compare and leave on success
             $ok = (0 == strcmp($output,$wanted));
             if (!$returnfail && $ok) {
-                @unlink($tmp_file);
+                if (file_exists($tmp_file)) {
+                    unlink($tmp_file);
+                }
                 if (!isset($this->_options['quiet'])) {
                     $this->_logger->log(0, "PASS $tested$info");
                 }



<Prev in Thread] Current Thread [Next in Thread>