Add html/pdf inconsistency fixes
[bus.git] / spyc / php4 / .svn / text-base / 5to4.php.svn-base
maxious 1 <?php
2
3 php5to4 ("../spyc.php", 'spyc-latest.php4');
4
5 function php5to4 ($src, $dest) {
6 $code = file_get_contents ($src);
7 $code = preg_replace ('#(public|private|protected)\s+\$#i', 'var \$', $code);
8 $code = preg_replace ('#(public|private|protected)\s+static\s+\$#i', 'var \$', $code);
9 $code = preg_replace ('#(public|private|protected)\s+function#i', 'function', $code);
10 $code = preg_replace ('#(public|private|protected)\s+static\s+function#i', 'function', $code);
11 $code = str_replace ('self::', '$this->', $code);
12 $f = fopen ($dest, 'w');
13 fwrite($f, $code);
14 fclose ($f);
15 print "Written to $dest.\n";
16 }