1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-04-13 12:22:03 +02:00

[ticket/9556] Drop php closing tags, add trailing newline

Closing tags converted using Oleg's script.
remove-php-end-tags.py -a .

Trailing newlines added using the following where $ext is file extension.
find . -type f -name "*.$ext" -print | xargs printf "e %s\nw\n" | ed -s;

Extensions: php, css, html, js, xml.

PHPBB3-9556
This commit is contained in:
Igor Wiedler 2010-11-09 08:59:25 +01:00
parent 2e51e68ca1
commit af5b9a9640
474 changed files with 274 additions and 738 deletions

View File

@ -411,5 +411,3 @@ function run_command($command)
$result = trim(`$command`);
echo "\n- Command Run: " . $command . "\n";
}
?>

View File

@ -207,4 +207,4 @@ class phpbb_Sniffs_Commenting_FileCommentSniff implements PHP_CodeSniffer_Sniff
$phpcsFile->addError($message, $tags['license'][1]);
}
}
}
}

View File

@ -48,4 +48,4 @@ class phpbb_Tests_Commenting_FileCommentUnitTest extends AbstractSniffUnitTest
8 => 1
);
}//end getWarningList()
}
}

View File

@ -40,4 +40,4 @@ class PHP_CodeSniffer_Standards_phpbb_phpbbCodingStandard extends PHP_CodeSniffe
{
return array();
}
}
}

View File

@ -618,5 +618,3 @@ function validate_range($value_ary, &$error)
}
}
}
?>

View File

@ -373,4 +373,4 @@
<!-- ENDIF -->
<!-- INCLUDE overall_footer.html -->
<!-- INCLUDE overall_footer.html -->

View File

@ -121,4 +121,4 @@
</form>
<!-- INCLUDE overall_footer.html -->
<!-- INCLUDE overall_footer.html -->

View File

@ -74,4 +74,4 @@
</form>
<!-- INCLUDE overall_footer.html -->
<!-- INCLUDE overall_footer.html -->

View File

@ -252,4 +252,4 @@
<!-- ENDIF -->
<!-- INCLUDE overall_footer.html -->
<!-- INCLUDE overall_footer.html -->

View File

@ -199,4 +199,4 @@
<!-- ENDIF -->
<!-- INCLUDE overall_footer.html -->
<!-- INCLUDE overall_footer.html -->

View File

@ -354,4 +354,4 @@
<!-- ENDIF -->
<!-- INCLUDE overall_footer.html -->
<!-- INCLUDE overall_footer.html -->

View File

@ -10,4 +10,4 @@
{PHPINFO}
</div>
<!-- INCLUDE overall_footer.html -->
<!-- INCLUDE overall_footer.html -->

View File

@ -68,4 +68,4 @@ function iframe_updated()
//]]>
</script>
<!-- INCLUDE overall_footer.html -->
<!-- INCLUDE overall_footer.html -->

View File

@ -49,4 +49,4 @@
<!-- ENDIF -->
<!-- INCLUDE overall_footer.html -->
<!-- INCLUDE overall_footer.html -->

View File

@ -75,4 +75,4 @@
{S_FORM_TOKEN}
</fieldset>
</form>
</form>

View File

@ -73,4 +73,4 @@
<input class="button1" type="submit" name="update" value="{L_SUBMIT}" />
</fieldset>
{S_FORM_TOKEN}
</form>
</form>

View File

@ -155,4 +155,4 @@
{S_FORM_TOKEN}
</fieldset>
</form>
</form>

View File

@ -63,4 +63,4 @@
<input class="button1" type="submit" name="update" value="{L_SUBMIT}" />
{S_FORM_TOKEN}
</fieldset>
</form>
</form>

View File

@ -114,4 +114,4 @@
<input class="button2" type="submit" name="preview" value="{L_PREVIEW}" />
{S_FORM_TOKEN}
</fieldset>
</form>
</form>

View File

@ -75,4 +75,4 @@
</script>
</body>
</html>
</html>

View File

@ -400,4 +400,4 @@ function getCaretPosition(txtarea)
}
return caretPos;
}
}

View File

@ -131,4 +131,4 @@
</form>
<!-- ENDIF -->
<!-- INCLUDE install_footer.html -->
<!-- INCLUDE install_footer.html -->

View File

@ -5,4 +5,4 @@
<p>{MESSAGE_TEXT}</p>
</div>
<!-- INCLUDE install_footer.html -->
<!-- INCLUDE install_footer.html -->

View File

@ -24,4 +24,4 @@
</div>
</body>
</html>
</html>

View File

@ -3,4 +3,4 @@
<h1>{TITLE}</h1>
<p>{BODY}</p>
<!-- INCLUDE install_footer.html -->
<!-- INCLUDE install_footer.html -->

View File

@ -259,4 +259,4 @@ table.hrdiff caption span {
</div>
<!-- INCLUDE simple_footer.html -->
<!-- INCLUDE simple_footer.html -->

View File

@ -5,4 +5,4 @@
<p>{MESSAGE_TEXT}</p>
</div>
<!-- INCLUDE overall_footer.html -->
<!-- INCLUDE overall_footer.html -->

View File

@ -32,4 +32,4 @@
</div>
</body>
</html>
</html>

View File

@ -35,4 +35,4 @@
<p>{L_ROLE_NOT_ASSIGNED}</p>
<!-- END role_mask -->
<!-- END role_mask -->

View File

@ -37,4 +37,4 @@
// ]]>
</script>
<!-- INCLUDE simple_footer.html -->
<!-- INCLUDE simple_footer.html -->

View File

@ -5,4 +5,4 @@
<p>{MESSAGE_TEXT}</p>
</div>
<!-- INCLUDE simple_footer.html -->
<!-- INCLUDE simple_footer.html -->

View File

@ -18,4 +18,4 @@
</div>
</div>
</div>
<!-- INCLUDE simple_footer.html -->
<!-- INCLUDE simple_footer.html -->

View File

@ -49,5 +49,3 @@ $template->assign_vars(array(
$template->display('body');
garbage_collection();
?>

View File

@ -237,5 +237,3 @@ foreach ($cache->obtain_hooks() as $hook)
{
@include($phpbb_root_path . 'includes/hooks/' . $hook . '.' . $phpEx);
}
?>

View File

@ -283,5 +283,3 @@ function unlock_cron()
WHERE config_name = 'cron_lock' AND config_value = '" . $db->sql_escape(CRON_ID) . "'";
$db->sql_query($sql);
}
?>

View File

@ -413,5 +413,3 @@ function mass_auth($ug_type, $forum_id, $ug_id, $acl_list, $setting)
unset($sql_ary);
}
?>

View File

@ -143,5 +143,3 @@ function adjust_avatar($old_name, $midfix)
}
return false;
}
?>

View File

@ -170,5 +170,3 @@ $db->sql_freeresult($result);
// Done
$db->sql_close();
?>

View File

@ -122,5 +122,3 @@ $db->sql_freeresult($result);
// Done
$db->sql_close();
?>

View File

@ -128,5 +128,3 @@ $db->sql_freeresult($result);
// Done
$db->sql_close();
?>

View File

@ -126,5 +126,3 @@ $db->sql_freeresult($result);
// Done
$db->sql_close();
?>

View File

@ -126,4 +126,3 @@ $db->sql_freeresult($result);
// Done
$db->sql_close();
echo 'done';
?>

View File

@ -48,5 +48,3 @@ echo 'FINISHED';
// Done
$db->sql_close();
?>

View File

@ -458,5 +458,3 @@ function make_user($username)
}
}
?>

View File

@ -72,5 +72,3 @@ do
while ($start);
echo "<p><b>Done</b></p>\n";
?>

View File

@ -58,5 +58,3 @@ while ($row = $db->sql_fetchrow($result))
$db->sql_freeresult($result);
echo "<p><b>Done</b></p>\n";
?>

