ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
update-config.php
Go to the documentation of this file.
1 #!/usr/bin/php
2 <?php
3 
4 chdir(dirname(__FILE__));
5 require_once 'common.php';
6 assertCli();
7 
14 $FS = new FSTools();
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
23  // process the file
24  $contents = file_get_contents($file);
25  $contents = preg_replace(
26  "#config->(set|get)\('(.+?)', '(.+?)'#",
27  "config->\\1('\\2.\\3'",
28  $contents
29  );
30  if ($contents === '') continue;
31  file_put_contents($file, $contents);
32 }
33 
34 // vim: et sw=4 sts=4
Filesystem tools not provided by default; can recursively create, copy and delete folders...
Definition: FSTools.php:10
assertCli()
Definition: common.php:3
$raw_files
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file