Page MenuHomeDevCentral

D3613.diff
No OneTemporary

D3613.diff

diff --git a/_index/index.html b/_index/index.html
--- a/_index/index.html
+++ b/_index/index.html
@@ -5,11 +5,9 @@
<div class="row">
<div class="twelve columns">
<div id="slider">
- <img src="/_index/GerritActivityFeeds.png" data-caption="#captionGerrit" />
<img src="/_index/MOTD.png" data-caption="#captionMOTD" />
<img src="/_index/MX.png" data-caption="#captionMX" />
</div>
- <span class="orbit-caption" id="captionGerrit">Gerrit activity feeds for the Wikimedia developers community. <a href="/wikimedia/dev/feeds/">[ Go ]</a></span>
<span class="orbit-caption" id="captionMOTD">The fortune content in jive and valspeak. <a href="/gadgets/motd-variations.php">[ Go ]</a></span>
<span class="orbit-caption" id="captionMX">Determines the SMTP server from a mail address. <a href="/network/mx.php"> [ Go ]</a></span>
<hr />
diff --git a/includes/autoload.php b/includes/autoload.php
--- a/includes/autoload.php
+++ b/includes/autoload.php
@@ -38,11 +38,6 @@
$classes['ListOperation'] = './lists/ListOperation.php';
$classes['RegexpFactory'] = './lists/RegexpFactory.php';
- $classes['FeedEntry'] = './wikimedia/dev/feeds/index.php';
- $classes['FeedIndex'] = './wikimedia/dev/feeds/index.php';
- $classes['UsersFeedIndex'] = './wikimedia/dev/feeds/index.php';
- $classes['ProjectsFeedIndex'] = './wikimedia/dev/feeds/index.php';
-
//Loader
if (array_key_exists($className, $classes)) {
require_once($classes[$className]);
diff --git a/themes/RalfFallsIntoFoundation/footer.php b/themes/RalfFallsIntoFoundation/footer.php
--- a/themes/RalfFallsIntoFoundation/footer.php
+++ b/themes/RalfFallsIntoFoundation/footer.php
@@ -12,10 +12,6 @@
</div>
<div class="three columns">
<dl>
- <dt>Wikimedia dev</dt>
- <dd><a href="/wikimedia/dev/feeds/">Gerrit activity feeds</a></dd>
- <!--<dd>RSS generator</dd>-->
-
<dt>Wikimedia Writing Tools</dt>
<dd><a href="/wikimedia/write/sourcetemplatesgenerator/">Source templates generator</a></dd>
diff --git a/wikimedia/dev/_documents.xml b/wikimedia/dev/_documents.xml
deleted file mode 100644
--- a/wikimedia/dev/_documents.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<!--
- The following files are independant entry points able to be called directly, without index.php.
-
- You can configure your web server to bypass Pluton for these. If you don't, Pluton will know not to print header/footer.
--->
-<documents topic="wikimedia-dev">
- <document>
- <article>index</article>
- <title>Wikimedia :: dev</title>
- <description>Tools interacting with MediaWiki and Wikimedia development.</description>
- </document>
-</documents>
\ No newline at end of file
diff --git a/wikimedia/dev/feeds/Makefile b/wikimedia/dev/feeds/Makefile
deleted file mode 100644
--- a/wikimedia/dev/feeds/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-FEED_USER=surfboard
-
-all: permissions usersfeed
-
-permissions:
- chmod 755 user project
- chown $(FEED_USER) user project
- cd user ; chmod +x genindex ; chown $(FEED_USER) *.xml
- cd project ; chown $(FEED_USER) *.xml
-
-clean:
- cd user ; make clean
-
-usersfeed:
- cd user ; make
diff --git a/wikimedia/dev/feeds/_documents.xml b/wikimedia/dev/feeds/_documents.xml
deleted file mode 100644
--- a/wikimedia/dev/feeds/_documents.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<!--
- The following files are independant entry points able to be called directly, without index.php.
-
- You can configure your web server to bypass Pluton for these. If you don't, Pluton will know not to print header/footer.
--->
-<documents topic="wikimedia-dev-feeds">
- <document>
- <article>index</article>
- <title>Gerrit activity feeds</title>
- <description>Activity dashboard for projects and users.</description>
- <head><![CDATA[<style>
- .block-grid li {
- text-align: center;
- margin-bottom: 0.75em;
- }
- </style>]]>
-</head>
- </document>
-</documents>
\ No newline at end of file
diff --git a/wikimedia/dev/feeds/feed.php b/wikimedia/dev/feeds/feed.php
deleted file mode 100644
--- a/wikimedia/dev/feeds/feed.php
+++ /dev/null
@@ -1,36 +0,0 @@
-<?php
- //Reads an XML file
- function readxml ($file) {
- $xml = new DOMDocument();
- $xml->load($file);
- return $xml;
- }
-
- //Gets feed file from URL
- function get_feed_from_url() {
- $url = get_current_url_fragments();
- $feed = array_pop($url);
- $type = array_pop($url);
- if ($type != 'user' && $type != 'project') {
- message_die(GENERAL_ERROR, "Unknown feed type: $type", 'URL error');
- }
- return "wikimedia/dev/feeds/$type/$feed.xml";
- }
-
- $feed = get_feed_from_url();
- $xsl = 'xslt/activity-feed.xsl';
-
-
- if (!file_exists($feed)) {
- message_die(GENERAL_ERROR, "Feed not found: $feed");
- }
-
- $xslt = new XSLTProcessor();
- $xslt->importStylesheet(readxml($xsl));
-
-?>
-<div class="alert-box alert">
- This document is rendered from <a href="/<?= $feed ?>">this XML feed</a> with its XSL stylesheet. This is a temporary output, not the web one.
- <a href="" class="close">&times;</a>
-</div>
-<?= $xslt->transformToXml(readxml($feed)); ?>
diff --git a/wikimedia/dev/feeds/index.php b/wikimedia/dev/feeds/index.php
deleted file mode 100644
--- a/wikimedia/dev/feeds/index.php
+++ /dev/null
@@ -1,165 +0,0 @@
-<?php
-
-define('FEEDS_DIRECTORY', $document->get_directory());
-
-class FeedEntry {
- public function __construct ($title, $avatar, $file) {
- $this->title = $title;
- $this->avatar = $avatar;
- $this->file = $file;
-
- $data = [];
- if (preg_match("@/([a-f0-9\-]+)\.xml$@", $this->file, $data)) {
- $this->guid = $data[1];
- } elseif (preg_match("@/([a-zA-Z0-9_\.]+)\.xml$@", $this->file, $data)) {
- $this->guid = str_replace('.', '-', $data[1]);
- } else {
- dieprint_r($this->file);
- }
- }
-
- public $title;
- public $avatar;
- public $file;
- public $guid;
-}
-
-class FeedIndex {
- public $idPrefix;
- public $feeds;
-
- public function print_feeds ($feeds = null) {
- if ($feeds === null) $feeds = $this->feeds;
- foreach ($feeds as $feed) {
- echo "<li id='{$this->idPrefix}-{$feed->guid}'>";
- if ($feed->avatar) echo "<a href='$feed->file'><img src='$feed->avatar?s=64&d=identicon' class='avatar' /></a><br />";
- echo "<a href='$feed->file'>$feed->title</a></li>";
- }
- }
-}
-
-class UsersFeedIndex extends FeedIndex {
- public function __construct() {
- $this->idPrefix = "user";
- $xml = simplexml_load_file(FEEDS_DIRECTORY . '/user/index.xml');
- $feeds = array();
- foreach ($xml->feed as $feed) {
- $feeds[] = new FeedEntry(
- (string)$feed->title,
- (string)$feed->avatar,
- get_url_for(FEEDS_DIRECTORY, 'user', (string)$feed->file)
- );
- }
- $this->feeds = $feeds;
- }
-}
-
-class ProjectsFeedIndex extends FeedIndex {
- function __construct() {
- $this->idPrefix = "project";
- $this->feedBySection[0] = [];
- foreach ($this->sections as $section) {
- $this->feedBySection[$section] = [];
- }
- $dir = FEEDS_DIRECTORY . '/project';
- foreach (scandir($dir) as $file) {
- if (get_extension($file) == "xml") {
- $data = explode('.', $file);
- array_pop($data);
- $section = $data[0];
- if (!in_array($section, $this->sections)) { $section = 0; }
- $this->feedBySection[$section][] = new FeedEntry(
- str_replace('_', '-', implode('/', $data)),
- null,
- get_url_for(FEEDS_DIRECTORY, 'project', $file)
- );
- }
- }
- }
-
- public $sections = [
- "mediawiki",
- "operations"
- ];
-
- public $feedsBySection = [];
-
- public function print_section_feeds ($section, $restrictTo = null, $exclude = null) {
- if ($restrictTo == null) {
- $feeds = $this->feedBySection[$section];
- } else {
- $feeds = array();
- foreach ($this->feedBySection[$section] as $feed) {
- if (string_starts_with($feed->title, $restrictTo)) {
- $feed->title = substr($feed->title, strlen($restrictTo));
- $feeds[] = $feed;
- }
- }
- }
- if ($exclude) {
- $keptFeeds = [];
- foreach ($feeds as $feed) {
- if (!string_starts_with($feed->title, $exclude)) {
- $keptFeeds[] = $feed;
- }
- }
- $feeds = $keptFeeds;
- }
- $this->print_feeds($feeds);
- }
-}
-
-$projectsIndex = new ProjectsFeedIndex();
-$usersIndex = new UsersFeedIndex();
-?>
- <div class="four columns">
- <h2>Projects</h2>
-
-<ul class="accordion">
- <li class="active">
- <div class="title">
- <h5>MediaWiki</h5>
- </div>
- <div class="content">
- <ul>
- <?= $projectsIndex->print_section_feeds('mediawiki', null, 'mediawiki/extensions/'); ?>
- </ul>
- <br />
- <span class="round label">Extensions</span>
- <ul>
- <?= $projectsIndex->print_section_feeds('mediawiki', 'mediawiki/extensions/'); ?>
- </ul>
- </div>
- </li>
- <li>
- <div class="title">
- <h5>Operations</h5>
- </div>
- <div class="content">
- <ul><?= $projectsIndex->print_section_feeds('operations'); ?></ul>
- </div>
- </li>
- <li>
- <div class="title">
- <h5>Misc</h5>
- </div>
- <div class="content">
- <ul><?= $projectsIndex->print_section_feeds(0); ?></ul>
- </div>
- </li>
- </ul>
- <div class="panel callout radius">
- <p>This web interface is in alpha stage.</p>
- <p>Final version will provide nice feeds for humans and tools, and lot of links.</p>
- <p>Currently, only raw XML files are linked.</p>
- </div>
- </div>
-
- <!-- Thumbnails -->
- <div class="eight columns">
- <h2>Contributors</h2>
- <ul class="block-grid four-up">
- <?php $usersIndex->print_feeds(); ?>
- </ul>
- </div>
- <!-- End Thumbnails -->
diff --git a/wikimedia/dev/feeds/test.php b/wikimedia/dev/feeds/test.php
deleted file mode 100644
--- a/wikimedia/dev/feeds/test.php
+++ /dev/null
@@ -1,57 +0,0 @@
- <div class="three columns">
- <h2>Repository</h2>
- <p>Lorem ipsum dolor sit amet.</p>
- </div>
- <div class="nine columns">
-<p>&nbsp;</p>
- <!-- Feed Entry -->
- <div class="row">
- <div class="two columns mobile-one"><img src="http://placehold.it/80x80&text=[img]" /></div>
- <div class="ten columns">
- <p><strong>Lorem</strong> merged change <strong>Nunc abuntur</strong>.
-
- <h6>Reviewers</h6>
- <div class="row">
- <div class="two columns mobile-one"><img src="http://placehold.it/50x50&text=[img]" /></div>
- <div class="ten columns"><p>+1 &mdash; Looks good for me.</p></div>
- </div>
- <div class="row">
- <div class="two columns mobile-one"><img src="http://placehold.it/50x50&text=[img]" /></div>
- <div class="ten columns"><p>+1 &mdash; Nulla ham qui sint exercitation eiusmod commodo, chuck duis velit.</p></div>
- </div>
- <div class="row">
- <div class="two columns mobile-one"><img src="http://placehold.it/50x50&text=[img]" /></div>
- <div class="ten columns"><p>+2 &mdash; Aute in reprehenderit.</p></div>
- </div>
- </div>
- </div>
- <!-- End Feed Entry -->
-
- <hr />
-
- <!-- Feed Entry -->
- <div class="row">
- <div class="two columns mobile-one"><img src="http://placehold.it/80x80&text=[img]" /></div>
- <div class="ten columns">
- <p><strong>New comment on patchset Lorem ipsum dolor:</strong> sit amet nulla ham qui sint exercitation eiusmod commodo, chuck duis velit. Aute in reprehenderit, dolore aliqua non est magna in labore pig pork biltong.</p>
- <ul class="inline-list">
- <li><a href="">Reply</a></li>
- </ul>
- </div>
- </div>
- <!-- End Feed Entry -->
- <hr />
-
- <!-- Feed Entry -->
- <div class="row">
- <div class="two columns mobile-one"><img src="http://placehold.it/80x80&text=[img]" /></div>
- <div class="ten columns">
- <p><strong>New patchset: Lorem ipsum dolor.</strong>
- <ul class="inline-list">
- <li><a href="">Review it</a></li>
- </ul>
- </div>
- </div>
- <!-- End Feed Entry -->
- </div>
-<p>&nbsp;</p>
\ No newline at end of file
diff --git a/wikimedia/dev/feeds/user/Makefile b/wikimedia/dev/feeds/user/Makefile
deleted file mode 100644
--- a/wikimedia/dev/feeds/user/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-all: index.xml
-
-index.tmp:
- ls -t *-*-*-*.xml > index.tmp
-
-index.xml: index.tmp
- ./genindex
-
-clean:
- rm -f index.tmp
- rm -f index.xml
diff --git a/wikimedia/dev/feeds/user/genindex b/wikimedia/dev/feeds/user/genindex
deleted file mode 100644
--- a/wikimedia/dev/feeds/user/genindex
+++ /dev/null
@@ -1,106 +0,0 @@
-#!/usr/bin/env tclsh
-
-#
-# Generate feeds index
-#
-
-#Gets MD5 hash
-proc md5 {string} {
- #tcllib way:
- #package require md5
- #string tolower [::md5::md5 --hex $string]
-
- #BSD way:
- #exec -- md5 -q -s $string
-
- #Linux way:
- #exec -- echo -n $string | md5sum | sed "s/\ *-/\ \ /"
-
- #Solaris way:
- #lindex [exec -- echo -n $string | md5sum] 0
-
- #OpenSSL way:
- exec -- echo -n $string | openssl md5
-}
-
-namespace eval ::gravatar {
- #Gets Gravatar e-mail hash
- #http://en.gravatar.com/site/implement/hash/
- proc get_hash {mail} {
- md5 [string tolower [string trim $mail]]
- }
-
- #Gets Gravatar URL
- #http://en.gravatar.com/site/implement/images/
- #size: 1-512 (in pixels, default 80px
- #default: what to print if hash not found, default gravatar logo
- # values: 404 mm identicon monsterid wavatar retro or an URL
- #rating: g pg r x
- #We don't validate parameters, are API is unstable and evolves often.
- proc get_url {mail {size 0} {default ""} {rating ""}} {
- set url //www.gravatar.com/avatar/
- append url [get_hash $mail]
- set params {}
- if {$size != 0} {
- lappend params s $size
- }
- if {$default != ""} {
- lappend params d $default
- }
- if {$rating != ""} {
- lappend params r $rating
- }
- if {[llength $params] > 0} {
- append url ?[::http::formatQuery {*}$params]
- }
- return $url
- }
-}
-
-proc get_feed_info {feed} {
-
-}
-
-proc generate_index {{dir .} {index index.xml}} {
- set fd [open index.tmp r]
- set data [read $fd]
- close $fd
-
- set fd [open $index w]
- puts $fd "<feeds>"
- foreach file $data {
- if {$data == ""} {continue}
- # Gets feed name and e-mail
- set name ""
- set email ""
- set fdfeed [open $file r]
- set data [read $fdfeed 4096]
- close $fdfeed
- if [catch {
- set pos [string first "owner email=" $data]
- if {$pos == -1} {
- set pos [string first "<user email=" $data]
- }
- set pos2 [string first "\"" $data $pos+13]
- set email [string range $data $pos+13 $pos2-1]
-
- set pos [string first ">" $data $pos2]
- set pos2 [string first "<" $data $pos]
- set name [string range $data $pos+1 $pos2-1]
- }] {
- puts stderr "Not a valid feed file: $file"
- continue
- }
-
- # Writes feed entry (title, avatar from Gravatar and file)
- puts $fd "\t<feed>"
- puts $fd "\t\t<title>$name</title>"
- puts $fd "\t\t<avatar>[gravatar::get_url $email]</avatar>"
- puts $fd "\t\t<file>$file</file>"
- puts $fd "\t</feed>"
- }
- puts $fd "</feeds>"
- close $fd
-}
-
-generate_index
diff --git a/wikimedia/dev/index.php b/wikimedia/dev/index.php
deleted file mode 100644
--- a/wikimedia/dev/index.php
+++ /dev/null
@@ -1,9 +0,0 @@
-<img class="right" src="/images/commons/Wikimedia_Community_Logo.svg-120px.png">
-<h3>Tools available</h3>
-<ul class="menu">
- <li><a href="/wikimedia/dev/feeds">Gerrit activity feeds</a></li>
-</ul>
-<h3>Next?</h3>
-<p>A gerrit query to RSS converter, to offer <a href="https://www.mediawiki.org/w/index.php?title=Echo_%28Notifications%29&action=edit&section=17">in pages like this one</a> filtered results without L10n-bot.<br />
-This will be an alternative to the current gitweb RSS feed:<br />
-&lt;rss max=6&gt;https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/extensions/Echo.git&a=rss&lt;/rss&gt;</p>
diff --git a/wikimedia/index.php b/wikimedia/index.php
--- a/wikimedia/index.php
+++ b/wikimedia/index.php
@@ -1,8 +1,4 @@
<img class="right" src="/images/commons/Wikimedia_Community_Logo.svg-120px.png">
-<h3>Dev</h3>
-<ul class="menu">
- <li><a href="/wikimedia/dev/feeds">Gerrit activity feeds</a></li>
-</ul>
<h3>Write</h3>
<ul class="menu">
<li><a href="/wikimedia/write/sourcetemplatesgenerator">Source templates generator</a></li>

File Metadata

Mime Type
text/plain
Expires
Thu, Dec 5, 09:43 (6 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2278713
Default Alt Text
D3613.diff (15 KB)

Event Timeline