cvs: pear-core /PEAR/Command Test.php

From: Date: Sat, 04 Apr 2009 00:00:29 +0000
Subject: cvs: pear-core /PEAR/Command Test.php
Groups: php.pear.cvs php.pear.core 
Request: Send a blank email to pear-core+get-8298@lists.php.net to get a copy of this message
dufuz Sat Apr 4 00:00:29 2009 UTC Modified files: /pear-core/PEAR/Command Test.php Log: Bug #16057: -r is limited to 4 directories in depth http://cvs.php.net/viewvc.cgi/pear-core/PEAR/Command/Test.php?r1=1.30&r2=1.31&diff_format=u Index: pear-core/PEAR/Command/Test.php diff -u pear-core/PEAR/Command/Test.php:1.30 pear-core/PEAR/Command/Test.php:1.31 --- pear-core/PEAR/Command/Test.php:1.30 Tue Feb 24 23:39:29 2009 +++ pear-core/PEAR/Command/Test.php Sat Apr 4 00:00:29 2009 @@ -11,7 +11,7 @@ * @author Greg Beaver <cellog@php.net> * @copyright 1997-2009 The Authors * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: Test.php,v 1.30 2009/02/24 23:39:29 dufuz Exp $ + * @version CVS: $Id: Test.php,v 1.31 2009/04/04 00:00:29 dufuz Exp $ * @link http://pear.php.net/package/PEAR * @since File available since Release 0.1 */ @@ -116,7 +116,7 @@ $log = new PEAR_Common; $log->ui = &$this->ui; // slightly hacky, but it will work $tests = array(); - $depth = isset($options['recur']) ? 4 : 1; + $depth = isset($options['recur']) ? 14 : 1; if (!count($params)) { $params[] = '.'; @@ -174,9 +174,12 @@ continue; } - $dir = System::find(array($p, '-type', 'f', - '-maxdepth', $depth, - '-name', '*.phpt')); + $args = array($p, '-type', 'f', '-name', '*.phpt'); + if (!isset($options['recur'])) { + $args[] = '-maxdepth'; + $args[] = 1; + } + $dir = System::find($args); $tests = array_merge($tests, $dir); } else { if (isset($options['phpunit'])) { @@ -199,9 +202,14 @@ if (!preg_match('/\.phpt\\z/', $p)) { $p .= '.phpt'; } - $dir = System::find(array(dirname($p), '-type', 'f', - '-maxdepth', $depth, - '-name', $p)); + + + $args = array(dirname($p), '-type', 'f', '-name', $p); + if (!isset($options['recur'])) { + $args[] = '-maxdepth'; + $args[] = 1; + } + $dir = System::find($args); $tests = array_merge($tests, $dir); } }

« previous php.pear.core (#8298) next »