Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
--TEST--
2
File_SearchReplace multiple files argument as array
3
--SKIPIF--
4
<?php
5
include(dirname(__FILE__).'/setup.php');
6
print $status;
7
?>
8
--FILE--
9
<?php
10
require_once(dirname(__FILE__).'/setup.php');
11
 
12
$search  = "Copyright (c) 2002-2003";
13
$replace = "Copyright (c) 2002-2005";
14
 
15
$snr = new File_SearchReplace( $search, $replace, $files);
16
$snr -> doSearch() ;
17
 
18
foreach($files as $f) {
19
   readfile($f);
20
};
21
 
22
echo "\n------[Occurences]: " . $snr->getNumOccurences();
23
echo "\n------[Last Error]: " , ($snr->getLastError() !== '') ? var_dump($snr->getLastError()) : "N/A";
24
 
25
?>
26
--EXPECT--
27
<?php
28
// +-----------------------------------------------------------------------+
29
// | Copyright (c) 2002-2005, Richard Heyes                                |
30
// | All rights reserved.                                                  |
31
// |                                                                       |/**
32
// +-----------------------------------------------------------------------+
33
// | Copyright (c) 2002-2005, Richard Heyes                                |
34
 ...
35
 *
36
 * Search and Replace Utility
37
 *
38
 * @version 1.0
39
 * @package File
40
 */
41
------[Occurences]: 2
42
------[Last Error]: N/A