Skip to content
Snippets Groups Projects
Commit a28ab4fb authored by Tim Steiner's avatar Tim Steiner
Browse files

Make fix-settings respect the DB_PREFIX.

parent 6f0084aa
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/php
<?php
require_once dirname(__FILE__) . '/config.php';
if ($_SERVER['argc'] != 2) {
echo 'Usage: ' . $_SERVER['argv'][0] . ' path/to/settings.php' . PHP_EOL;
exit(-1);
......@@ -22,15 +24,16 @@ if (!preg_match('/^\$databases.*?\'default\' => \'(.*?)\',.*?\);/ms', $s, $match
echo 'Nothing to replace!' . PHP_EOL;
exit(1);
}
$prefix = DB_PREFIX;
$replacements = array($matches[0] => <<<EOL
\$databases['default']['default']['prefix'] = array(
'default' => '{$matches[1]}',
'filter' => 'drupal_',
'filter_format' => 'drupal_',
'role' => 'drupal_',
'role_permission' => 'drupal_',
'unl_cas_settings' => 'drupal_',
'wysiwyg' => 'drupal_',
'filter' => '$prefix',
'filter_format' => '$prefix',
'role' => '$prefix',
'role_permission' => '$prefix',
'unl_cas_settings' => '$prefix',
'wysiwyg' => '$prefix',
);
EOL
);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment