r112631 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r112630‎ | r112631 | r112632 >
Date:20:36, 28 February 2012
Author:reedy
Status:resolved (Comments)
Tags:
Comment:
Updated from formey

Dropped trailing ?>
Modified paths:
  • /trunk/tools/subversion/users.php (modified) (history)

Diff [purge]

Index: trunk/tools/subversion/users.php
@@ -1,56 +1,57 @@
2 -<!DOCTYPE html>
3 -<html>
4 - <head>
5 - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6 - <title>Wikimedia Subversion user list</title>
7 - </head>
8 -
9 - <body>
10 - <h1>Wikimedia Subversion user list</h1>
11 - <table border="1">
12 - <tr>
13 - <th>Username</th>
14 - <th>Real name</th>
15 - <th>Ready for git?</th>
16 - </tr>
 2+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 3+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
 4+<head>
 5+ <title>Wikimedia Subversion user list</title>
 6+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 7+</head>
 8+<body>
 9+<h1>Wikimedia Subversion user list</h1>
 10+<table border="1">
 11+ <tr>
 12+ <th>Username</th>
 13+ <th>Real name</th>
 14+ <th>Ready for git?</th>
 15+ </tr>
1716 <?php
1817
1918 $time = microtime( true );
20 -$lines = file( '/etc/passwd' );
 19+exec( "getent passwd", $lines );
2120 exec( "HOME=/tmp /usr/bin/svn up /var/cache/svnusers 2>&1", $output, $retval );
2221 if ( $retval ) {
2322 $error = implode( "\n", $output );
2423 } else {
2524 $error = false;
2625 }
 26+$committed = file( '/home/demon/commit' );
2727
2828 foreach ( $lines as $line ) {
2929 $parts = explode( ':', trim( $line ) );
30 - if ( !isset( $parts[2] ) || $parts[2] < 501 ) {
 30+ if ( !isset( $parts[2] ) || $parts[2] < 500 ) {
3131 continue;
3232 }
3333 $userInfo = getUserInfo( $parts[0] );
3434 $encUsername = htmlspecialchars( $parts[0] );
3535 $userInfo = array_map( 'htmlspecialchars', $userInfo );
36 - $readyForGit = isset( $userInfo['name'] ) && isset( $userInfo['email'] ) ? 'Y' : 'N';
3736 $link = $userInfo['url'] ? "<a href=\"{$userInfo['url']}\">$encUsername</a>" : $encUsername;
 37+ $readyForGit = isset( $userInfo['name'] ) && isset( $userInfo['email'] ) ? 'Y' : 'N';
 38+ $haveCommitted = in_array( $parts[0], $committed ) ? 'Y' : 'N';
3839
3940 $rows[$parts[0]] = <<<EOT
40 - <tr id="$encUsername">
41 - <td>$link</td>
42 - <td>{$userInfo['name']}</td>
43 - <td>$readyForGit</td>
44 - </tr>
 41+<tr id="$encUsername">
 42+<td>$link</td>
 43+<td>{$userInfo['name']}</td>
 44+<td>$readyForGit</td>
 45+</tr>
4546
4647 EOT;
4748 }
4849 ksort( $rows );
49 -echo implode( '', $rows );
50 -echo " </table>\n";
51 -echo " <!-- Request time: " . ( microtime( true ) - $time ) . " -->\n";
 50+echo implode( '', $rows ) . "</table>\n";
 51+echo "<!-- Request time: " . ( microtime( true ) - $time ) . " -->\n";
5252 if ( $retval ) {
53 - echo " <p>Error: " . htmlspecialchars( $error ) . "</p>\n";
 53+ echo "<p>Error: " . htmlspecialchars( $error ) . "</p>\n";
5454 }
 55+echo "</html>\n";
5556
5657 function getUserInfo( $userName ) {
5758 $userInfo = array(
@@ -69,8 +70,3 @@
7071 }
7172 return $userInfo;
7273 }
73 -
74 -?>
75 -
76 - </body>
77 -</html>

Follow-up revisions

RevisionCommit summaryAuthorDate
r112636[svn/users.php] clean up...krinkle20:57, 28 February 2012

Comments

#Comment by Nikerabbit (talk | contribs)   07:40, 29 February 2012

What was wrong with html5?

#Comment by P858snake (talk | contribs)   08:24, 29 February 2012

I think he was reverting to a known working version, It broke when were playing with it just after I submitted the HTML5 patch.

#Comment by P858snake (talk | contribs)   08:24, 29 February 2012

Also krinkle changed it back (and added moar!) in r112636

Status & tagging log