View File

@ -2047,5 +2047,3 @@ EOF;
}
echo 'done';
?>

View File

@ -543,5 +543,3 @@ fclose($fp);
echo '<br>Finished!';
flush();
?>

View File

@ -186,5 +186,3 @@ function rndm_username()
return $usernames[array_rand($usernames)];
}
?>

View File

@ -152,5 +152,3 @@ function download($url)
echo "\n";
}
?>

View File

@ -240,5 +240,3 @@ function download($url)
echo "\n";
}
?>

View File

@ -569,4 +569,4 @@ function cp_to_utf($cp)
{
return chr($cp);
}
}
}

View File

@ -137,4 +137,4 @@ function find_modules($dirname)
?>
</body>
</html>
</html>

View File

@ -76,5 +76,3 @@ $db->sql_query($sql);
//$db->sql_query("DROP TABLE {$table_prefix}attach_temp");
echo "<p><b>Done</b></p>\n";
?>

View File

@ -205,5 +205,3 @@ foreach ($sql_ary as $sql)
}
echo "<p><b>Done</b></p>\n";
?>

View File

@ -1398,5 +1398,3 @@ function get_schema_struct()
return $schema_data;
}
?>

View File

@ -54,5 +54,3 @@ else
flush();
}
}
?>

View File

@ -80,5 +80,3 @@ echo 'www.URL: ' . $www_url . "<br />\n";
// no schema and no authority
$relative_url = "$segment$path_abempty(?:\?$query)?(?:\#$fragment)?";
echo 'relative URL: ' . $relative_url . "<br />\n";
?>

View File

@ -0,0 +1,65 @@
#!/usr/bin/env python
# Remove ending PHP tags '?>'
# @author Oleg Pudeyev
# @license http://opensource.org/licenses/gpl-license.php GNU Public License
import sys, os, os.path, optparse
def error(message, code):
print >>sys.stderr, message
exit(code)
parser = optparse.OptionParser()
parser.add_option('-a', '--aggressive', help='Remove ending tags when they are followed by whitespace', action='store_true')
options, args = parser.parse_args()
if len(args) != 1:
parser.usage()
error("Usage: remove-php-end-tags path", 2)
path = args[0]
if not os.path.exists(path):
error("Path does not exist: %s" % path, 3)
if options.aggressive:
import re
fix_re = re.compile(r'\s*\?>\s*$')
def fix_content(content):
content = fix_re.sub(r'\n', content)
return content
else:
def fix_content(content):
if content.endswith('?>'):
content = content[:-2].strip() + "\n"
return content
def process_file(path):
f = open(path)
try:
content = f.read()
finally:
f.close()
fixed_content = fix_content(content)
if content != fixed_content:
f = open(path, 'w')
try:
f.write(fixed_content)
finally:
f.close()
def process_dir(path):
for root, dirs, files in os.walk(path):
if '.svn' in dirs:
dirs.remove('.svn')
for file in files:
if file.endswith('.php'):
path = os.path.join(root, file)
process_file(path)
if os.path.isdir(path):
process_dir(path)
else:
process_file(path)

View File

@ -147,5 +147,3 @@ function add_bots($bots)
}
}
}
?>

View File

@ -116,5 +116,3 @@ function utf8_normalize_nfkc($strings)
return $strings;
}
?>

View File

@ -54,4 +54,3 @@ echo 'FINISHED';
// Done
$db->sql_close();
?>

View File

@ -388,4 +388,4 @@ function cp_to_utf($cp)
{
return chr($cp);
}
}
}

View File

@ -309,5 +309,3 @@ else
file_gc();
}
}
?>

View File

@ -85,5 +85,3 @@ $template->set_filenames(array(
make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"));
page_footer();
?>

View File

@ -1489,6 +1489,3 @@ class phpbb_feed_topics_active extends phpbb_feed_topic_base
$item_row['title'] = (isset($row['forum_name']) && $row['forum_name'] !== '') ? $row['forum_name'] . ' ' . $this->separator . ' ' . $item_row['title'] : $item_row['title'];
}
}
?>

