r87059 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r87058‎ | r87059 | r87060 >
Date:23:44, 27 April 2011
Author:kaldari
Status:ok
Tags:
Comment:
initial files for WikiLove ext
Modified paths:
  • /trunk/extensions/WikiLove (added) (history)
  • /trunk/extensions/WikiLove/WikiLove.i18n.php (added) (history)
  • /trunk/extensions/WikiLove/WikiLove.php (added) (history)
  • /trunk/extensions/WikiLove/WikiLove.sql (added) (history)

Diff [purge]

Index: trunk/extensions/WikiLove/WikiLove.php
@@ -0,0 +1,66 @@
 2+<?php
 3+/**
 4+ * MediaWiki WikiLove extension
 5+ * http://www.mediawiki.org/wiki/Extension:WikiLove
 6+ *
 7+ * This program is free software; you can redistribute it and/or modify
 8+ * it under the terms of the GNU General Public License as published by
 9+ * the Free Software Foundation; either version 2 of the License, or
 10+ * (at your option) any later version.
 11+ *
 12+ * This program is distributed in the hope that it will be useful,
 13+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
 14+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 15+ * GNU General Public License for more details.
 16+ *
 17+ * http://www.gnu.org/copyleft/gpl.html
 18+ */
 19+
 20+/**
 21+ * @file
 22+ * @ingroup Extensions
 23+ * @author Ryan Kaldari
 24+ */
 25+
 26+# Alert the user that this is not a valid entry point to MediaWiki if they try to access the file directly.
 27+if ( !defined( 'MEDIAWIKI' ) ) {
 28+ echo <<<EOT
 29+To install this extension, put the following line in LocalSettings.php:
 30+require_once( "\$IP/extensions/WikiLove/WikiLove.php" );
 31+EOT;
 32+ exit( 1 );
 33+}
 34+
 35+// Extension credits that will show up on Special:Version
 36+$wgExtensionCredits['other'][] = array(
 37+ 'path' => __FILE__,
 38+ 'name' => 'WikiLove',
 39+ 'version' => '0.1',
 40+ 'url' => 'http://www.mediawiki.org/wiki/Extension:WikiLove',
 41+ 'author' => array(
 42+ 'Ryan Kaldari'
 43+ ),
 44+ 'descriptionmsg' => 'wikilove-desc',
 45+);
 46+
 47+$dir = dirname( __FILE__ ) . '/';
 48+
 49+$wgHooks['LoadExtensionSchemaUpdates'][] = 'efWikiLoveSchema';
 50+
 51+$wgExtensionMessagesFiles['WikiLove'] = $dir . 'WikiLove.i18n.php';
 52+
 53+function efWikiLoveSchema( $updater = null ) {
 54+ $dir = dirname( __FILE__ ) . '/';
 55+ if ( $updater === null ) {
 56+ global $wgDBtype, $wgExtNewTables;
 57+
 58+ if ( $wgDBtype == 'mysql' ) {
 59+ $wgExtNewTables[] = array( 'wikilove_log', $dir . 'WikiLove.sql' );
 60+ }
 61+ } else {
 62+ if ( $updater->getDB()->getType() == 'mysql' ) {
 63+ $updater->addExtensionUpdate( array( 'addTable', 'wikilove_log', $dir . 'WikiLove.sql', true ) );
 64+ }
 65+ }
 66+ return true;
 67+}
Index: trunk/extensions/WikiLove/WikiLove.sql
@@ -0,0 +1,11 @@
 2+CREATE TABLE IF NOT EXISTS /*$wgDBprefix*/wikilove_log (
 3+ `wl_id` int NOT NULL PRIMARY KEY auto_increment,
 4+ `wl_timestamp` char(14) NOT NULL,
 5+ `wl_sender_id` int(11) NOT NULL,
 6+ `wl_receiver_id` int(11) NOT NULL,
 7+ `wl_wiki` varchar(64) NOT NULL,
 8+ `wl_type` varchar(64) NOT NULL,
 9+ `wl_template` varchar(64) NOT NULL,
 10+ `wl_message` varchar(255) NOT NULL,
 11+ `wl_email` bool NOT NULL default '0'
 12+) /*$wgDBTableOptions*/;
Index: trunk/extensions/WikiLove/WikiLove.i18n.php
@@ -0,0 +1,18 @@
 2+<?php
 3+/**
 4+ * Internationalisation for WikiLove extension
 5+ *
 6+ * @file
 7+ * @ingroup Extensions
 8+ */
 9+
 10+$messages = array();
 11+
 12+/** English
 13+ * @author Ryan Kaldari
 14+ */
 15+$messages['en'] = array(
 16+ 'wikilove-desc' => 'Adds an interface for facilitating positive user feedback to user talk pages',
 17+ 'wikilove' => 'WikiLove',
 18+);
 19+

Status & tagging log