00001 <?php
00002 function core_update_2() {
00003 $ret = new Status();
00004
00005 $dir_iterator = new RecursiveDirectoryIterator(APP_INCLUDE_ABSPATH);
00006 $iterator = new RecursiveIteratorIterator($dir_iterator, RecursiveIteratorIterator::SELF_FIRST);
00007 foreach ($iterator as $file) {
00008 if ($file->isFile()) {
00009 $path = $file->getPathName();
00010 if (substr($path, -4) == '.php') {
00011 $content = file_get_contents($path);
00012 $count = 0;
00013 $content = str_replace('History::goto', 'History::go_to', $content, $count);
00014 if ($count) {
00015 if (file_put_contents($path, $content) === false) {
00016 $ret->append("Could not update file $path");
00017 break;
00018 }
00019 }
00020 }
00021 }
00022 }
00023
00024 return $ret;
00025 }