View File

@ -80,5 +80,3 @@ class acm extends acm_memory
return apc_delete($this->key_prefix . $var);
}
}
?>

View File

@ -117,5 +117,3 @@ class acm extends acm_memory
return eaccelerator_rm($this->key_prefix . $var);
}
}
?>

View File

@ -728,5 +728,3 @@ class acm
return @unlink($filename);
}
}
?>

View File

@ -134,5 +134,3 @@ class acm extends acm_memory
return $this->memcache->delete($this->key_prefix . $var);
}
}
?>

View File

@ -435,5 +435,3 @@ class acm_memory
return true;
}
}
?>

View File

@ -152,5 +152,3 @@ class acm
return false;
}
}
?>

View File

@ -117,5 +117,3 @@ class acm extends acm_memory
return xcache_isset($this->key_prefix . $var);
}
}
?>

View File

@ -1456,5 +1456,3 @@ class acp_attachments
}
}
?>

View File

@ -248,5 +248,3 @@ class acp_ban
);
}
}
?>

View File

@ -472,5 +472,3 @@ class acp_bbcodes
);
}
}
?>

View File

@ -985,5 +985,3 @@ class acp_board
}
}
?>

View File

@ -414,5 +414,3 @@ class acp_bots
return ($row) ? false : true;
}
}
?>

View File

@ -144,5 +144,3 @@ class acp_captcha
exit_handler();
}
}
?>

View File

@ -2455,5 +2455,3 @@ function fgetd_seekless(&$fp, $delim, $read, $seek, $eof, $buffer = 8192)
return false;
}
?>

View File

@ -104,5 +104,3 @@ class acp_disallow
);
}
}
?>

View File

@ -258,5 +258,3 @@ class acp_email
}
}
?>

View File

@ -1950,5 +1950,3 @@ class acp_forums
}
}
?>

View File

@ -794,5 +794,3 @@ class acp_groups
}
}
}
?>

View File

@ -951,5 +951,3 @@ class acp_icons
return $item_count;
}
}
?>

View File

@ -308,5 +308,3 @@ class acp_inactive
$this->page_title = 'ACP_INACTIVE_USERS';
}
}
?>

View File

@ -127,5 +127,3 @@ class acp_jabber
));
}
}
?>

View File

@ -1469,5 +1469,3 @@ $lang = array_merge($lang, array(
return $entry;
}
}
?>

View File

@ -173,5 +173,3 @@ class acp_logs
}
}
}
?>

View File

@ -613,5 +613,3 @@ class acp_main
$this->page_title = 'ACP_MAIN';
}
}
?>

View File

@ -1061,5 +1061,3 @@ class acp_modules
return $this->lang_name($target['module_langname']);
}
}
?>

View File

@ -567,5 +567,3 @@ class acp_permission_roles
$auth_admin->acl_clear_prefetch();
}
}
?>

View File

@ -1312,5 +1312,3 @@ class acp_permissions
);
}
}
?>

View File

@ -80,5 +80,3 @@ class acp_php_info
$template->assign_var('PHPINFO', $output);
}
}
?>

View File

@ -1625,5 +1625,3 @@ class acp_profile
return $sql;
}
}
?>

View File

@ -462,5 +462,3 @@ class acp_prune
$db->sql_freeresult($result);
}
}
?>

View File

@ -236,5 +236,3 @@ class acp_ranks
}
}
?>

View File

@ -371,5 +371,3 @@ class acp_reasons
$db->sql_freeresult($result);
}
}
?>

View File

@ -625,5 +625,3 @@ class acp_search
return $error;
}
}
?>

View File

@ -86,5 +86,3 @@ class acp_send_statistics
}
}
}
?>

Some files were not shown because too many files have changed in this diff Show More