4 chdir(dirname(__FILE__
));
5 require_once 'common.php';
10 * Converts all instances of $config->set and $config->get to the new
11 * format, as described by docs/dev-config-bcbreaks.txt
15 chdir(dirname(__FILE__
) . '/..');
16 $raw_files = $FS->globr('.', '*.php');
17 foreach ($raw_files as $file) {
18 $file = substr($file, 2); // rm leading './'
19 if (strpos($file, 'library/standalone/') === 0) continue;
20 if (strpos($file, 'maintenance/update-config.php') === 0) continue;
21 if (strpos($file, 'test-settings.php') === 0) continue;
22 if (substr_count($file, '.') > 1) continue; // rm meta files
24 $contents = file_get_contents($file);
25 $contents = preg_replace(
26 "#config->(set|get)\('(.+?)', '(.+?)'#",
27 "config->\\1('\\2.\\3'",
30 if ($contents === '') continue;
31 file_put_contents($file, $contents);