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 with search/replace pairs in 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
$search[]  = "* @version 1.0";
16
$replace[] = "* @version 1.1";
17
 
18
$search[]  = "00";
19
$replace[] = "oo";
20
 
21
$snr = new File_SearchReplace( $search, $replace, $files);
22
$snr -> doSearch() ;
23
 
24
foreach($files as $f) {
25
   readfile($f);
26
};
27
 
28
echo "\n------[Occurences]: " . $snr->getNumOccurences();
29
echo "\n------[Last Error]: " , ($snr->getLastError() !== '') ? var_dump($snr->getLastError()) : "N/A";
30
 
31
 
32
?>
33
--EXPECT--
34
<?php
35
// +-----------------------------------------------------------------------+
36
// | Copyright (c) 2oo2-2oo5, Richard Heyes                                |
37
// | All rights reserved.                                                  |
38
// |                                                                       |/**
39
// +-----------------------------------------------------------------------+
40
// | Copyright (c) 2oo2-2oo5, Richard Heyes                                |
41
 ...
42
 *
43
 * Search and Replace Utility
44
 *
45
 * @version 1.1
46
 * @package File
47
 */
48
------[Occurences]: 7
49
------[Last Error]: N/A