r112636 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r112635‎ | r112636 | r112637 >
Date:20:57, 28 February 2012
Author:krinkle
Status:ok
Tags:
Comment:
[svn/users.php] clean up
* doctype
* rm unused vars and exec() "home/demon/commit" stuff
* centralize svn dir
Modified paths:
  • /trunk/tools/subversion/users.php (modified) (history)

Diff [purge]

Index: trunk/tools/subversion/users.php
@@ -1,8 +1,8 @@
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">
 2+<!DOCTYPE html>
 3+<html lang="en" dir="ltr">
44 <head>
55 <title>Wikimedia Subversion user list</title>
6 - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 6+ <meta charset="UTF-8">
77 </head>
88 <body>
99 <h1>Wikimedia Subversion user list</h1>
@@ -15,14 +15,14 @@
1616 <?php
1717
1818 $time = microtime( true );
 19+$svnUsersDir = '/var/cache/svnusers';
1920 exec( "getent passwd", $lines );
20 -exec( "HOME=/tmp /usr/bin/svn up /var/cache/svnusers 2>&1", $output, $retval );
 21+exec( "HOME=/tmp /usr/bin/svn up $svnUsersDir 2>&1", $output, $retval );
2122 if ( $retval ) {
2223 $error = implode( "\n", $output );
2324 } else {
2425 $error = false;
2526 }
26 -$committed = file( '/home/demon/commit' );
2727
2828 foreach ( $lines as $line ) {
2929 $parts = explode( ':', trim( $line ) );
@@ -34,7 +34,6 @@
3535 $userInfo = array_map( 'htmlspecialchars', $userInfo );
3636 $link = $userInfo['url'] ? "<a href=\"{$userInfo['url']}\">$encUsername</a>" : $encUsername;
3737 $readyForGit = isset( $userInfo['name'] ) && isset( $userInfo['email'] ) ? 'Y' : 'N';
38 - $haveCommitted = in_array( $parts[0], $committed ) ? 'Y' : 'N';
3938
4039 $rows[$parts[0]] = <<<EOT
4140 <tr id="$encUsername">
@@ -58,7 +57,7 @@
5958 'name' => '',
6059 'url' => ''
6160 );
62 - $userFileLines = @file( "/var/cache/svnusers/$userName" );
 61+ $userFileLines = @file( "$svnUsersDir/$userName" );
6362 if ( $userFileLines ) {
6463 foreach ( $userFileLines as $userLine ) {
6564 if ( preg_match( '/^([\w-]+):\s*(.*?)\s*$/', $userLine, $m ) ) {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r112631Updated from formey...reedy20:36, 28 February 2012

Status & tagging log