1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00
Files
build
git-tools
phpBB
adm
assets
cache
config
develop
add_permissions.php
adjust_avatars.php
adjust_bbcodes.php
adjust_magic_urls.php
adjust_sizes.php
adjust_smilies.php
adjust_uids.php
adjust_usernames.php
benchmark.php
blank.gif
blank.jpg
calc_email_hash.php
change_smiley_ref.php
check_flash_bbcodes.php
collect_cache_stats.sh
create_schema_files.php
create_search_index.php
create_variable_overview.php
export_events_for_wiki.php
extensions.php
fill.php
fix_files.sh
generate_utf_casefold.php
generate_utf_confusables.php
generate_utf_tables.php
imageset_to_css.php
lang_duplicates.php
merge_attachment_tables.php
merge_post_tables.php
migration_tips.php
mysql_upgrader.php
namespacify.php
nuke-db.php
regex.php
remove-php-end-tags.py
rename_interfaces.php
repair_bots.php
search_fill.php
set_permissions.sh
unicode_testing.php
update_email_hash.php
utf_normalizer_test.php
docs
download
files
images
includes
install
language
phpbb
store
styles
.htaccess
app.php
common.php
composer.json
composer.lock
cron.php
faq.php
feed.php
index.php
mcp.php
memberlist.php
posting.php
report.php
search.php
ucp.php
viewforum.php
viewonline.php
viewtopic.php
web.config
tests
travis
.gitignore
.travis.yml
README.md
composer.phar
phpunit.xml.all
phpunit.xml.dist
phpunit.xml.functional
php-phpbb/phpBB/develop/rename_interfaces.php
2013-09-19 15:16:45 +02:00

52 lines
2.0 KiB
PHP

<?php
/**
*
* @copyright (c) 2012 phpBB Group
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
//
// Security message:
//
// This script is potentially dangerous.
// Remove or comment the next line (die(".... ) to enable this script.
// Do NOT FORGET to either remove this script or disable it after you have used it.
//
die("Please read the first lines of this script for instructions on how to enable it");
$code_dir = realpath(__DIR__ . '/../');
$test_dir = realpath(__DIR__ . '/../../tests/');
$iterator = new \AppendIterator();
$iterator->append(new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($code_dir)));
$iterator->append(new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($test_dir)));
$map = array(
'phpbb\request\request_interface' => 'phpbb\request\request_interface',
'phpbb\auth\provider\provider_interface' => 'phpbb\auth\provider\provider_interface',
'phpbb\avatar\driver\driver_interface' => 'phpbb\avatar\driver\driver_interface',
'phpbb\cache\driver\driver_interface' => 'phpbb\cache\driver\driver_interface',
'phpbb\db\migration\tool\tool_interface' => 'phpbb\db\migration\tool\tool_interface',
'phpbb\extension\extension_interface' => 'phpbb\extension\extension_interface',
'phpbb\groupposition\groupposition_interface' => 'phpbb\groupposition\groupposition_interface',
'phpbb\log\log_interface' => 'phpbb\log\log_interface',
'phpbb\notification\method\method_interface' => 'phpbb\notification\method\method_interface',
'phpbb\notification\type\type_interface' => 'phpbb\notification\type\type_interface',
'phpbb\request\request_interface' => 'phpbb\request\request_interface',
'phpbb\tree\tree_interface' => 'phpbb\tree\tree_interface',
);
foreach ($iterator as $file)
{
if ($file->getExtension() == 'php')
{
$code = file_get_contents($file->getPathname());
foreach ($map as $orig => $new)
{
$code = preg_replace("#([^a-z0-9_\$])$orig([^a-z0-9_])#i", '\\1' . $new . '\\2', $code);
}
file_put_contents($file->getPathname(), $code);
}
}