r76428 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76427‎ | r76428 | r76429 >
Date:05:05, 10 November 2010
Author:travis
Status:deferred (Comments)
Tags:
Comment:
initial version
Modified paths:
  • /trunk/extensions/ProxyConnect (added) (history)
  • /trunk/extensions/ProxyConnect/ProxyConnect.body.php (added) (history)
  • /trunk/extensions/ProxyConnect/ProxyConnect.php (added) (history)

Diff [purge]

Index: trunk/extensions/ProxyConnect/ProxyConnect.php
@@ -0,0 +1,27 @@
 2+<?php
 3+if ( ! defined( 'MEDIAWIKI' ) )
 4+ die();
 5+
 6+/**#@+
 7+ * An extension that allows users to rate articles.
 8+ *
 9+ * @package MediaWiki
 10+ * @subpackage Extensions
 11+ *
 12+ * @link http://www.wikihow.com/WikiHow:ProxyConnect-Extension Documentation
 13+ *
 14+ *
 15+ * @author Travis Derouin <travis@wikihow.com>
 16+ * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
 17+ */
 18+
 19+$wgExtensionCredits['special'][] = array(
 20+ 'name' => 'ProxyConnect',
 21+ 'author' => 'Travis Derouin',
 22+ 'description' => 'Implements the server side functionality of Proxy Connect',
 23+ 'url' => 'http://www.wikihow.com/WikiHow:ProxyConnect-Extension',
 24+);
 25+
 26+
 27+$wgSpecialPages['ProxyConnect'] = 'ProxyConnect';
 28+$wgAutoloadClasses['ProxyConnect'] = dirname( __FILE__ ) . '/ProxyConnect.body.php';
Index: trunk/extensions/ProxyConnect/ProxyConnect.body.php
@@ -0,0 +1,22 @@
 2+<?
 3+class ProxyConnect extends SpecialPage {
 4+
 5+ function __construct() {
 6+ SpecialPage::SpecialPage( 'ProxyConnect' );
 7+ }
 8+
 9+ function execute ($par) {
 10+ global $wgUser, $wgOut;
 11+ $wgOut->disable();
 12+ header("Content-type: text/plain;");
 13+ if ($wgUser->getID() == 0)
 14+ return;
 15+ $result = "";
 16+ $result .= "UniqueID={$wgUser->getID()}\n";
 17+ $result .= "Name={$wgUser->getName()}\n";
 18+ $result .= "Email={$wgUser->getEmail()}\n";
 19+ wfDebug("ProxyConnect: returning $result\n");
 20+ echo $result;
 21+ return;
 22+ }
 23+}

Comments

#Comment by Reedy (talk | contribs)   10:51, 10 November 2010
+ * An extension that allows users to rate articles. 

That sounds wrong...

You should also be using

parent::__construct( 'ProxyConnect' );

rather than

SpecialPage::SpecialPage( 'ProxyConnect' );

Also, your help URL has nothing on it

You should really follow the Coding_standards, so brace the if statement, and add some more spaces

svn:eol-style native also needs setting. Please see Subversion/auto-props

#Comment by Tderouin (talk | contribs)   15:41, 10 November 2010

I've made the documentation changes and the constructor change.

For coding standards: this tool was developed for our website, so I will follow our own coding standards, rather than implement it with 2 different styles of whitespace. Sound fair enough?

#Comment by Reedy (talk | contribs)   16:43, 10 November 2010

That's fair enough :). Thanks!

Status & tagging log