Changeset 8391
- Timestamp:
- 04/10/08 16:36:24 (1 year ago)
- Files:
-
- branches/1.1/lib/util/sfFinder.class.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.1/lib/util/sfFinder.class.php
r8254 r8391 332 332 $files = array(); 333 333 $here_dir = getcwd(); 334 335 $finder = clone $this; 336 337 if ($this->ignore_version_control) 338 { 339 $ignores = array('.svn', '_svn', 'CVS', '_darcs', '.arch-params', '.monotone', '.bzr', '.git', '.hg'); 340 341 $finder->discard($ignores)->prune($ignores); 342 } 343 344 // first argument is an array? 334 345 $numargs = func_num_args(); 335 346 $arg_list = func_get_args(); 336 337 $finder = clone $this;338 339 if ($this->ignore_version_control)340 {341 $ignores = array('.svn', '_svn', 'CVS', '_darcs', '.arch-params', '.monotone', '.bzr', '.git', '.hg');342 343 $finder->discard($ignores)->prune($ignores);344 }345 346 // first argument is an array?347 347 if ($numargs == 1 && is_array($arg_list[0])) 348 348 { … … 353 353 for ($i = 0; $i < $numargs; $i++) 354 354 { 355 $real_dir = realpath($arg_list[$i]); 355 $dir = realpath($arg_list[$i]); 356 357 if (!is_dir($dir)) 358 { 359 continue; 360 } 361 362 $dir = str_replace('\\', '/', $dir); 356 363 357 364 // absolute path? 358 if (!self::isPathAbsolute($real_dir)) 359 { 360 $dir = $here_dir.DIRECTORY_SEPARATOR.$real_dir; 361 } 362 else 363 { 364 $dir = $real_dir; 365 } 366 367 if (!is_dir($real_dir)) 368 { 369 continue; 370 } 371 372 $dir = str_replace(array('/', '\\'), '/', $dir); 365 if (!self::isPathAbsolute($dir)) 366 { 367 $dir = $here_dir.'/'.$dir; 368 } 369 370 $new_files = str_replace('\\', '/', $finder->search_in($dir)); 373 371 374 372 if ($this->relative) 375 373 { 376 $dir = rtrim($dir, '/'); 377 $files = array_merge($files, str_replace($dir.'/', '', str_replace(array('/', '\\'), '/', $finder->search_in($dir)))); 378 } 379 else 380 { 381 $files = array_merge($files, $finder->search_in($dir)); 382 } 374 $new_files = str_replace(rtrim($dir, '/').'/', '', $new_files); 375 } 376 377 $files = array_merge($files, $new_files); 383 378 } 384 379

