[MediaWiki-CVS] SVN: [93800] trunk/tools/wsor/scripts/classes/WSORSlaveDataLoader.py

2011-08-03 Thread rfaulk
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93800

Revision: 93800
Author:   rfaulk
Date: 2011-08-03 06:42:41 + (Wed, 03 Aug 2011)
Log Message:
---
Category Loader now collects data for in-degree, out-degree, subcategeories, 
and the nodes which only have edges in or out exclusively 

Modified Paths:
--
trunk/tools/wsor/scripts/classes/WSORSlaveDataLoader.py

Modified: trunk/tools/wsor/scripts/classes/WSORSlaveDataLoader.py
===
--- trunk/tools/wsor/scripts/classes/WSORSlaveDataLoader.py 2011-08-03 
05:56:29 UTC (rev 93799)
+++ trunk/tools/wsor/scripts/classes/WSORSlaveDataLoader.py 2011-08-03 
06:42:41 UTC (rev 93800)
@@ -12,7 +12,7 @@
 
 
  Import python base modules 
-import sys, getopt, re, datetime, logging, MySQLdb, settings
+import sys, getopt, re, datetime, logging, MySQLdb, settings, operator
 import networkx as nx
 
  Import Analytics modules 
@@ -91,13 +91,13 @@
 self._query_names_['get_subcategories'] = select cl_to from 
categorylinks_cp where cl_from = %s
 self._query_names_['delete_from_recs'] = delete from 
rfaulk.categorylinks_cp where cl_from = %s
 self._query_names_['is_empty'] = select * from 
rfaulk.categorylinks_cp limit 1
-self._query_names_['get_category_links'] = select cl_from, cl_to from 
categorylinks_cp limit 100
+self._query_names_['get_category_links'] = select cl_from, cl_to from 
categorylinks_cp limit 1
 
 WSORSlaveDataLoader.__init__(self)
 logging.info('Creating CategoryLoader')
 
 
-
+Retrieves all rows out of the category links table
 
 def get_category_links(self):
 
@@ -236,8 +236,8 @@
  
 def extract_hierarchy(self):
 
-#self.drop_category_links_cp_table()
-#self.create_category_links_cp_table()
+self.drop_category_links_cp_table()
+self.create_category_links_cp_table()
 
  Create graph 
 logging.info('Initializing directed graph...')
@@ -256,24 +256,83 @@
 links = self.get_category_links()
 count = 0
 
+out_degrees = dict()
+in_degrees = dict()
+subcategories = dict()
+
+ Process subcategory links 
 for row in links:
 
 cl_from = int(row[0])
 cl_to = str(row[1])
 cl_from = self.get_page_title(cl_from)
+
+try:
+subcategories[cl_from].append(cl_to)
 
+except KeyError:
+subcategories[cl_from] = list()
+subcategories[cl_from].append(cl_to)
+
+try:
+out_degrees[cl_from] = out_degrees[cl_from] + 1
+except KeyError:
+out_degrees[cl_from] = 1
+
+try:
+in_degrees[cl_to] = in_degrees[cl_to] + 1
+except KeyError:
+in_degrees[cl_to] = 1
+ 
 directed_graph.add_weighted_edges_from([(cl_from, cl_to, 1)])
 
-if self.__DEBUG__:
+if self.__DEBUG__ and count % 1000 == 0:
 
 logging.debug('%s: %s - %s' % (str(count), cl_from, cl_to))
-count = count + 1
+
+count = count + 1
 
+logging.info('Sorting in degree list.')
+sorted_in_degrees = sorted(in_degrees.iteritems(), 
key=operator.itemgetter(1), reverse=True)
+logging.info('Sorting out degree list.')
+sorted_out_degrees = sorted(out_degrees.iteritems(), 
key=operator.itemgetter(1), reverse=True)
+
+in_only, out_only = 
self.get_uni_directionally_linked_categories(sorted_in_degrees, 
sorted_out_degrees)
+
 logging.info('Category links finished processing.')
 
-return directed_graph
+return directed_graph, in_degrees, out_degrees, sorted_in_degrees, 
sorted_out_degrees, subcategories, in_only, out_only
 
 
+
+Returns 
+
+def get_uni_directionally_linked_categories(self, in_degrees, out_degrees):
+
+logging.info('Generating lists of categories have either only in 
degrees or out degrees.')
+
+in_keys = list()
+for i in in_degrees:
+in_keys.append(i[0])
+
+out_keys = list()
+for i in out_degrees:
+out_keys.append(i[0])
+
+in_only = list()
+out_only = list()
+
+for i in in_degrees:
+if not(i[0] in out_keys):
+in_only.append(i) 
+
+for i in out_degrees:
+if not(i[0] in in_keys):
+out_only.append(i)
+
+return in_only, out_only
+
+
  drop rfaulk.categorylinks_cp 
 def 

[MediaWiki-CVS] SVN: [93801] trunk/extensions/RecordAdmin

2011-08-03 Thread nad
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93801

Revision: 93801
Author:   nad
Date: 2011-08-03 07:02:04 + (Wed, 03 Aug 2011)
Log Message:
---
make JS loading work witj 1.17 addModules but maintain backward campatibility 
with pre 1.17

Modified Paths:
--
trunk/extensions/RecordAdmin/RecordAdmin.php
trunk/extensions/RecordAdmin/RecordAdmin_body.php

Added Paths:
---
trunk/extensions/RecordAdmin/recordadmin.js

Modified: trunk/extensions/RecordAdmin/RecordAdmin.php
===
--- trunk/extensions/RecordAdmin/RecordAdmin.php2011-08-03 06:42:41 UTC 
(rev 93800)
+++ trunk/extensions/RecordAdmin/RecordAdmin.php2011-08-03 07:02:04 UTC 
(rev 93801)
@@ -10,8 +10,10 @@
  * @author Siebrand Mazeland
  * @licence GNU General Public Licence 2.0 or later
  */
-define( 'RECORDADMIN_VERSION', '1.2.10, 2011-08-01' );
+define( 'RECORDADMIN_VERSION', '1.3.0, 2011-08-03' );
 
+$wgRecordAdminExtPath = preg_replace( |^.*(/extensions/.*$)|, 
$wgScriptPath$1, dirname( __FILE__ ) );
+
 $dir = dirname( __FILE__ ) . '/';
 $wgExtensionMessagesFiles['RecordAdmin'] = $dir . 'RecordAdmin.i18n.php';
 $wgExtensionAliasesFiles['RecordAdmin']  = $dir . 'RecordAdmin.alias.php';
@@ -35,7 +37,16 @@
 
 $wgExtensionFunctions[] = 'wfSetupRecordAdmin';
 function wfSetupRecordAdmin() {
-   global $wgRecordAdmin;
+   global $wgRecordAdmin, $wgResourceModules, $wgRecordAdminExtPath;
+
+   $wgResourceModules['ext.recordadmin'] = array(
+   'scripts' = array( 'recordadmin.js' ),
+   'styles' = array(),
+   'dependencies' = array( 'jquery' ),
+   'localBasePath' = dirname( __FILE__ ),
+   'remoteExtPath' = $wgRecordAdminExtPath
+   );
+
$wgRecordAdmin = new RecordAdmin();
 }
 

Modified: trunk/extensions/RecordAdmin/RecordAdmin_body.php
===
--- trunk/extensions/RecordAdmin/RecordAdmin_body.php   2011-08-03 06:42:41 UTC 
(rev 93800)
+++ trunk/extensions/RecordAdmin/RecordAdmin_body.php   2011-08-03 07:02:04 UTC 
(rev 93801)
@@ -108,36 +108,20 @@
$editPage-editFormTextTop = $tabset;
 
# JS to add an onSubmit method that adds the record 
forms contents to hidden values in the edit form
-   $wgOut-addScript( script type='$wgJsMimeType'
-   function raRecordForms() {
-   var forms = [ $jsFormsList ];
-   for( i = 0; i  forms.length; i++ ) {
-   var type = forms[i];
-   var form = 
document.getElementById( type + '-form' );
-   var tags = [ 'input', 'select', 
'textarea' ];
-   for( j = 0; j  tags.length; 
j++ ) {
-   var inputs = 
form.getElementsByTagName( tags[j] );
-   for( k = 0; k  
inputs.length; k++ ) {
-   var input = 
jQuery( inputs[k] );
-   if( 
input.attr('type') != 'checkbox' || input.attr('checked') ) {
-   var 
multi = input.val();
-   if( 
typeof( multi ) == 'object' ) multi = multi.join('\\n');
-   var key 
= type + ':' + inputs[k].getAttribute('name');
-   var 
hidden = jQuery( document.createElement( 'input' ) );
-   
hidden.attr( 'name', key );
-   
hidden.attr( 'type', 'hidden' );
-   
hidden.val( multi );
-   jQuery( 
'#editform' ).append( hidden );
-   }
-   }
-   }
+   if( is_callable( array( $wgOut, 'addModules' ) ) ) {
+   $wgOut-addModules( 'ext.recordadmin' );
+   } else {
+   global $wgRecordAdminExtPath;
+   $wgOut-addScript( script 
type=\$wgJsMimeType\ src=\$wgRecordAdminExtPath/recordadmin.js\/script 
);
+   $wgOut-addScript( script 
type=\$wgJsMimeType\
+  

[MediaWiki-CVS] SVN: [93802] trunk/phase3/includes/api

2011-08-03 Thread catrope
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93802

Revision: 93802
Author:   catrope
Date: 2011-08-03 07:05:21 + (Wed, 03 Aug 2011)
Log Message:
---
Followup r92044: force HTTP on URLs output by the API, now that wfExpandUrl() 
has a flag for this

Modified Paths:
--
trunk/phase3/includes/api/ApiParse.php
trunk/phase3/includes/api/ApiQuery.php
trunk/phase3/includes/api/ApiQueryIWLinks.php
trunk/phase3/includes/api/ApiQueryImageInfo.php
trunk/phase3/includes/api/ApiQueryInfo.php
trunk/phase3/includes/api/ApiQueryLangLinks.php
trunk/phase3/includes/api/ApiQuerySiteinfo.php

Modified: trunk/phase3/includes/api/ApiParse.php
===
--- trunk/phase3/includes/api/ApiParse.php  2011-08-03 07:02:04 UTC (rev 
93801)
+++ trunk/phase3/includes/api/ApiParse.php  2011-08-03 07:05:21 UTC (rev 
93802)
@@ -353,7 +353,7 @@
 
$entry['lang'] = $bits[0];
if ( $title ) {
-   $entry['url'] = wfExpandUrl( 
$title-getFullURL() );
+   $entry['url'] = wfExpandUrl( 
$title-getFullURL(), PROTO_HTTP );
}
$this-getResult()-setContent( $entry, $bits[1] );
$result[] = $entry;
@@ -435,7 +435,7 @@
 
$title = Title::newFromText( 
{$prefix}:{$title} );
if ( $title ) {
-   $entry['url'] = wfExpandUrl( 
$title-getFullURL() );
+   $entry['url'] = wfExpandUrl( 
$title-getFullURL(), PROTO_HTTP );
}
 
$this-getResult()-setContent( $entry, 
$title-getFullText() );

Modified: trunk/phase3/includes/api/ApiQuery.php
===
--- trunk/phase3/includes/api/ApiQuery.php  2011-08-03 07:02:04 UTC (rev 
93801)
+++ trunk/phase3/includes/api/ApiQuery.php  2011-08-03 07:05:21 UTC (rev 
93802)
@@ -374,7 +374,7 @@
);
if ( $this-iwUrl ) {
$title = Title::newFromText( $rawTitleStr );
-   $item['url'] = wfExpandUrl( 
$title-getFullURL() );
+   $item['url'] = wfExpandUrl( 
$title-getFullURL(), PROTO_HTTP );
}
$intrwValues[] = $item;
}

Modified: trunk/phase3/includes/api/ApiQueryIWLinks.php
===
--- trunk/phase3/includes/api/ApiQueryIWLinks.php   2011-08-03 07:02:04 UTC 
(rev 93801)
+++ trunk/phase3/includes/api/ApiQueryIWLinks.php   2011-08-03 07:05:21 UTC 
(rev 93802)
@@ -112,7 +112,7 @@
if ( $params['url'] ) {
$title = Title::newFromText( 
{$row-iwl_prefix}:{$row-iwl_title} );
if ( $title ) {
-   $entry['url'] = wfExpandUrl( 
$title-getFullURL() );
+   $entry['url'] = wfExpandUrl( 
$title-getFullURL(), PROTO_HTTP );
}
}
 

Modified: trunk/phase3/includes/api/ApiQueryImageInfo.php
===
--- trunk/phase3/includes/api/ApiQueryImageInfo.php 2011-08-03 07:02:04 UTC 
(rev 93801)
+++ trunk/phase3/includes/api/ApiQueryImageInfo.php 2011-08-03 07:05:21 UTC 
(rev 93802)
@@ -348,7 +348,7 @@
if ( !is_null( $thumbParams ) ) {
$mto = $file-transform( $thumbParams );
if ( $mto  !$mto-isError() ) {
-   $vals['thumburl'] = wfExpandUrl( 
$mto-getUrl() );
+   $vals['thumburl'] = wfExpandUrl( 
$mto-getUrl(), PROTO_HTTP );
 
// bug 23834 - If the URL's are the 
same, we haven't resized it, so shouldn't give the wanted
// thumbnail sizes for the thumbnail 
actual size

Modified: trunk/phase3/includes/api/ApiQueryInfo.php
===
--- trunk/phase3/includes/api/ApiQueryInfo.php  2011-08-03 07:02:04 UTC (rev 
93801)
+++ trunk/phase3/includes/api/ApiQueryInfo.php  2011-08-03 07:05:21 UTC (rev 
93802)
@@ -380,8 +380,8 @@
}
 
if ( $this-fld_url ) {
-   $pageInfo['fullurl'] = wfExpandUrl( 
$title-getFullURL() );
-   $pageInfo['editurl'] = wfExpandUrl( $title-getFullURL( 
'action=edit' ) );
+   $pageInfo['fullurl'] = wfExpandUrl( 
$title-getFullURL(), PROTO_HTTP );
+   

[MediaWiki-CVS] SVN: [93803] trunk/extensions/cldr/LocalNamesEn.php

2011-08-03 Thread nikerabbit
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93803

Revision: 93803
Author:   nikerabbit
Date: 2011-08-03 07:06:04 + (Wed, 03 Aug 2011)
Log Message:
---
Change language name per 
https://translatewiki.net/wiki/Thread:Support/Please_change_the_name_of_gom_to_Goan_Konkani

Modified Paths:
--
trunk/extensions/cldr/LocalNamesEn.php

Modified: trunk/extensions/cldr/LocalNamesEn.php
===
--- trunk/extensions/cldr/LocalNamesEn.php  2011-08-03 07:05:21 UTC (rev 
93802)
+++ trunk/extensions/cldr/LocalNamesEn.php  2011-08-03 07:06:04 UTC (rev 
93803)
@@ -128,12 +128,12 @@
  * http://www.ethnologue.org/show_language.asp?code=gom
  * Added 2008-09-02.
  */
-'gom'= 'Goanese Konkani',
-'gom-deva'   = 'Goanese Konkani (Devanagari script)',
-'gom-latn'   = 'Goanese Konkani (Latin script)',
-'gom-knda'   = 'Goanese Konkani (Kannada script)',
-'gom-mlym'   = 'Goanese Konkani (Malayalam script)',
-'gom-arab'   = 'Goanese Konkani (Arabic script)',
+'gom'= 'Goan Konkani',
+'gom-deva'   = 'Goan Konkani (Devanagari script)',
+'gom-latn'   = 'Goan Konkani (Latin script)',
+'gom-knda'   = 'Goan Konkani (Kannada script)',
+'gom-mlym'   = 'Goan Konkani (Malayalam script)',
+'gom-arab'   = 'Goan Konkani (Arabic script)',
 
 /* Not in CLDR 2.0.1. Western Atlantic Creole language
  * http://www.ethnologue.org/show_language.asp?code=dtp


___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [93804] trunk/phase3/includes/ProtectionForm.php

2011-08-03 Thread rotem
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93804

Revision: 93804
Author:   rotem
Date: 2011-08-03 07:33:00 + (Wed, 03 Aug 2011)
Log Message:
---
In the protection form, show the current protection expiry time in the local 
time and not in UTC.

Modified Paths:
--
trunk/phase3/includes/ProtectionForm.php

Modified: trunk/phase3/includes/ProtectionForm.php
===
--- trunk/phase3/includes/ProtectionForm.php2011-08-03 07:06:04 UTC (rev 
93803)
+++ trunk/phase3/includes/ProtectionForm.php2011-08-03 07:33:00 UTC (rev 
93804)
@@ -375,9 +375,9 @@
 
$expiryFormOptions = '';
if ( $this-mExistingExpiry[$action]  
$this-mExistingExpiry[$action] != 'infinity' ) {
-   $timestamp = $wgLang-timeanddate( 
$this-mExistingExpiry[$action] );
-   $d = $wgLang-date( 
$this-mExistingExpiry[$action] );
-   $t = $wgLang-time( 
$this-mExistingExpiry[$action] );
+   $timestamp = $wgLang-timeanddate( 
$this-mExistingExpiry[$action], true );
+   $d = $wgLang-date( 
$this-mExistingExpiry[$action], true );
+   $t = $wgLang-time( 
$this-mExistingExpiry[$action], true );
$expiryFormOptions .=
Xml::option(
wfMsg( 
'protect-existing-expiry', $timestamp, $d, $t ),


___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [93805] trunk/phase3/resources/mediawiki/mediawiki.util.js

2011-08-03 Thread krinkle
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93805

Revision: 93805
Author:   krinkle
Date: 2011-08-03 07:45:54 + (Wed, 03 Aug 2011)
Log Message:
---
Follows-up r89848 CR: Cleaner solution

Modified Paths:
--
trunk/phase3/resources/mediawiki/mediawiki.util.js

Modified: trunk/phase3/resources/mediawiki/mediawiki.util.js
===
--- trunk/phase3/resources/mediawiki/mediawiki.util.js  2011-08-03 07:33:00 UTC 
(rev 93804)
+++ trunk/phase3/resources/mediawiki/mediawiki.util.js  2011-08-03 07:45:54 UTC 
(rev 93805)
@@ -555,10 +555,13 @@
 * @return boolean
 */
'isIPv4Address' : function( address, allowBlock ) {
+   if ( typeof address !== 'string' ) {
+   return false;
+   }
var block = allowBlock ? '(?:\\/(?:3[0-2]|[12]?\\d))?' 
: '';
var RE_IP_BYTE = 
'(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|0?[0-9]?[0-9])';
var RE_IP_ADD = '(?:' + RE_IP_BYTE + '\\.){3}' + 
RE_IP_BYTE;
-   return typeof address === 'string'  address.search( 
new RegExp( '^' + RE_IP_ADD + block + '$' ) ) != -1;
+   return address.search( new RegExp( '^' + RE_IP_ADD + 
block + '$' ) ) != -1;
},
/**
 * Note: borrows from IP::isIPv6


___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [93806] trunk/phase3/includes/api

2011-08-03 Thread catrope
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93806

Revision: 93806
Author:   catrope
Date: 2011-08-03 07:54:23 + (Wed, 03 Aug 2011)
Log Message:
---
Revert r93802 per CR. Will avoid cache pollution by splitting the cache instead

Modified Paths:
--
trunk/phase3/includes/api/ApiParse.php
trunk/phase3/includes/api/ApiQuery.php
trunk/phase3/includes/api/ApiQueryIWLinks.php
trunk/phase3/includes/api/ApiQueryImageInfo.php
trunk/phase3/includes/api/ApiQueryInfo.php
trunk/phase3/includes/api/ApiQueryLangLinks.php
trunk/phase3/includes/api/ApiQuerySiteinfo.php

Modified: trunk/phase3/includes/api/ApiParse.php
===
--- trunk/phase3/includes/api/ApiParse.php  2011-08-03 07:45:54 UTC (rev 
93805)
+++ trunk/phase3/includes/api/ApiParse.php  2011-08-03 07:54:23 UTC (rev 
93806)
@@ -353,7 +353,7 @@
 
$entry['lang'] = $bits[0];
if ( $title ) {
-   $entry['url'] = wfExpandUrl( 
$title-getFullURL(), PROTO_HTTP );
+   $entry['url'] = wfExpandUrl( 
$title-getFullURL() );
}
$this-getResult()-setContent( $entry, $bits[1] );
$result[] = $entry;
@@ -435,7 +435,7 @@
 
$title = Title::newFromText( 
{$prefix}:{$title} );
if ( $title ) {
-   $entry['url'] = wfExpandUrl( 
$title-getFullURL(), PROTO_HTTP );
+   $entry['url'] = wfExpandUrl( 
$title-getFullURL() );
}
 
$this-getResult()-setContent( $entry, 
$title-getFullText() );

Modified: trunk/phase3/includes/api/ApiQuery.php
===
--- trunk/phase3/includes/api/ApiQuery.php  2011-08-03 07:45:54 UTC (rev 
93805)
+++ trunk/phase3/includes/api/ApiQuery.php  2011-08-03 07:54:23 UTC (rev 
93806)
@@ -374,7 +374,7 @@
);
if ( $this-iwUrl ) {
$title = Title::newFromText( $rawTitleStr );
-   $item['url'] = wfExpandUrl( 
$title-getFullURL(), PROTO_HTTP );
+   $item['url'] = wfExpandUrl( 
$title-getFullURL() );
}
$intrwValues[] = $item;
}

Modified: trunk/phase3/includes/api/ApiQueryIWLinks.php
===
--- trunk/phase3/includes/api/ApiQueryIWLinks.php   2011-08-03 07:45:54 UTC 
(rev 93805)
+++ trunk/phase3/includes/api/ApiQueryIWLinks.php   2011-08-03 07:54:23 UTC 
(rev 93806)
@@ -112,7 +112,7 @@
if ( $params['url'] ) {
$title = Title::newFromText( 
{$row-iwl_prefix}:{$row-iwl_title} );
if ( $title ) {
-   $entry['url'] = wfExpandUrl( 
$title-getFullURL(), PROTO_HTTP );
+   $entry['url'] = wfExpandUrl( 
$title-getFullURL() );
}
}
 

Modified: trunk/phase3/includes/api/ApiQueryImageInfo.php
===
--- trunk/phase3/includes/api/ApiQueryImageInfo.php 2011-08-03 07:45:54 UTC 
(rev 93805)
+++ trunk/phase3/includes/api/ApiQueryImageInfo.php 2011-08-03 07:54:23 UTC 
(rev 93806)
@@ -348,7 +348,7 @@
if ( !is_null( $thumbParams ) ) {
$mto = $file-transform( $thumbParams );
if ( $mto  !$mto-isError() ) {
-   $vals['thumburl'] = wfExpandUrl( 
$mto-getUrl(), PROTO_HTTP );
+   $vals['thumburl'] = wfExpandUrl( 
$mto-getUrl() );
 
// bug 23834 - If the URL's are the 
same, we haven't resized it, so shouldn't give the wanted
// thumbnail sizes for the thumbnail 
actual size

Modified: trunk/phase3/includes/api/ApiQueryInfo.php
===
--- trunk/phase3/includes/api/ApiQueryInfo.php  2011-08-03 07:45:54 UTC (rev 
93805)
+++ trunk/phase3/includes/api/ApiQueryInfo.php  2011-08-03 07:54:23 UTC (rev 
93806)
@@ -380,8 +380,8 @@
}
 
if ( $this-fld_url ) {
-   $pageInfo['fullurl'] = wfExpandUrl( 
$title-getFullURL(), PROTO_HTTP );
-   $pageInfo['editurl'] = wfExpandUrl( $title-getFullURL( 
'action=edit' ), PROTO_HTTP );
+   $pageInfo['fullurl'] = wfExpandUrl( 
$title-getFullURL() );
+   

[MediaWiki-CVS] SVN: [93807] branches/wmf/1.17wmf1/includes/db/DatabaseMysql.php

2011-08-03 Thread midom
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93807

Revision: 93807
Author:   midom
Date: 2011-08-03 07:59:04 + (Wed, 03 Aug 2011)
Log Message:
---
we don't need to change charsets on our systems, as we already have BINARY all 
around
we dont't set SQL modes either..

Modified Paths:
--
branches/wmf/1.17wmf1/includes/db/DatabaseMysql.php

Modified: branches/wmf/1.17wmf1/includes/db/DatabaseMysql.php
===
--- branches/wmf/1.17wmf1/includes/db/DatabaseMysql.php 2011-08-03 07:54:23 UTC 
(rev 93806)
+++ branches/wmf/1.17wmf1/includes/db/DatabaseMysql.php 2011-08-03 07:59:04 UTC 
(rev 93807)
@@ -108,6 +108,7 @@
}
 
if ( $success ) {
+   /*
$version = $this-getServerVersion();
if ( version_compare( $version, '4.1' ) = 0 ) {
// Tell the server we're communicating with it 
in UTF-8.
@@ -125,6 +126,7 @@
$this-query( SET sql_mode = $mode, 
__METHOD__ );
}
}
+*/
 
// Turn off strict mode if it is on
} else {


___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [93808] trunk/phase3/includes/profiler/ProfilerSimpleText.php

2011-08-03 Thread midom
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93808

Revision: 93808
Author:   midom
Date: 2011-08-03 08:00:23 + (Wed, 03 Aug 2011)
Log Message:
---
removing a comment that doesn't make any sense after r91441 refactoring :-)

Modified Paths:
--
trunk/phase3/includes/profiler/ProfilerSimpleText.php

Modified: trunk/phase3/includes/profiler/ProfilerSimpleText.php
===
--- trunk/phase3/includes/profiler/ProfilerSimpleText.php   2011-08-03 
07:59:04 UTC (rev 93807)
+++ trunk/phase3/includes/profiler/ProfilerSimpleText.php   2011-08-03 
08:00:23 UTC (rev 93808)
@@ -41,7 +41,6 @@
}
}
 
-   /* dense is good */
static function sort( $a, $b ) {
return $a['real']  $b['real']; /* sort descending by time 
elapsed */
}


___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [93809] trunk/extensions/ParserPlayground

2011-08-03 Thread brion
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93809

Revision: 93809
Author:   brion
Date: 2011-08-03 08:05:22 + (Wed, 03 Aug 2011)
Log Message:
---
ParserPlayground: fix for li output; initial list item detection; needs more 
clarity.

Modified Paths:
--
trunk/extensions/ParserPlayground/modules/ext.parserPlayground.renderer.js
trunk/extensions/ParserPlayground/modules/pegParser.pegjs.txt
trunk/extensions/ParserPlayground/tests/parserTests.js

Modified: 
trunk/extensions/ParserPlayground/modules/ext.parserPlayground.renderer.js
===
--- trunk/extensions/ParserPlayground/modules/ext.parserPlayground.renderer.js  
2011-08-03 08:00:23 UTC (rev 93808)
+++ trunk/extensions/ParserPlayground/modules/ext.parserPlayground.renderer.js  
2011-08-03 08:05:22 UTC (rev 93809)
@@ -129,10 +129,10 @@
$.map(tree.attrs, function(val, key) {
$span.attr(key, val); // @fixme safety!
});
-   if ('content' in tree) {
-   subParseArray(tree.content, $span);
-   }
}
+   if ('content' in tree) {
+   subParseArray(tree.content, $span);
+   }
node = $span[0];
break;
case 'hashlink':

Modified: trunk/extensions/ParserPlayground/modules/pegParser.pegjs.txt
===
--- trunk/extensions/ParserPlayground/modules/pegParser.pegjs.txt   
2011-08-03 08:00:23 UTC (rev 93808)
+++ trunk/extensions/ParserPlayground/modules/pegParser.pegjs.txt   
2011-08-03 08:05:22 UTC (rev 93809)
@@ -15,6 +15,7 @@
 block
   = br
   / h
+  / li
   / para
 
 h = h1 / h2 / h3 / h4 / h5 / h6
@@ -345,3 +346,21 @@
   = t:[0-9A-Za-z]+ { return {text: t.join('') } }
   / ' t:[^']+ ' { return { quote: ', text: t.join('') } }
   / '' t:[^]+ '' { return { quote: '', text: t.join('') } }
+
+
+li = bullets:list_char+ 
+c:(inline / anything)
+newline 
+{
+return {
+type: 'li',
+listStyle: bullets,
+content: c
+};
+}
+
+list_char =
+'*' /
+'#' /
+':' /
+';'

Modified: trunk/extensions/ParserPlayground/tests/parserTests.js
===
--- trunk/extensions/ParserPlayground/tests/parserTests.js  2011-08-03 
08:00:23 UTC (rev 93808)
+++ trunk/extensions/ParserPlayground/tests/parserTests.js  2011-08-03 
08:05:22 UTC (rev 93809)
@@ -128,6 +128,10 @@
if (err) {
console.log('RENDER FAIL', err);
} else {
+   console.log('EXPECTED:');
+   console.log(item.result + \n);
+   
+   console.log('RENDERED:');
console.log(node.innerHTML + \n);
}
});


___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [93810] trunk/extensions/CollabWatchlist

2011-08-03 Thread flohack
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93810

Revision: 93810
Author:   flohack
Date: 2011-08-03 08:23:04 + (Wed, 03 Aug 2011)
Log Message:
---
Fixed a bug regarding category traversal; Better category tree printing

Modified Paths:
--
trunk/extensions/CollabWatchlist/includes/CategoryTreeManip.php
trunk/extensions/CollabWatchlist/tests/CollabWatchlistTest.php

Modified: trunk/extensions/CollabWatchlist/includes/CategoryTreeManip.php
===
--- trunk/extensions/CollabWatchlist/includes/CategoryTreeManip.php 
2011-08-03 08:05:22 UTC (rev 93809)
+++ trunk/extensions/CollabWatchlist/includes/CategoryTreeManip.php 
2011-08-03 08:23:04 UTC (rev 93810)
@@ -166,17 +166,18 @@
}

protected function printTreeRecursive( $node, $prefix ) {
-   if( $node-id )
-   print $node-id . :  . $node-name .  enabled:  . 
$node-enabled . \n;
+   if( $node-id ) {
+   print $prefix . $node-id . :  . $node-name .  
enabled:  . $node-enabled . \n;
+   }
foreach( $node-children as $child ) {
-   $this-printTreeRecursive( $child, $prefix . '  ' );
+   $this-printTreeRecursive( $child, $prefix .);
}
}
 
/** Build the category tree, given a list of category names.
 * All categories and subcategories are enabled by default.
 *
-* @param array $catNames An array of strings representing category 
names
+* @param array $catNames An array of strings representing category 
names (without namespace prefix)
 * @return
 */
public function initialiseFromCategoryNames( $catNames ) {
@@ -248,7 +249,6 @@
 */
protected function getChildCategories( $catNames ) {
global $wgMemc;
-   $dbr = wfGetDB( DB_SLAVE );
$childList = array();
$nonCachedCatNames = array();
// Try cache first
@@ -269,13 +269,17 @@
// Select the child categories of all categories we have not 
found in the cache
$res = array();
if( !empty( $nonCachedCatNames ) ) {
+   $dbr = wfGetDB( DB_SLAVE );
// Select the direct child categories of all category 
names
// I.e. category name, child category id and child 
category name
-   $res = $dbr-select( array( 'categorylinks', 'page' ), 
# Tables
-   array( 'cl_to AS parName', 'cl_from AS 
childId', 'page_title AS childName' ), # Fields
-   array( 'cl_to' = 
array_keys($nonCachedCatNames), 'page_namespace' = NS_CATEGORY ),  # Conditions
+   // select cp.page_title AS parName, cl.cl_from AS 
childId, p.page_title AS childName 
+   // from page cp join categorylinks cl on cp.page_title 
= cl.cl_to
+   // join page p on p.page_id = cl.cl_from where 
p.page_namespace = '14';
+   $res = $dbr-select( array( 'cp' = 'page', 'cl' = 
'categorylinks', 'p' = 'page' ), # Tables
+   array( 'cp.page_title AS parName', 'cl.cl_from 
AS childId', 'p.page_title AS childName' ), # Fields
+   array( 'cp.page_title' = 
array_keys($nonCachedCatNames), 'cp.page_namespace' = NS_CATEGORY ),  # 
Conditions
__METHOD__, array( 'GROUP BY' = 'cl_to' ), # 
Options
-   array( 'page' = array( 'JOIN', 'page_id = 
cl_from' ) ) # Join conditions
+   array( 'cl' = array( 'JOIN', 'cp.page_title = 
cl.cl_to' ), 'p' = array( 'JOIN', 'p.page_id = cl.cl_from') ) # Join conditions
);
}

@@ -315,7 +319,6 @@
 */
protected function getCategoryPageIds( $catNames ) {
global $wgMemc;
-   $dbr = wfGetDB( DB_SLAVE );
$pageInfo = array();
$nonCachedCatNames = array();
// Try cache first
@@ -332,6 +335,7 @@
// Select the child categories of all categories we have not 
found in the cache
$res = array();
if( !empty( $nonCachedCatNames ) ) {
+   $dbr = wfGetDB( DB_SLAVE );
$res = $dbr-select( array( 'page' ), # Tables
array( 'page_id, page_title' ), # Fields
array( 'page_title' = $nonCachedCatNames )  # 
Conditions

Modified: trunk/extensions/CollabWatchlist/tests/CollabWatchlistTest.php
===
--- trunk/extensions/CollabWatchlist/tests/CollabWatchlistTest.php  
2011-08-03 

[MediaWiki-CVS] SVN: [93811] trunk/extensions/ClickTracking/patches/ClickTrackingEvents.sql

2011-08-03 Thread krinkle
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93811

Revision: 93811
Author:   krinkle
Date: 2011-08-03 09:08:34 + (Wed, 03 Aug 2011)
Log Message:
---
Fix syntax error for SQLite compatibility. Previous version didn't work. Now it 
does :-)

Modified Paths:
--
trunk/extensions/ClickTracking/patches/ClickTrackingEvents.sql

Modified: trunk/extensions/ClickTracking/patches/ClickTrackingEvents.sql
===
--- trunk/extensions/ClickTracking/patches/ClickTrackingEvents.sql  
2011-08-03 08:23:04 UTC (rev 93810)
+++ trunk/extensions/ClickTracking/patches/ClickTrackingEvents.sql  
2011-08-03 09:08:34 UTC (rev 93811)
@@ -9,5 +9,5 @@
event_name VARBINARY(255) unique,
 
-- day
-   id INTEGER AUTO_INCREMENT PRIMARY KEY
+   id INTEGER PRIMARY KEY AUTO_INCREMENT
 ) /*$wgDBTableOptions*/;


___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [93812] trunk/extensions/ArticleFeedback/sql/ArticleFeedback.sql

2011-08-03 Thread catrope
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93812

Revision: 93812
Author:   catrope
Date: 2011-08-03 09:08:42 + (Wed, 03 Aug 2011)
Log Message:
---
For SQLite compat, split up the multi-row insert statement into separate insert 
statements.

Modified Paths:
--
trunk/extensions/ArticleFeedback/sql/ArticleFeedback.sql

Modified: trunk/extensions/ArticleFeedback/sql/ArticleFeedback.sql
===
--- trunk/extensions/ArticleFeedback/sql/ArticleFeedback.sql2011-08-03 
09:08:34 UTC (rev 93811)
+++ trunk/extensions/ArticleFeedback/sql/ArticleFeedback.sql2011-08-03 
09:08:42 UTC (rev 93812)
@@ -7,9 +7,10 @@
 ) /*$wgDBTableOptions*/;
 
 -- Default article feedback ratings for the pilot
-INSERT INTO /*_*/article_feedback_ratings (aar_rating) VALUES
-('articlefeedback-field-trustworthy-label'), 
('articlefeedback-field-objective-label'),
-('articlefeedback-field-complete-label'), 
('articlefeedback-field-wellwritten-label');
+INSERT INTO /*_*/article_feedback_ratings (aar_rating) VALUES 
('articlefeedback-field-trustworthy-label');
+INSERT INTO /*_*/article_feedback_ratings (aar_rating) VALUES 
('articlefeedback-field-objective-label');
+INSERT INTO /*_*/article_feedback_ratings (aar_rating) VALUES 
('articlefeedback-field-complete-label');
+INSERT INTO /*_*/article_feedback_ratings (aar_rating) VALUES 
('articlefeedback-field-wellwritten-label');
 
 -- Store article feedbacks (user rating per revision)
 CREATE TABLE IF NOT EXISTS /*_*/article_feedback (


___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [93813] trunk/extensions/ArticleFeedback

2011-08-03 Thread krinkle
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93813

Revision: 93813
Author:   krinkle
Date: 2011-08-03 09:28:07 + (Wed, 03 Aug 2011)
Log Message:
---
Don't show AFT if user is both logged out and on action=purge,
because in that scenario there is no article being shown (instead, in such 
scenario the user sees a form with a button to clear the cache, which is then 
redirected back to the article (action=view).

This bug was fairly rare though, since the MediaWiki interface doesn't contain 
any links to action=purge for logged-out users (or even logged-in users for 
that matter), but some gadgets and templates do link to it.


Resolves bug 30100 - Hide AFT for anonymous users on purge action.

Modified Paths:
--
trunk/extensions/ArticleFeedback/ArticleFeedback.php

trunk/extensions/ArticleFeedback/modules/ext.articleFeedback/ext.articleFeedback.startup.js

Modified: trunk/extensions/ArticleFeedback/ArticleFeedback.php
===
--- trunk/extensions/ArticleFeedback/ArticleFeedback.php2011-08-03 
09:08:42 UTC (rev 93812)
+++ trunk/extensions/ArticleFeedback/ArticleFeedback.php2011-08-03 
09:28:07 UTC (rev 93813)
@@ -139,6 +139,7 @@
'Adam Miller',
'Nimish Gautam',
'Arthur Richards',
+   'Timo Tijhof',
),
'version' = '0.2.0',
'descriptionmsg' = 'articlefeedback-desc',

Modified: 
trunk/extensions/ArticleFeedback/modules/ext.articleFeedback/ext.articleFeedback.startup.js
===
--- 
trunk/extensions/ArticleFeedback/modules/ext.articleFeedback/ext.articleFeedback.startup.js
 2011-08-03 09:08:42 UTC (rev 93812)
+++ 
trunk/extensions/ArticleFeedback/modules/ext.articleFeedback/ext.articleFeedback.startup.js
 2011-08-03 09:28:07 UTC (rev 93813)
@@ -12,6 +12,10 @@
 mw.config.get( 'wgArticleId' )  0
// View pages
 ( mw.config.get( 'wgAction' ) == 'view' || mw.config.get( 
'wgAction' ) == 'purge' )
+   // If user is logged in, showiong on action=purge is OK,
+   // but if user is logged out, action=purge shows a form instead 
of the article,
+   // so return false in that case.
+!( mw.config.get( 'wgAction' ) == 'purge'  
mw.user.anonymous() )
// Current revision
 mw.util.getParamValue( 'diff' ) == null
 mw.util.getParamValue( 'oldid' ) == null


___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [93814] trunk/extensions/SemanticMediaWiki/specials/AskSpecial/ SMW_QueryUIHelper.php

2011-08-03 Thread devayon
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93814

Revision: 93814
Author:   devayon
Date: 2011-08-03 11:21:53 + (Wed, 03 Aug 2011)
Log Message:
---
Follow up: r92530

Modified Paths:
--
trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_QueryUIHelper.php

Modified: 
trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_QueryUIHelper.php
===
--- 
trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_QueryUIHelper.php
2011-08-03 09:28:07 UTC (rev 93813)
+++ 
trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_QueryUIHelper.php
2011-08-03 11:21:53 UTC (rev 93814)
@@ -89,7 +89,10 @@
and ( method_exists( $wgOut, 
'addFeedlink' ) ) // remove this line after MW 1.5 is no longer supported by SMW
and ( array_key_exists( 'rss', 
$wgFeedClasses ) ) ) {
$res = $this-uiCore-getResultObject();
-   $href = $res-getQueryLink()-getURl() 
. '/format%3Drss/limit%3D' . $this-uiCore-getLimit();
+   $href = $res-getQueryLink();
+   $href-setParameter( 'rss', 'format' );
+   $href-setParameter( 
$this-uiCore-getLimit(), 'limit' );
+   $href = $href-getURl();
$wgOut-addFeedLink( 'rss', $href );
}
 


___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [93815] trunk/extensions/SemanticMediaWiki/specials/AskSpecial/ SMW_QueryUIHelper.php

2011-08-03 Thread devayon
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93815

Revision: 93815
Author:   devayon
Date: 2011-08-03 11:23:12 + (Wed, 03 Aug 2011)
Log Message:
---
Follow up: r92530

Modified Paths:
--
trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_QueryUIHelper.php

Modified: 
trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_QueryUIHelper.php
===
--- 
trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_QueryUIHelper.php
2011-08-03 11:21:53 UTC (rev 93814)
+++ 
trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_QueryUIHelper.php
2011-08-03 11:23:12 UTC (rev 93815)
@@ -89,11 +89,10 @@
and ( method_exists( $wgOut, 
'addFeedlink' ) ) // remove this line after MW 1.5 is no longer supported by SMW
and ( array_key_exists( 'rss', 
$wgFeedClasses ) ) ) {
$res = $this-uiCore-getResultObject();
-   $href = $res-getQueryLink();
-   $href-setParameter( 'rss', 'format' );
-   $href-setParameter( 
$this-uiCore-getLimit(), 'limit' );
-   $href = $href-getURl();
-   $wgOut-addFeedLink( 'rss', $href );
+   $link = $res-getQueryLink();
+   $link-setParameter( 'rss', 'format' );
+   $link-setParameter( 
$this-uiCore-getLimit(), 'limit' );
+   $wgOut-addFeedLink( 'rss', 
$link-getURl());
}
 
$this-makePage( $p );


___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [93816] trunk/extensions/Translate/groups/mediawiki-defines.txt

2011-08-03 Thread siebrand
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93816

Revision: 93816
Author:   siebrand
Date: 2011-08-03 11:39:57 + (Wed, 03 Aug 2011)
Log Message:
---
Disable magic word Li10n for ParserFunctions extension. Doing it the 
Special:Magic way sucks.

Modified Paths:
--
trunk/extensions/Translate/groups/mediawiki-defines.txt

Modified: trunk/extensions/Translate/groups/mediawiki-defines.txt
===
--- trunk/extensions/Translate/groups/mediawiki-defines.txt 2011-08-03 
11:23:12 UTC (rev 93815)
+++ trunk/extensions/Translate/groups/mediawiki-defines.txt 2011-08-03 
11:39:57 UTC (rev 93816)
@@ -955,7 +955,8 @@
 
 Parser Functions
 descmsg = pfunc_desc
-magicfile = ParserFunctions/ParserFunctions.i18n.magic.php
+# Disabled. #language collision.
+#magicfile = ParserFunctions/ParserFunctions.i18n.magic.php
 ignored = pfunc-convert-dimensionmismatch
 ignored = pfunc-convert-unknownunit
 ignored = pfunc-convert-unknowndimension


___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [93817] trunk/phase3/resources

2011-08-03 Thread krinkle
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93817

Revision: 93817
Author:   krinkle
Date: 2011-08-03 11:59:11 + (Wed, 03 Aug 2011)
Log Message:
---
Fix noglobals exceptions from QUnit
* Test results prior to this commit: http://i.imgur.com/m8rbk.png
* http://localhost/trunkw/tests/qunit/?noglobals=1

- Missing var-statement, causes global scope implication
- Missing semi colon, causing next to be global

Modified Paths:
--
trunk/phase3/resources/jquery/jquery.textSelection.js
trunk/phase3/resources/mediawiki/mediawiki.Title.js

Modified: trunk/phase3/resources/jquery/jquery.textSelection.js
===
--- trunk/phase3/resources/jquery/jquery.textSelection.js   2011-08-03 
11:39:57 UTC (rev 93816)
+++ trunk/phase3/resources/jquery/jquery.textSelection.js   2011-08-03 
11:59:11 UTC (rev 93817)
@@ -454,7 +454,7 @@
context.fn.restoreSelection();
needSave = true;
}
-   retval = ( hasIframe ? context.fn : fn )[command].call( this, options );
+   var retval = ( hasIframe ? context.fn : fn )[command].call( this, 
options );
if ( hasIframe  needSave ) {
context.fn.saveSelection();
}

Modified: trunk/phase3/resources/mediawiki/mediawiki.Title.js
===
--- trunk/phase3/resources/mediawiki/mediawiki.Title.js 2011-08-03 11:39:57 UTC 
(rev 93816)
+++ trunk/phase3/resources/mediawiki/mediawiki.Title.js 2011-08-03 11:59:11 UTC 
(rev 93817)
@@ -120,7 +120,7 @@
 * @return {mw.Title}
 */
setAll = function( title, s ) {
-   var matches = s.match( 
/^(?:([^:]+):)?(.*?)(?:\.(\w{1,5}))?$/ );
+   var matches = s.match( 
/^(?:([^:]+):)?(.*?)(?:\.(\w{1,5}))?$/ ),
ns_match = getNsIdByName( matches[1] );
if ( matches.length  ns_match ) {
if ( matches[1] ) { title._ns = ns_match; }


___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [93818] trunk/phase3/includes

2011-08-03 Thread catrope
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93818

Revision: 93818
Author:   catrope
Date: 2011-08-03 12:00:47 + (Wed, 03 Aug 2011)
Log Message:
---
Introduce $wgVaryOnXFPToAPI which sends Vary: X-Forwarded-Proto (and the 
appropriate XVO, if needed) on cached API requests. This effectively splits the 
API cache between HTTP and HTTPS for people with an HTTPS termination setup in 
front of a caching proxy (like, say, WMF)

Modified Paths:
--
trunk/phase3/includes/DefaultSettings.php
trunk/phase3/includes/api/ApiMain.php

Modified: trunk/phase3/includes/DefaultSettings.php
===
--- trunk/phase3/includes/DefaultSettings.php   2011-08-03 11:59:11 UTC (rev 
93817)
+++ trunk/phase3/includes/DefaultSettings.php   2011-08-03 12:00:47 UTC (rev 
93818)
@@ -1739,6 +1739,13 @@
 /** Send X-Vary-Options header for better caching (requires patched Squid) */
 $wgUseXVO = false;
 
+/** Add X-Forwarded-Proto to the Vary and X-Vary-Options headers for API
+ * requests. Use this if you have an SSL termination setup and want to split
+ * the cache between HTTP and HTTPS for API requests. This does not affect
+ * 'regular' requests.
+ */
+$wgVaryOnXFPForAPI = false;
+
 /**
  * Internal server name as known to Squid, if different. Example:
  * code

Modified: trunk/phase3/includes/api/ApiMain.php
===
--- trunk/phase3/includes/api/ApiMain.php   2011-08-03 11:59:11 UTC (rev 
93817)
+++ trunk/phase3/includes/api/ApiMain.php   2011-08-03 12:00:47 UTC (rev 
93818)
@@ -399,6 +399,7 @@
}
 
protected function sendCacheHeaders() {
+   global $wgUseXVO, $wgOut, $wgVaryOnXFPForAPI;
$response = $this-getRequest()-response();
 
if ( $this-mCacheMode == 'private' ) {
@@ -407,9 +408,12 @@
}
 
if ( $this-mCacheMode == 'anon-public-user-private' ) {
-   global $wgUseXVO, $wgOut;
-   $response-header( 'Vary: Accept-Encoding, Cookie' );
+   $xfp = $wgVaryOnXFPForAPI ? ', X-Forwarded-Proto' : '';
+   $response-header( 'Vary: Accept-Encoding, Cookie' . 
$xfp );
if ( $wgUseXVO ) {
+   if ( $wgVaryOnXFPForAPI ) {
+   $wgOut-addVaryHeader( 
'X-Forwarded-Proto' );
+   }
$response-header( $wgOut-getXVO() );
if ( $wgOut-haveCacheVaryCookies() ) {
// Logged in, mark this request private
@@ -424,6 +428,15 @@
return;
} // else no XVO and anonymous, send public headers 
below
}
+   
+   // Send public headers
+   if ( $wgVaryOnXFPForAPI ) {
+   $response-header( 'Vary: Accept-Encoding, 
X-Forwarded-Proto' );
+   if ( $wgUseXVO ) {
+   // Blegh. Our header setting system sucks
+   $response-header( 'X-Vary-Options: 
Accept-Encoding;list-contains=gzip, X-Forwarded-Proto' );
+   }
+   }
 
// If nobody called setCacheMaxAge(), use the (s)maxage 
parameters
if ( !isset( $this-mCacheControl['s-maxage'] ) ) {


___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [93819] trunk/phase3/includes/GlobalFunctions.php

2011-08-03 Thread catrope
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93819

Revision: 93819
Author:   catrope
Date: 2011-08-03 12:52:17 + (Wed, 03 Aug 2011)
Log Message:
---
Followup r93266: also rename PROT_* to PROTO_* in the comments

Modified Paths:
--
trunk/phase3/includes/GlobalFunctions.php

Modified: trunk/phase3/includes/GlobalFunctions.php
===
--- trunk/phase3/includes/GlobalFunctions.php   2011-08-03 12:00:47 UTC (rev 
93818)
+++ trunk/phase3/includes/GlobalFunctions.php   2011-08-03 12:52:17 UTC (rev 
93819)
@@ -437,11 +437,11 @@
  * Expand a potentially local URL to a fully-qualified URL.  Assumes $wgServer
  * is correct.
  * 
- * The meaning of the PROT_* constants is as follows:
- * PROT_HTTP: Output a URL starting with http://
- * PROT_HTTPS: Output a URL starting with https://
- * PROT_RELATIVE: Output a URL starting with // (protocol-relative URL)
- * PROT_CURRENT: Output a URL starting with either http:// or https:// , 
depending on which protocol was used for the current incoming request
+ * The meaning of the PROTO_* constants is as follows:
+ * PROTO_HTTP: Output a URL starting with http://
+ * PROTO_HTTPS: Output a URL starting with https://
+ * PROTO_RELATIVE: Output a URL starting with // (protocol-relative URL)
+ * PROTO_CURRENT: Output a URL starting with either http:// or https:// , 
depending on which protocol was used for the current incoming request
  *
  * @todo this won't work with current-path-relative URLs
  * like subdir/foo.html, etc.


___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [93820] trunk/phase3/includes

2011-08-03 Thread catrope
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93820

Revision: 93820
Author:   catrope
Date: 2011-08-03 12:58:21 + (Wed, 03 Aug 2011)
Log Message:
---
Some random URL protocol forcing for protocol-relative URLs

Modified Paths:
--
trunk/phase3/includes/HttpFunctions.php
trunk/phase3/includes/OutputPage.php
trunk/phase3/includes/User.php
trunk/phase3/includes/WebRequest.php
trunk/phase3/includes/api/ApiRsd.php
trunk/phase3/includes/filerepo/ForeignAPIRepo.php
trunk/phase3/includes/libs/CSSMin.php
trunk/phase3/includes/parser/CoreParserFunctions.php
trunk/phase3/includes/resourceloader/ResourceLoaderFileModule.php

Modified: trunk/phase3/includes/HttpFunctions.php
===
--- trunk/phase3/includes/HttpFunctions.php 2011-08-03 12:52:17 UTC (rev 
93819)
+++ trunk/phase3/includes/HttpFunctions.php 2011-08-03 12:58:21 UTC (rev 
93820)
@@ -14,7 +14,7 @@
 * Perform an HTTP request
 *
 * @param $method String: HTTP method. Usually GET/POST
-* @param $url String: full URL to act on
+* @param $url String: full URL to act on. If protocol-relative, will 
be expanded to an http:// URL
 * @param $options Array: options to pass to MWHttpRequest object.
 *  Possible keys for the array:
 *- timeout Timeout length in seconds
@@ -32,7 +32,7 @@
 * @return Mixed: (bool)false on failure or a string on success
 */
public static function request( $method, $url, $options = array() ) {
-   $url = wfExpandUrl( $url );
+   $url = wfExpandUrl( $url, PROT_HTTP );
wfDebug( HTTP: $method: $url\n );
$options['method'] = strtoupper( $method );
 

Modified: trunk/phase3/includes/OutputPage.php
===
--- trunk/phase3/includes/OutputPage.php2011-08-03 12:52:17 UTC (rev 
93819)
+++ trunk/phase3/includes/OutputPage.php2011-08-03 12:58:21 UTC (rev 
93820)
@@ -2818,7 +2818,9 @@
$tags[] = Html::element( 'link', array(
'rel' = 'EditURI',
'type' = 'application/rsd+xml',
-   'href' = wfExpandUrl( wfAppendQuery( wfScript( 
'api' ), array( 'action' = 'rsd' ) ) ),
+   // Output a protocol-relative URL here if 
$wgServer is protocol-relative
+   // Whether RSD accepts relative or 
protocol-relative URLs is completely undocumented, though
+   'href' = wfExpandUrl( wfAppendQuery( wfScript( 
'api' ), array( 'action' = 'rsd' ) ), PROT_RELATIVE ),
) );
}
 
@@ -2840,7 +2842,7 @@
} else {
$tags[] = Html::element( 'link', array(
'rel' = 'canonical',
-   'href' = 
$this-getTitle()-getFullURL() )
+   'href' = wfExpandUrl( 
$this-getTitle()-getFullURL(), PROTO_HTTP ) )
);
}
}

Modified: trunk/phase3/includes/User.php
===
--- trunk/phase3/includes/User.php  2011-08-03 12:52:17 UTC (rev 93819)
+++ trunk/phase3/includes/User.php  2011-08-03 12:58:21 UTC (rev 93820)
@@ -3320,7 +3320,9 @@
str_replace(
'$1',
Special:$page/$token,
-   $wgArticlePath ) );
+   $wgArticlePath ),
+   PROT_HTTP
+   );
}
 
/**

Modified: trunk/phase3/includes/WebRequest.php
===
--- trunk/phase3/includes/WebRequest.php2011-08-03 12:52:17 UTC (rev 
93819)
+++ trunk/phase3/includes/WebRequest.php2011-08-03 12:58:21 UTC (rev 
93820)
@@ -595,6 +595,8 @@
 * Return the request URI with the canonical service and hostname, path,
 * and query string. This will be suitable for use as an absolute link
 * in HTML or other output.
+* 
+* NOTE: This will output a protocol-relative URL if $wgServer is 
protocol-relative
 *
 * @return String
 */

Modified: trunk/phase3/includes/api/ApiRsd.php
===
--- trunk/phase3/includes/api/ApiRsd.php2011-08-03 12:52:17 UTC (rev 
93819)
+++ trunk/phase3/includes/api/ApiRsd.php2011-08-03 12:58:21 UTC (rev 
93820)
@@ -48,7 +48,7 @@
$service = array( 'apis' = $this-formatRsdApiList() );
ApiResult::setContent( $service, 

[MediaWiki-CVS] SVN: [93821] trunk/phase3/includes

2011-08-03 Thread catrope
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93821

Revision: 93821
Author:   catrope
Date: 2011-08-03 13:11:42 + (Wed, 03 Aug 2011)
Log Message:
---
Fix r93820: PROT_ - PROTO_

Modified Paths:
--
trunk/phase3/includes/HttpFunctions.php
trunk/phase3/includes/OutputPage.php
trunk/phase3/includes/User.php
trunk/phase3/includes/filerepo/ForeignAPIRepo.php
trunk/phase3/includes/libs/CSSMin.php
trunk/phase3/includes/parser/CoreParserFunctions.php
trunk/phase3/includes/resourceloader/ResourceLoaderFileModule.php

Modified: trunk/phase3/includes/HttpFunctions.php
===
--- trunk/phase3/includes/HttpFunctions.php 2011-08-03 12:58:21 UTC (rev 
93820)
+++ trunk/phase3/includes/HttpFunctions.php 2011-08-03 13:11:42 UTC (rev 
93821)
@@ -32,7 +32,7 @@
 * @return Mixed: (bool)false on failure or a string on success
 */
public static function request( $method, $url, $options = array() ) {
-   $url = wfExpandUrl( $url, PROT_HTTP );
+   $url = wfExpandUrl( $url, PROTO_HTTP );
wfDebug( HTTP: $method: $url\n );
$options['method'] = strtoupper( $method );
 

Modified: trunk/phase3/includes/OutputPage.php
===
--- trunk/phase3/includes/OutputPage.php2011-08-03 12:58:21 UTC (rev 
93820)
+++ trunk/phase3/includes/OutputPage.php2011-08-03 13:11:42 UTC (rev 
93821)
@@ -2820,7 +2820,7 @@
'type' = 'application/rsd+xml',
// Output a protocol-relative URL here if 
$wgServer is protocol-relative
// Whether RSD accepts relative or 
protocol-relative URLs is completely undocumented, though
-   'href' = wfExpandUrl( wfAppendQuery( wfScript( 
'api' ), array( 'action' = 'rsd' ) ), PROT_RELATIVE ),
+   'href' = wfExpandUrl( wfAppendQuery( wfScript( 
'api' ), array( 'action' = 'rsd' ) ), PROTO_RELATIVE ),
) );
}
 

Modified: trunk/phase3/includes/User.php
===
--- trunk/phase3/includes/User.php  2011-08-03 12:58:21 UTC (rev 93820)
+++ trunk/phase3/includes/User.php  2011-08-03 13:11:42 UTC (rev 93821)
@@ -3321,7 +3321,7 @@
'$1',
Special:$page/$token,
$wgArticlePath ),
-   PROT_HTTP
+   PROTO_HTTP
);
}
 

Modified: trunk/phase3/includes/filerepo/ForeignAPIRepo.php
===
--- trunk/phase3/includes/filerepo/ForeignAPIRepo.php   2011-08-03 12:58:21 UTC 
(rev 93820)
+++ trunk/phase3/includes/filerepo/ForeignAPIRepo.php   2011-08-03 13:11:42 UTC 
(rev 93821)
@@ -370,7 +370,7 @@
public static function httpGet( $url, $timeout = 'default', $options = 
array() ) {
$options['timeout'] = $timeout;
/* Http::get */
-   $url = wfExpandUrl( $url, PROT_HTTP );
+   $url = wfExpandUrl( $url, PROTO_HTTP );
wfDebug( ForeignAPIRepo: HTTP GET: $url\n );
$options['method'] = GET;
 

Modified: trunk/phase3/includes/libs/CSSMin.php
===
--- trunk/phase3/includes/libs/CSSMin.php   2011-08-03 12:58:21 UTC (rev 
93820)
+++ trunk/phase3/includes/libs/CSSMin.php   2011-08-03 13:11:42 UTC (rev 
93821)
@@ -138,7 +138,7 @@
$expanded = wfExpandUrl( 
$match['file'][0] );
$origLength = strlen( $match['file'][0] 
);
$lengthIncrease = strlen( $expanded ) - 
$origLength;
-   $source = substr_replace( $source, 
wfExpandUrl( $match['file'][0], PROT_RELATIVE ),
+   $source = substr_replace( $source, 
wfExpandUrl( $match['file'][0], PROTO_RELATIVE ),
$match['file'][1], $origLength,
);
}

Modified: trunk/phase3/includes/parser/CoreParserFunctions.php
===
--- trunk/phase3/includes/parser/CoreParserFunctions.php2011-08-03 
12:58:21 UTC (rev 93820)
+++ trunk/phase3/includes/parser/CoreParserFunctions.php2011-08-03 
13:11:42 UTC (rev 93821)
@@ -723,7 +723,7 @@
// ... and we can
if ( $mto  !$mto-isError() ) {
// ... change the URL to point to a 
thumbnail.
-  

[MediaWiki-CVS] SVN: [93824] branches/wmf/1.17wmf1/extensions/CodeReview

2011-08-03 Thread tstarling
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93824

Revision: 93824
Author:   tstarling
Date: 2011-08-03 13:25:40 + (Wed, 03 Aug 2011)
Log Message:
---
MFT r93823

Modified Paths:
--
branches/wmf/1.17wmf1/extensions/CodeReview/CodeReview.php
branches/wmf/1.17wmf1/extensions/CodeReview/ui/WordCloud.php

Modified: branches/wmf/1.17wmf1/extensions/CodeReview/CodeReview.php
===
--- branches/wmf/1.17wmf1/extensions/CodeReview/CodeReview.php  2011-08-03 
13:22:57 UTC (rev 93823)
+++ branches/wmf/1.17wmf1/extensions/CodeReview/CodeReview.php  2011-08-03 
13:25:40 UTC (rev 93824)
@@ -145,6 +145,9 @@
 // What is the default SVN import chunk size?
 $wgCodeReviewImportBatchSize = 400;
 
+// Shuffle the tag cloud
+$wgCodeReviewShuffleTagCloud = false;
+
 $commonModuleInfo = array(
'localBasePath' = dirname( __FILE__ ) . '/modules',
'remoteExtPath' = 'CodeReview/modules',

Modified: branches/wmf/1.17wmf1/extensions/CodeReview/ui/WordCloud.php
===
--- branches/wmf/1.17wmf1/extensions/CodeReview/ui/WordCloud.php
2011-08-03 13:22:57 UTC (rev 93823)
+++ branches/wmf/1.17wmf1/extensions/CodeReview/ui/WordCloud.php
2011-08-03 13:25:40 UTC (rev 93824)
@@ -85,10 +85,17 @@
 * @return String
 */
public function getCloudHtml() {
+   global $wgCodeReviewShuffleTagCloud;
if( 0 === count( $this-wordsArray ) ) {
return '';
}
-   $this-shuffleCloud();
+
+   if ( $wgCodeReviewShuffleTagCloud ) {
+   $this-shuffleCloud();
+   } else {
+   ksort( $this-wordsArray );
+   }
+
$max = max( $this-wordsArray );
if( is_array( $this-wordsArray ) ) {
$return = '';


___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [93825] trunk/extensions/Vector/Vector.i18n.php

2011-08-03 Thread nikerabbit
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93825

Revision: 93825
Author:   nikerabbit
Date: 2011-08-03 13:27:23 + (Wed, 03 Aug 2011)
Log Message:
---
I was told just to do it - consistent terms
http://translatewiki.net/wiki/Thread:Support/About_MediaWiki:Vector-collapsiblenav-preference/fi

Modified Paths:
--
trunk/extensions/Vector/Vector.i18n.php

Modified: trunk/extensions/Vector/Vector.i18n.php
===
--- trunk/extensions/Vector/Vector.i18n.php 2011-08-03 13:25:40 UTC (rev 
93824)
+++ trunk/extensions/Vector/Vector.i18n.php 2011-08-03 13:27:23 UTC (rev 
93825)
@@ -14,7 +14,7 @@
 $messages['en'] = array(
'vector' = 'UI improvements for Vector',
'vector-desc' = 'Improves on the user interface elements of the Vector 
skin.',
-   'vector-collapsiblenav-preference' = 'Enable collapsing of items in 
the navigation menu in Vector skin',
+   'vector-collapsiblenav-preference' = 'Enable collapsing of items in 
the sidebar in Vector skin',
'vector-collapsiblenav-more' = 'More languages',
'vector-editwarning-warning' = 'Leaving this page may cause you to 
lose any changes you have made.
 If you are logged in, you can disable this warning in the Editing section of 
your preferences.',


___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [93826] trunk/phase3/resources/mediawiki/mediawiki.Title.js

2011-08-03 Thread krinkle
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93826

Revision: 93826
Author:   krinkle
Date: 2011-08-03 13:46:41 + (Wed, 03 Aug 2011)
Log Message:
---
Correct typo in function documentation.
* Follows-up r93702 CR

Modified Paths:
--
trunk/phase3/resources/mediawiki/mediawiki.Title.js

Modified: trunk/phase3/resources/mediawiki/mediawiki.Title.js
===
--- trunk/phase3/resources/mediawiki/mediawiki.Title.js 2011-08-03 13:27:23 UTC 
(rev 93825)
+++ trunk/phase3/resources/mediawiki/mediawiki.Title.js 2011-08-03 13:46:41 UTC 
(rev 93826)
@@ -61,21 +61,21 @@
},
 
/**
-* Sanatize name.
+* Sanitize name.
 */
fixName = function( s ) {
return clean( $.trim( s ) );
},
 
/**
-* Sanatize name.
+* Sanitize name.
 */
fixExt = function( s ) {
return clean( s.toLowerCase() );
},
 
/**
-* Sanatize namespace id.
+* Sanitize namespace id.
 * @param id {Number} Namespace id.
 * @return {Number|Boolean} The id as-is or boolean false if invalid.
 */


___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [93827] trunk/extensions/InlineScripts

2011-08-03 Thread vasilievvv
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93827

Revision: 93827
Author:   vasilievvv
Date: 2011-08-03 14:13:57 + (Wed, 03 Aug 2011)
Log Message:
---
InlineScripts fixes:
* Rename several syntax elements in order to make things more JS-like
* Turn off the limit report hook for a while; currently broken
* Fix some annoying typos in syntax description

Modified Paths:
--
trunk/extensions/InlineScripts/InlineScripts.php
trunk/extensions/InlineScripts/interpreter/Interpreter.php
trunk/extensions/InlineScripts/interpreter/LRTable.php
trunk/extensions/InlineScripts/interpreter/Scanner.php
trunk/extensions/InlineScripts/interpreter/Shared.php
trunk/extensions/InlineScripts/interpreter/syntax.txt
trunk/extensions/InlineScripts/interpreterTests.txt

Modified: trunk/extensions/InlineScripts/InlineScripts.php
===
--- trunk/extensions/InlineScripts/InlineScripts.php2011-08-03 13:46:41 UTC 
(rev 93826)
+++ trunk/extensions/InlineScripts/InlineScripts.php2011-08-03 14:13:57 UTC 
(rev 93827)
@@ -39,7 +39,7 @@
 $wgParserTestFiles[] = $dir . 'interpreterTests.txt';
 $wgHooks['ParserFirstCallInit'][] = 'InlineScriptsHooks::setupParserHook';
 $wgHooks['ParserClearState'][] = 'InlineScriptsHooks::clearState';
-$wgHooks['ParserLimitReport'][] = 'InlineScriptsHooks::reportLimits';
+//$wgHooks['ParserLimitReport'][] = 'InlineScriptsHooks::reportLimits';
 
 $wgInlineScriptsLimits = array(
/**
@@ -140,7 +140,7 @@
 * @param  $report
 * @return bool
 */
-   public static function reportLimits( $parser, $report ) {
+   public static function reportLimits( $parser, $report ) {
global $wgInlineScriptsLimits;
$i = self::getInterpreter();
$report .=

Modified: trunk/extensions/InlineScripts/interpreter/Interpreter.php
===
--- trunk/extensions/InlineScripts/interpreter/Interpreter.php  2011-08-03 
13:46:41 UTC (rev 93826)
+++ trunk/extensions/InlineScripts/interpreter/Interpreter.php  2011-08-03 
14:13:57 UTC (rev 93827)
@@ -178,7 +178,7 @@
return 
new ISData();
}
}
-   case 'foreach':
+   case 'for':
$array = 
$this-evaluateNode( $c[4], $rec + 1 );
if( $array-type != 
ISData::DList )
throw new 
ISUserVisibleException( 'invalidforeach', $c[0]-type );
@@ -322,8 +322,8 @@
switch( $type ) {
case 'isset':
return new ISData( 
ISData::DBool, $this-checkIsset( $c[2], $rec ) );
-   case 'unset':
-   $this-unsetVar( $c[2], 
$rec );
+   case 'delete':
+   $this-deleteVar( 
$c[2], $rec );
return new ISData();
default:
throw new ISException( 
Unknown keyword: {$type} );
@@ -352,7 +352,7 @@
}
} else {
switch( $c[0]-type ) {
-   case 'leftbrace':
+   case 'leftbracket':
return 
$this-evaluateNode( $c[1], $rec + 1 );
case 'leftsquare':
return new ISData( 
ISData::DList, $this-parseArray( $c[1], $rec + 1 ) );
@@ -516,12 +516,12 @@
}
}

-   protected function unsetVar( $lval, $rec ) {
+   protected function deleteVar( $lval, $rec ) {
$c = $lval-getChildren();
$line = $c[0]-line;
$varname = $c[0]-value;
if( isset( $c[1] ) ) {
-   throw new ISException( 'unset() is not usable for array 
elements' );
+   throw new ISException( 'delete() is not usable for 
array elements' );
}
unset( $this-mVars[$varname] );
}

Modified: trunk/extensions/InlineScripts/interpreter/LRTable.php

[MediaWiki-CVS] SVN: [93828] trunk/phase3/includes/installer

2011-08-03 Thread mah
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93828

Revision: 93828
Author:   mah
Date: 2011-08-03 14:25:20 + (Wed, 03 Aug 2011)
Log Message:
---
re: r93635

* Restore false from envCheckPath() if wgScriptPath isn't found.
* Add message showing complete URL for wiki.

Modified Paths:
--
trunk/phase3/includes/installer/Installer.i18n.php
trunk/phase3/includes/installer/Installer.php

Modified: trunk/phase3/includes/installer/Installer.i18n.php
===
--- trunk/phase3/includes/installer/Installer.i18n.php  2011-08-03 14:13:57 UTC 
(rev 93827)
+++ trunk/phase3/includes/installer/Installer.i18n.php  2011-08-03 14:25:20 UTC 
(rev 93828)
@@ -148,6 +148,7 @@
'config-no-uri'   = '''Error:''' Could not determine 
the current URI.
 Installation aborted.,
'config-using-server' = 'Using server name 
nowiki$1/nowiki.',
+   'config-using-uri'= 'Using server URL 
nowiki$1$2/nowiki.',
'config-uploads-not-safe' = '''Warning:''' Your default 
directory for uploads code$1/code is vulnerable to arbitrary scripts 
execution.
 Although MediaWiki checks all uploaded files for security threats, it is 
highly recommended to 
[http://www.mediawiki.org/wiki/Manual:Security#Upload_security close this 
security vulnerability] before enabling uploads.,
'config-brokenlibxml' = 'Your system has a combination of 
PHP and libxml2 versions which is buggy and can cause hidden data corruption in 
MediaWiki and other web applications.
@@ -4690,8 +4691,8 @@
'config-install-pg-plpgsql' = 'Vérification du language PL/pgSQL',
'config-pg-no-plpgsql' = 'Vous devez installer le langage PL/pgSQL 
dans la base de données $1',
'config-pg-no-create-privs' = Le compte que vous avez spécifié pour 
l'installation n'a pas suffisamment de privilèges pour créer un compte.,
-   'config-pg-not-in-role' = Le compte que vous avez spécifié pour 
l'utilisateur web existe déjà ! 
-Le compte que vous avez spécifié pour l'installation n'est pas un 
super-utilisateur et n'est pas membre du rôle de l'internaute, il est donc 
incapable de créer des objets appartenant à l'utilisateur web.! 
+   'config-pg-not-in-role' = Le compte que vous avez spécifié pour 
l'utilisateur web existe déjà !
+Le compte que vous avez spécifié pour l'installation n'est pas un 
super-utilisateur et n'est pas membre du rôle de l'internaute, il est donc 
incapable de créer des objets appartenant à l'utilisateur web.!
 
 MediaWiki exige actuellement que les tableaux soient possédés par un 
utilisateur web. S'il vous plaît, spécifier un autre nom de compte web, ou 
cliquez sur \retour\ et spécifier un utilisateur avec les privilèges 
suffisants.,
'config-install-user' = Création d'un utilisateur de la base de 
données,
@@ -4699,7 +4700,7 @@
'config-install-user-create-failed' = Échec lors de la création de 
l'utilisateur « $1 » : $2,
'config-install-user-grant-failed' = Échec lors de l'ajout de 
permissions à l'utilisateur « $1 » : $2,
'config-install-user-missing' = 'L\'utilisateur $1 n\'existe pas.',
-   'config-install-user-missing-create' = 'L\'utilisateur $1 n\'existe 
pas ! 
+   'config-install-user-missing-create' = 'L\'utilisateur $1 n\'existe 
pas !
 S\'il vous plaît, cocher Compte de créer dans la case ci-dessous si vous 
voulez le créer.',
'config-install-tables' = 'Création des tables',
'config-install-tables-exist' = '''Avertissement:''' Les tables 
MediaWiki semblent déjà exister.
@@ -12046,7 +12047,7 @@
'config-no-db' = 'Nie można odnaleźć właściwego sterownika bazy 
danych! Musisz zainstalować sterownik bazy danych dla PHP.
 Można użyć następujących typów baz danych: $1.
 
-Jeżeli korzystasz ze współdzielonego hostingu, zwróć się do administratora o 
zainstalowanie odpowiedniego sterownika bazy danych. 
+Jeżeli korzystasz ze współdzielonego hostingu, zwróć się do administratora o 
zainstalowanie odpowiedniego sterownika bazy danych.
 Jeśli skompilowałeś PHP samodzielnie, skonfiguruj je ponownie z włączonym 
klientem bazy danych, na przykład za pomocą polecenia code./configure 
--with-mysql/code.
 Jeśli zainstalowałeś PHP jako pakiet Debiana lub Ubuntu, musisz również 
zainstalować moduł php5-mysql.',
'config-no-fts3' = '''Uwaga''' – SQLite został skompilowany bez 
[http://sqlite.org/fts3.html modułu FTS3] – funkcje wyszukiwania nie będą 
dostępne.,

Modified: trunk/phase3/includes/installer/Installer.php
===
--- trunk/phase3/includes/installer/Installer.php   2011-08-03 14:13:57 UTC 
(rev 93827)
+++ trunk/phase3/includes/installer/Installer.php   2011-08-03 14:25:20 UTC 
(rev 93828)
@@ -858,6 +858,13 @@
global $IP;
$IP = dirname( dirname( dirname( __FILE__ ) ) );
  

[MediaWiki-CVS] SVN: [93829] trunk/extensions/CollabWatchlist/includes/ SpecialCollabWatchlist.php

2011-08-03 Thread flohack
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93829

Revision: 93829
Author:   flohack
Date: 2011-08-03 14:26:26 + (Wed, 03 Aug 2011)
Log Message:
---
Now inheriting from SpecialWatchlist to re-use some code from them

Modified Paths:
--
trunk/extensions/CollabWatchlist/includes/SpecialCollabWatchlist.php

Modified: trunk/extensions/CollabWatchlist/includes/SpecialCollabWatchlist.php
===
--- trunk/extensions/CollabWatchlist/includes/SpecialCollabWatchlist.php
2011-08-03 14:25:20 UTC (rev 93828)
+++ trunk/extensions/CollabWatchlist/includes/SpecialCollabWatchlist.php
2011-08-03 14:26:26 UTC (rev 93829)
@@ -20,9 +20,15 @@
  * @file
  * @ingroup SpecialPage CollabWatchlist
  */
-class SpecialCollabWatchlist extends SpecialPage {
-   function __construct() {
-   parent::__construct( 'CollabWatchlist' );
+class SpecialCollabWatchlist extends SpecialWatchlist {
+   
+   /**
+* Constructor
+*/
+   public function __construct(){
+   //XXX That's a nasty, SpecialWatchlist should have a 
corresponding constructor,
+   // or expose the methods we need publicly
+   SpecialPage::__construct( 'CollabWatchlist' );
}
 
/**
@@ -314,20 +320,20 @@
) . 'br /';
}
 
-   $cutofflinks = \n . $this-wlCutoffLinks( $days, 
'CollabWatchlist', $nondefaults ) . br /\n;
+   $cutofflinks = \n . self::cutoffLinks( $days, 
'CollabWatchlist', $nondefaults ) . br /\n;
 
$thisTitle = SpecialPage::getTitleFor( 'CollabWatchlist' );
 
# Spit out some control panel links
-   $links[] = $this-wlShowHideLink( $nondefaults, 
'rcshowhideminor', 'hideMinor', $hideMinor );
-   $links[] = $this-wlShowHideLink( $nondefaults, 
'rcshowhidebots', 'hideBots', $hideBots );
-   $links[] = $this-wlShowHideLink( $nondefaults, 
'rcshowhideanons', 'hideAnons', $hideAnons );
-   $links[] = $this-wlShowHideLink( $nondefaults, 
'rcshowhideliu', 'hideLiu', $hideLiu );
-   $links[] = $this-wlShowHideLink( $nondefaults, 
'rcshowhidemine', 'hideOwn', $hideOwn );
-   $links[] = $this-wlShowHideLink( $nondefaults, 
'collabwatchlistshowhidelistusers', 'hideListUser', $hideListUser );
+   $links[] = self::showHideLink( $nondefaults, 'rcshowhideminor', 
'hideMinor', $hideMinor );
+   $links[] = self::showHideLink( $nondefaults, 'rcshowhidebots', 
'hideBots', $hideBots );
+   $links[] = self::showHideLink( $nondefaults, 'rcshowhideanons', 
'hideAnons', $hideAnons );
+   $links[] = self::showHideLink( $nondefaults, 'rcshowhideliu', 
'hideLiu', $hideLiu );
+   $links[] = self::showHideLink( $nondefaults, 'rcshowhidemine', 
'hideOwn', $hideOwn );
+   $links[] = self::showHideLink( $nondefaults, 
'collabwatchlistshowhidelistusers', 'hideListUser', $hideListUser );
 
if ( $wgUser-useRCPatrol() ) {
-   $links[] = $this-wlShowHideLink( $nondefaults, 
'rcshowhidepatr', 'hidePatrolled', $hidePatrolled );
+   $links[] = self::showHideLink( $nondefaults, 
'rcshowhidepatr', 'hidePatrolled', $hidePatrolled );
}
 
# Namespace filter and put the whole form together.
@@ -443,114 +449,14 @@
$dbr-freeResult( $res );
$wgOut-addHTML( $s );
}
-
-   function wlShowHideLink( $options, $message, $name, $value ) {
-   global $wgUser;
-
-   $showLinktext = wfMsgHtml( 'show' );
-   $hideLinktext = wfMsgHtml( 'hide' );
-   $title = SpecialPage::getTitleFor( 'CollabWatchlist' );
-   $skin = $wgUser-getSkin();
-
-   $label = $value ? $showLinktext : $hideLinktext;
-   $options[$name] = 1 - (int) $value;
-
-   return wfMsgHtml( $message, $skin-linkKnown( $title, $label, 
array(), $options ) );
-   }

/**
-* Creates a link for the days query parameter with hours
-* @param $h The number of hours
-* @param $page String: The name of the target page for the link
-* @param $options Mixed: Additional query parameters
-* @return String: Html for the link
-*/
-   function wlHoursLink( $h, $page, $options = array() ) {
-   global $wgUser, $wgLang, $wgContLang;
-
-   $sk = $wgUser-getSkin();
-   $title = Title::newFromText( $wgContLang-specialPage( $page ) 
);
-   $options['days'] = ( $h / 24.0 );
-
-   $s = $sk-linkKnown(
-   $title,
-   $wgLang-formatNum( $h ),
-   array(),
-   $options
-   );
-
-   return 

[MediaWiki-CVS] SVN: [93830] trunk/extensions/CollabWatchlist/includes/ SpecialCollabWatchlist.php

2011-08-03 Thread flohack
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93830

Revision: 93830
Author:   flohack
Date: 2011-08-03 14:28:37 + (Wed, 03 Aug 2011)
Log Message:
---
Now inheriting from SpecialWatchlist to re-use some code from them

Modified Paths:
--
trunk/extensions/CollabWatchlist/includes/SpecialCollabWatchlist.php

Modified: trunk/extensions/CollabWatchlist/includes/SpecialCollabWatchlist.php
===
--- trunk/extensions/CollabWatchlist/includes/SpecialCollabWatchlist.php
2011-08-03 14:26:26 UTC (rev 93829)
+++ trunk/extensions/CollabWatchlist/includes/SpecialCollabWatchlist.php
2011-08-03 14:28:37 UTC (rev 93830)
@@ -26,7 +26,7 @@
 * Constructor
 */
public function __construct(){
-   //XXX That's a nasty, SpecialWatchlist should have a 
corresponding constructor,
+   //XXX That's nasty, SpecialWatchlist should have a 
corresponding constructor,
// or expose the methods we need publicly
SpecialPage::__construct( 'CollabWatchlist' );
}


___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [93831] trunk/extensions/SemanticMediaWiki/includes/parserhooks/ SMW_SMWDoc.php

2011-08-03 Thread jeroendedauw
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93831

Revision: 93831
Author:   jeroendedauw
Date: 2011-08-03 15:22:06 + (Wed, 03 Aug 2011)
Log Message:
---
tweak; only show aliases column when needed

Modified Paths:
--
trunk/extensions/SemanticMediaWiki/includes/parserhooks/SMW_SMWDoc.php

Modified: trunk/extensions/SemanticMediaWiki/includes/parserhooks/SMW_SMWDoc.php
===
--- trunk/extensions/SemanticMediaWiki/includes/parserhooks/SMW_SMWDoc.php  
2011-08-03 14:28:37 UTC (rev 93830)
+++ trunk/extensions/SemanticMediaWiki/includes/parserhooks/SMW_SMWDoc.php  
2011-08-03 15:22:06 UTC (rev 93831)
@@ -116,17 +116,25 @@
 */
protected function getParameterTable( array $parameters ) {
$tableRows = array();
-
+   $hasAliases = false;
+   
foreach ( $parameters as $parameter ) {
-   $tableRows[] = $this-getDescriptionRow( $parameter );
+   $hasAliases = count( $parameter-getAliases() ) != 0;
+   if ( $hasAliases ) break; 
}
+   
+   foreach ( $parameters as $parameter ) {
+   if ( $parameter-getName() != 'format' ) {
+   $tableRows[] = $this-getDescriptionRow( 
$parameter, $hasAliases );
+   }
+   }
 
$table = '';
 
if ( count( $tableRows )  0 ) {
$tableRows = array_merge( array(
'!' . $this-msg( 'validator-describe-header-parameter' 
) .\n .
-   '!' . $this-msg( 'validator-describe-header-aliases' ) 
.\n .
+   ( $hasAliases ? '!' . $this-msg( 
'validator-describe-header-aliases' ) .\n : '' ) .
'!' . $this-msg( 'validator-describe-header-type' ) 
.\n .
'!' . $this-msg( 'validator-describe-header-default' ) 
.\n .
'!' . $this-msg( 
'validator-describe-header-description' )
@@ -149,13 +157,17 @@
 * @since 1.6
 *
 * @param Parameter $parameter
+* @param boolean $hasAliases
 *
 * @return string
 */
-   protected function getDescriptionRow( Parameter $parameter ) {
-   $aliases = $parameter-getAliases();
-   $aliases = count( $aliases )  0 ? implode( ', ', $aliases ) : 
'-';
+   protected function getDescriptionRow( Parameter $parameter, $hasAliases 
) {
+   if ( $hasAliases ) {
+   $aliases = $parameter-getAliases();
+   $aliases = count( $aliases )  0 ? implode( ', ', 
$aliases ) : '-';
+   }
 
+
$description = $parameter-getMessage();
if ( $description === false ) {
$description = $parameter-getDescription();
@@ -177,9 +189,9 @@

if ( $default === '' ) $default = '' . $this-msg( 
'validator-describe-empty' ) . '';
 
-   return EOT
-| {$parameter-getName()}
-| {$aliases}
+   return | {$parameter-getName()}\n
+. ( $hasAliases ? '| ' . $aliases . \n : '' ) .
+EOT
 | {$type}
 | {$default}
 | {$description}


___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [93832] trunk/extensions/SemanticMediaWiki/includes/queryprinters

2011-08-03 Thread jeroendedauw
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93832

Revision: 93832
Author:   jeroendedauw
Date: 2011-08-03 15:24:22 + (Wed, 03 Aug 2011)
Log Message:
---
ake use of setMessage instead of setDescription

Modified Paths:
--
trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QP_CSV.php
trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QP_DSV.php

trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QP_Embedded.php
trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QP_List.php
trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QP_RDF.php
trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QP_RSSlink.php

trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QueryPrinter.php

Modified: 
trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QP_CSV.php
===
--- trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QP_CSV.php
2011-08-03 15:22:06 UTC (rev 93831)
+++ trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QP_CSV.php
2011-08-03 15:24:22 UTC (rev 93832)
@@ -108,7 +108,7 @@
$params = array_merge( parent::getParameters(), 
$this-exportFormatParameters() );

$params['sep'] = new Parameter( 'sep' );
-   $params['sep']-setDescription( wfMsg( 'smw-paramdesc-csv-sep' 
) );
+   $params['sep']-setMessage( 'smw-paramdesc-csv-sep' );
$params['sep']-setDefault( $this-m_sep );

return $params;

Modified: 
trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QP_DSV.php
===
--- trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QP_DSV.php
2011-08-03 15:22:06 UTC (rev 93831)
+++ trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QP_DSV.php
2011-08-03 15:24:22 UTC (rev 93832)
@@ -185,11 +185,11 @@
$params = array_merge( parent::getParameters(), 
$this-exportFormatParameters() );

$params['separator'] = new Parameter( 'separator', 'sep' );
-   $params['separator']-setDescription( wfMsg( 
'smw-paramdesc-dsv-separator' ) );
+   $params['separator']-setMessage( 'smw-paramdesc-dsv-separator' 
);
$params['separator']-setDefault( $this-separator );

$params['filename'] = new Parameter( 'filename' );
-   $params['filename']-setDescription( wfMsg( 
'smw-paramdesc-dsv-filename' ) );
+   $params['filename']-setMessage( 'smw-paramdesc-dsv-filename' );
$params['filename']-setDefault( $this-fileName );

return $params;

Modified: 
trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QP_Embedded.php
===
--- 
trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QP_Embedded.php   
2011-08-03 15:22:06 UTC (rev 93831)
+++ 
trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QP_Embedded.php   
2011-08-03 15:24:22 UTC (rev 93832)
@@ -114,11 +114,11 @@
$params = parent::getParameters();
 
$params['embedformat'] = new Parameter( 'embedformat' );
-   $params['embedformat']-setDescription( wfMsg( 
'smw_paramdesc_embedformat' ) );
+   $params['embedformat']-setMessage( 'smw_paramdesc_embedformat' 
);
$params['embedformat']-setDefault( '' );

$params['embedonly'] = new Parameter( 'embedonly', 
Parameter::TYPE_BOOLEAN );
-   $params['embedonly']-setDescription( wfMsg( 
'smw_paramdesc_embedonly' ) );
+   $params['embedonly']-setMessage( 'smw_paramdesc_embedonly' );
$params['embedonly']-setDefault( '' ); 

return $params;

Modified: 
trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QP_List.php
===
--- trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QP_List.php   
2011-08-03 15:22:06 UTC (rev 93831)
+++ trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QP_List.php   
2011-08-03 15:24:22 UTC (rev 93832)
@@ -302,30 +302,30 @@

if ( $plainlist ) {
$params['sep'] = new Parameter( 'sep' );
-   $params['sep']-setDescription( wfMsg( 
'smw_paramdesc_sep' ) );
+   $params['sep']-setMessage( 'smw_paramdesc_sep' );
$params['sep']-setDefault( '' );
}

$params['template'] = new Parameter( 'template' );
-   $params['template']-setDescription( wfMsg( 
'smw_paramdesc_template' ) );

[MediaWiki-CVS] SVN: [93834] trunk/phase3/includes/installer

2011-08-03 Thread mah
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93834

Revision: 93834
Author:   mah
Date: 2011-08-03 15:46:06 + (Wed, 03 Aug 2011)
Log Message:
---
* Make envCheckPath() specific to each installer, web vs cli
* Add warning during the CLI install that the uploads directory isn't
  being checked for arbitrary script execution

Modified Paths:
--
trunk/phase3/includes/installer/CliInstaller.php
trunk/phase3/includes/installer/Installer.i18n.php
trunk/phase3/includes/installer/Installer.php
trunk/phase3/includes/installer/WebInstaller.php

Modified: trunk/phase3/includes/installer/CliInstaller.php
===
--- trunk/phase3/includes/installer/CliInstaller.php2011-08-03 15:38:06 UTC 
(rev 93833)
+++ trunk/phase3/includes/installer/CliInstaller.php2011-08-03 15:46:06 UTC 
(rev 93834)
@@ -13,6 +13,7 @@
  * @since 1.17
  */
 class CliInstaller extends Installer {
+   private $specifiedScriptPath = false;
 
private $optionMap = array(
'dbtype' = 'wgDBtype',
@@ -45,6 +46,10 @@
 
parent::__construct();
 
+   if ( isset( $option['scriptpath'] ) ) {
+   $this-specifiedScriptPath = true;
+   }
+
foreach ( $this-optionMap as $opt = $global ) {
if ( isset( $option[$opt] ) ) {
$GLOBALS[$global] = $option[$opt];
@@ -170,4 +175,16 @@
exit;
}
}
+
+   public function envCheckPath( ) {
+   if ( !$this-specifiedScriptPath ) {
+   $this-showMessage( 'config-no-cli-uri', 
$this-getVar(wgScriptPath) );
+   }
+   return parent::envCheckPath();
+   }
+
+   public function dirIsExecutable( $dir, $url ) {
+   $this-showMessage( 'config-no-cli-uploads-check', $dir );
+   return false;
+   }
 }

Modified: trunk/phase3/includes/installer/Installer.i18n.php
===
--- trunk/phase3/includes/installer/Installer.i18n.php  2011-08-03 15:38:06 UTC 
(rev 93833)
+++ trunk/phase3/includes/installer/Installer.i18n.php  2011-08-03 15:46:06 UTC 
(rev 93834)
@@ -147,10 +147,13 @@
 Image thumbnailing will be disabled.',
'config-no-uri'   = '''Error:''' Could not determine 
the current URI.
 Installation aborted.,
+   'config-no-cli-uri'   = '''Warning''': No --scriptpath 
specified, using default: code$1/code.,
'config-using-server' = 'Using server name 
nowiki$1/nowiki.',
'config-using-uri'= 'Using server URL 
nowiki$1$2/nowiki.',
'config-uploads-not-safe' = '''Warning:''' Your default 
directory for uploads code$1/code is vulnerable to arbitrary scripts 
execution.
 Although MediaWiki checks all uploaded files for security threats, it is 
highly recommended to 
[http://www.mediawiki.org/wiki/Manual:Security#Upload_security close this 
security vulnerability] before enabling uploads.,
+   'config-no-cli-uploads-check' = '''Warning:''' Your default 
directory for uploads (code$1/code) is not checked for vulnerability
+to arbitrary script execution during the CLI install.,
'config-brokenlibxml' = 'Your system has a combination of 
PHP and libxml2 versions which is buggy and can cause hidden data corruption in 
MediaWiki and other web applications.
 Upgrade to PHP 5.2.9 or later and libxml2 2.7.3 or later 
([http://bugs.php.net/bug.php?id=45996 bug filed with PHP]).
 Installation aborted.',

Modified: trunk/phase3/includes/installer/Installer.php
===
--- trunk/phase3/includes/installer/Installer.php   2011-08-03 15:38:06 UTC 
(rev 93833)
+++ trunk/phase3/includes/installer/Installer.php   2011-08-03 15:46:06 UTC 
(rev 93834)
@@ -859,10 +859,6 @@
$IP = dirname( dirname( dirname( __FILE__ ) ) );
$this-setVar( 'IP', $IP );
 
-   if( !$this-getVar( 'wgScriptPath' ) ) {
-   $this-showError( 'config-no-uri' );
-   return false;
-   }
$this-showMessage( 'config-using-uri', $this-getVar( 
'wgServer' ), $this-getVar( 'wgScriptPath' ) );
return true;
}

Modified: trunk/phase3/includes/installer/WebInstaller.php
===
--- trunk/phase3/includes/installer/WebInstaller.php2011-08-03 15:38:06 UTC 
(rev 93833)
+++ trunk/phase3/includes/installer/WebInstaller.php2011-08-03 15:46:06 UTC 
(rev 93834)
@@ -1007,20 +1007,6 @@
}
}
 
-   // PHP_SELF isn't available sometimes, such as when PHP is CGI 
but
-   // cgi.fix_pathinfo is disabled. In 

[MediaWiki-CVS] SVN: [93835] trunk/extensions/GPoC

2011-08-03 Thread yuvipanda
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93835

Revision: 93835
Author:   yuvipanda
Date: 2011-08-03 17:10:25 + (Wed, 03 Aug 2011)
Log Message:
---
Added Special Page to view selections

Modified Paths:
--
trunk/extensions/GPoC/GPoC.php
trunk/extensions/GPoC/SpecialFilterRatings.php
trunk/extensions/GPoC/models/Selection.php

Added Paths:
---
trunk/extensions/GPoC/SpecialSelection.php
trunk/extensions/GPoC/templates/SelectionTemplate.php

Modified: trunk/extensions/GPoC/GPoC.php
===
--- trunk/extensions/GPoC/GPoC.php  2011-08-03 15:46:06 UTC (rev 93834)
+++ trunk/extensions/GPoC/GPoC.php  2011-08-03 17:10:25 UTC (rev 93835)
@@ -28,8 +28,10 @@
 $wgAutoloadClasses['AssessmentsExtractor'] = $dir . 'AssessmentsExtractor.php';
 $wgAutoloadClasses['SpecialAssessmentLog'] = $dir . 'SpecialAssessmentLog.php';
 $wgAutoloadClasses['SpecialFilterRatings'] = $dir . 'SpecialFilterRatings.php';
+$wgAutoloadClasses['SpecialSelection'] = $dir . 'SpecialSelection.php';
 
 $wgAutoloadClasses['FilterRatingsTemplate'] = $dir . 
'templates/FilterRatingsTemplate.php';
+$wgAutoloadClasses['SelectionTemplate'] = $dir . 
'templates/SelectionTemplate.php';
 
 $wgHooks['ArticleSaveComplete'][] = 'GPoCHooks::ArticleSaveComplete';
 $wgHooks['LoadExtensionSchemaUpdates'][] = 'GPoCHooks::SetupSchema';
@@ -41,5 +43,6 @@
 
 $wgSpecialPages['AssessmentLog'] = 'SpecialAssessmentLog';
 $wgSpecialPages['FilterRatings'] = 'SpecialFilterRatings';
+$wgSpecialPages['Selection'] = 'SpecialSelection';
 
 // Configuration

Modified: trunk/extensions/GPoC/SpecialFilterRatings.php
===
--- trunk/extensions/GPoC/SpecialFilterRatings.php  2011-08-03 15:46:06 UTC 
(rev 93834)
+++ trunk/extensions/GPoC/SpecialFilterRatings.php  2011-08-03 17:10:25 UTC 
(rev 93835)
@@ -49,7 +49,7 @@
$template-set( 'filters', $filters );
$template-set( 'articles', $entries );
$template-set( 'action', $action );
-   $template-set( 'selection', $selection );
+   $template-set( 'selection', $selection_name );
 
$wgOut-addTemplate( $template );
}

Added: trunk/extensions/GPoC/SpecialSelection.php
===
--- trunk/extensions/GPoC/SpecialSelection.php  (rev 0)
+++ trunk/extensions/GPoC/SpecialSelection.php  2011-08-03 17:10:25 UTC (rev 
93835)
@@ -0,0 +1,32 @@
+?php
+/**
+ */
+
+if ( !defined( 'MEDIAWIKI' ) ) {
+   echo( not a valid entry point.\n );
+   die( 1 );
+}
+
+class SpecialSelection extends SpecialPage {
+
+   public function __construct() {
+   parent::__construct( 'Selection' );
+   }
+
+   public function execute( $par ) {
+global $wgOut, $wgRequest;
+
+   $name = $par;
+
+   $entries = Selection::getSelection( $name );
+   $this-setHeaders();
+
+   $wgOut-setPageTitle(Selection);
+
+   $template = new SelectionTemplate();
+   $template-set( 'articles', $entries );
+
+   $wgOut-addTemplate( $template );
+
+   }
+}


Property changes on: trunk/extensions/GPoC/SpecialSelection.php
___
Added: svn:eol-style
   + native

Modified: trunk/extensions/GPoC/models/Selection.php
===
--- trunk/extensions/GPoC/models/Selection.php  2011-08-03 15:46:06 UTC (rev 
93834)
+++ trunk/extensions/GPoC/models/Selection.php  2011-08-03 17:10:25 UTC (rev 
93835)
@@ -21,4 +21,24 @@
);
}
}
+
+   public static function getSelection( $name ) {
+   $dbr = wfGetDB( DB_SLAVE );
+
+   $query = $dbr-select(
+   'selections',
+   '*',
+   array('s_selection_name' = $name),
+   __METHOD__
+   );
+
+   $articles = array();
+   foreach( $query as $article_row ) {
+   $article = (array)$article_row;
+   $title = Title::makeTitle( $article['s_namespace'], 
$article['s_article'] );
+   $article['title'] = $title;
+   array_push( $articles, $article );
+   }
+   return $articles;
+   }
 }

Added: trunk/extensions/GPoC/templates/SelectionTemplate.php
===
--- trunk/extensions/GPoC/templates/SelectionTemplate.php   
(rev 0)
+++ trunk/extensions/GPoC/templates/SelectionTemplate.php   2011-08-03 
17:10:25 UTC (rev 93835)
@@ -0,0 +1,35 @@
+?php
+if( !defined( 'MEDIAWIKI' ) ) {
+   

[MediaWiki-CVS] SVN: [93837] trunk/extensions/GPoC/SpecialSelection.php

2011-08-03 Thread yuvipanda
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93837

Revision: 93837
Author:   yuvipanda
Date: 2011-08-03 17:10:37 + (Wed, 03 Aug 2011)
Log Message:
---
Export Selections as CSV

Modified Paths:
--
trunk/extensions/GPoC/SpecialSelection.php

Modified: trunk/extensions/GPoC/SpecialSelection.php
===
--- trunk/extensions/GPoC/SpecialSelection.php  2011-08-03 17:10:32 UTC (rev 
93836)
+++ trunk/extensions/GPoC/SpecialSelection.php  2011-08-03 17:10:37 UTC (rev 
93837)
@@ -13,20 +13,45 @@
parent::__construct( 'Selection' );
}
 
+   private function makeCSV( $articles, $name ) {
+   $outstream = fopen( php://output, w );
+   $headers = array(
+   'article',
+   'added'
+   );
+   fputcsv( $outstream, $headers );
+   foreach( $articles as $article ) {
+   $row = array(
+   $article['title']-getFullText(),
+   wfTimeStamp( TS_ISO_8601, 
$article['s_timestamp'] )
+   );
+   fputcsv( $outstream, $row );
+   }
+   fclose( $outstream );
+   }
public function execute( $par ) {
 global $wgOut, $wgRequest;
 
$name = $par;
+   $action = $wgRequest-getVal('action'); 
 
$entries = Selection::getSelection( $name );
$this-setHeaders();
 
$wgOut-setPageTitle(Selection);
 
+   if( $action == 'csv' ) {
+   $wgRequest-response()-header( 'Content-type: 
text/csv' );
+   // Is there a security issue in letting the name be 
arbitrary?
+   $wgRequest-response()-header(
+   Content-Disposition: attachment; 
filename=$name.csv
+   );
+   $wgOut-disable();
+   $this-makeCSV( $entries, $name );
+   }
$template = new SelectionTemplate();
$template-set( 'articles', $entries );
 
$wgOut-addTemplate( $template );
-
}
 }


___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [93838] trunk/tools/mwmultiversion/scripts/set-group-write2

2011-08-03 Thread aaron
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93838

Revision: 93838
Author:   aaron
Date: 2011-08-03 17:19:19 + (Wed, 03 Aug 2011)
Log Message:
---
Do chmod cleanup on multiversion/ too

Modified Paths:
--
trunk/tools/mwmultiversion/scripts/set-group-write2

Modified: trunk/tools/mwmultiversion/scripts/set-group-write2
===
--- trunk/tools/mwmultiversion/scripts/set-group-write2 2011-08-03 17:10:37 UTC 
(rev 93837)
+++ trunk/tools/mwmultiversion/scripts/set-group-write2 2011-08-03 17:19:19 UTC 
(rev 93838)
@@ -12,3 +12,4 @@
 done
 
 find $targetbase/wmf-config -group wikidev -not -perm -020 -exec chmod g+w 
'{}' ';'
+find $targetbase/multiversion -group wikidev -not -perm -020 -exec chmod g+w 
'{}' ';'


___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [93839] trunk/phase3/includes/Preferences.php

2011-08-03 Thread ialex
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93839

Revision: 93839
Author:   ialex
Date: 2011-08-03 17:19:32 + (Wed, 03 Aug 2011)
Log Message:
---
Call Linker methods statically

Modified Paths:
--
trunk/phase3/includes/Preferences.php

Modified: trunk/phase3/includes/Preferences.php
===
--- trunk/phase3/includes/Preferences.php   2011-08-03 17:19:19 UTC (rev 
93838)
+++ trunk/phase3/includes/Preferences.php   2011-08-03 17:19:32 UTC (rev 
93839)
@@ -131,7 +131,7 @@
 * @return void
 */
static function profilePreferences( $user, $defaultPreferences ) {
-   global $wgLang, $wgUser;
+   global $wgLang;
## User info #
// Information panel
$defaultPreferences['username'] = array(
@@ -224,7 +224,7 @@
);
 
if ( $wgAuth-allowPasswordChange() ) {
-   $link = $wgUser-getSkin()-link( 
SpecialPage::getTitleFor( 'ChangePassword' ),
+   $link = Linker::link( SpecialPage::getTitleFor( 
'ChangePassword' ),
wfMsgHtml( 'prefs-resetpass' ), array(),
array( 'returnto' = SpecialPage::getTitleFor( 
'Preferences' ) ) );
 
@@ -353,7 +353,7 @@
$helpMessages[] = 'prefs-help-email-others';
}
 
-   $link = $wgUser-getSkin()-link(
+   $link = Linker::link(
SpecialPage::getTitleFor( 'ChangeEmail' ),
wfMsgHtml( $user-getEmail() ? 
'prefs-changeemail' : 'prefs-setemail' ),
array(),
@@ -389,14 +389,10 @@
$disableEmailPrefs = false;
} else {
$disableEmailPrefs = true;
-   $skin = $wgUser-getSkin();
$emailauthenticated = wfMsgExt( 
'emailnotauthenticated', 'parseinline' ) . 'br /' .
-   $skin-link(
+   Linker::linkKnown(

SpecialPage::getTitleFor( 'Confirmemail' ),
-   wfMsg( 
'emailconfirmlink' ),
-   array(),
-   array(),
-   array( 'known', 
'noclasses' )
+   wfMsg( 
'emailconfirmlink' )
) . 'br /';
}
} else {
@@ -489,17 +485,16 @@
# This code is basically copied from generateSkinOptions().  
It'd
# be nice to somehow merge this back in there to avoid 
redundancy.
if ( $wgAllowUserCss || $wgAllowUserJs ) {
-   $sk = $user-getSkin();
$linkTools = array();
 
if ( $wgAllowUserCss ) {
$cssPage = Title::makeTitleSafe( NS_USER, 
$user-getName() . '/common.css' );
-   $linkTools[] = $sk-link( $cssPage, wfMsgHtml( 
'prefs-custom-css' ) );
+   $linkTools[] = Linker::link( $cssPage, 
wfMsgHtml( 'prefs-custom-css' ) );
}
 
if ( $wgAllowUserJs ) {
$jsPage = Title::makeTitleSafe( NS_USER, 
$user-getName() . '/common.js' );
-   $linkTools[] = $sk-link( $jsPage, wfMsgHtml( 
'prefs-custom-js' ) );
+   $linkTools[] = Linker::link( $jsPage, 
wfMsgHtml( 'prefs-custom-js' ) );
}
 
$defaultPreferences['commoncssjs'] = array(
@@ -1065,7 +1060,6 @@
}
}
asort( $validSkinNames );
-   $sk = $user-getSkin();
 
foreach ( $validSkinNames as $skinkey = $sn ) {
$linkTools = array();
@@ -1082,12 +1076,12 @@
# Create links to user CSS/JS pages
if ( $wgAllowUserCss ) {
$cssPage = Title::makeTitleSafe( NS_USER, 
$user-getName() . '/' . $skinkey . '.css' );
-   $linkTools[] = $sk-link( $cssPage, wfMsgHtml( 
'prefs-custom-css' ) );
+   $linkTools[] = Linker::link( $cssPage, 

[MediaWiki-CVS] SVN: [93840] trunk/parsers/wikidom/lib/es/es.Surface.js

2011-08-03 Thread inez
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93840

Revision: 93840
Author:   inez
Date: 2011-08-03 17:31:52 + (Wed, 03 Aug 2011)
Log Message:
---
Get rid of some old debug code

Modified Paths:
--
trunk/parsers/wikidom/lib/es/es.Surface.js

Modified: trunk/parsers/wikidom/lib/es/es.Surface.js
===
--- trunk/parsers/wikidom/lib/es/es.Surface.js  2011-08-03 17:19:32 UTC (rev 
93839)
+++ trunk/parsers/wikidom/lib/es/es.Surface.js  2011-08-03 17:31:52 UTC (rev 
93840)
@@ -641,9 +641,7 @@
 es.Surface.prototype.moveCursorRight = function() {
var block = this.location.block,
offset = this.location.offset;
-   
-   console.log(offset);
-   
+
if ( offset  block.getLength() ) {
offset++;
} else {
@@ -659,7 +657,6 @@
);

this.location = new es.Location( block, offset );
-   console.log(offset);
 };
 
 /**


___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [93842] trunk/extensions/Wikidata/OmegaWiki

2011-08-03 Thread kipcool
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93842

Revision: 93842
Author:   kipcool
Date: 2011-08-03 17:42:55 + (Wed, 03 Aug 2011)
Log Message:
---
Solved the problem that duplicates could appear in OptionAttributeOptions lists

Modified Paths:
--
trunk/extensions/Wikidata/OmegaWiki/Controller.php
trunk/extensions/Wikidata/OmegaWiki/SpecialSelect.php
trunk/extensions/Wikidata/OmegaWiki/SpecialSuggest.php

Modified: trunk/extensions/Wikidata/OmegaWiki/Controller.php
===
--- trunk/extensions/Wikidata/OmegaWiki/Controller.php  2011-08-03 17:35:55 UTC 
(rev 93841)
+++ trunk/extensions/Wikidata/OmegaWiki/Controller.php  2011-08-03 17:42:55 UTC 
(rev 93842)
@@ -205,8 +205,7 @@
public function update( $keyPath, $record ) {
$definedMeaningId = $keyPath-peek( 1 )-definedMeaningId;
$syntransId = $keyPath-peek( 0 )-syntransId;
-   $identicalMeaning = $record-identicalMeaning;
-   updateSynonymOrTranslationWithId( $syntransId, 
$identicalMeaning );
+   updateSynonymOrTranslationWithId( $syntransId, 
$record-identicalMeaning );
}
 }
 

Modified: trunk/extensions/Wikidata/OmegaWiki/SpecialSelect.php
===
--- trunk/extensions/Wikidata/OmegaWiki/SpecialSelect.php   2011-08-03 
17:35:55 UTC (rev 93841)
+++ trunk/extensions/Wikidata/OmegaWiki/SpecialSelect.php   2011-08-03 
17:42:55 UTC (rev 93842)
@@ -36,12 +36,10 @@
 
$sql = SELECT 
{$dc}_option_attribute_options.option_id,{$dc}_option_attribute_options.option_mid
 .
 FROM {$dc}_option_attribute_options .
-JOIN {$dc}_class_attributes ON 
{$dc}_class_attributes.object_id = {$dc}_option_attribute_options.attribute_id 
.
-WHERE {$dc}_class_attributes.attribute_mid = 
 . $optionAttribute .
+WHERE 
{$dc}_option_attribute_options.attribute_id =  . $optionAttribute .
 AND 
({$dc}_option_attribute_options.language_id =  . $objectLanguage .
 OR {$dc}_option_attribute_options.language_id 
= 0) .
-   ' AND ' . getLatestTransactionRestriction( 
{$dc}_option_attribute_options ) .
-   ' AND ' . getLatestTransactionRestriction( 
{$dc}_class_attributes );
+   ' AND ' . getLatestTransactionRestriction( 
{$dc}_option_attribute_options ) ;
$options_res = $dbr-query( $sql );
 
$optionsString = '';

Modified: trunk/extensions/Wikidata/OmegaWiki/SpecialSuggest.php
===
--- trunk/extensions/Wikidata/OmegaWiki/SpecialSuggest.php  2011-08-03 
17:35:55 UTC (rev 93841)
+++ trunk/extensions/Wikidata/OmegaWiki/SpecialSuggest.php  2011-08-03 
17:42:55 UTC (rev 93842)
@@ -276,8 +276,8 @@
$filteredAttributesRestriction = 
$this-getFilteredAttributesRestriction( $annotationAttributeId );
 
$sql =
-   'SELECT attribute_mid, MAX(spelling) as spelling FROM (' .
-   'SELECT attribute_mid, spelling' .
+   'SELECT object_id, attribute_mid, MAX(spelling) as spelling 
FROM (' .
+   'SELECT object_id, attribute_mid, spelling' .
 FROM {$dc}_bootstrapped_defined_meanings, 
{$dc}_class_attributes, {$dc}_syntrans, {$dc}_expression .
 WHERE {$dc}_bootstrapped_defined_meanings.name =  . 
$dbr-addQuotes( $attributesLevel ) .
 AND {$dc}_bootstrapped_defined_meanings.defined_meaning_id = 
{$dc}_class_attributes.level_mid .
@@ -309,7 +309,7 @@
$classRestriction .
')';
 
-   $sql .= ') AS filtered GROUP BY attribute_mid';
+   $sql .= ') AS filtered GROUP BY object_id';
 
return $sql;
}
@@ -620,7 +620,7 @@
$recordSet = new ArrayRecordSet( new Structure( $o-id, 
$optionAttributeAttribute ), new Structure( $o-id ) );
 
while ( $row = $dbr-fetchObject( $queryResult ) )
-   $recordSet-addRecord( array( $row-attribute_mid, 
$row-spelling ) );
+   $recordSet-addRecord( array( $row-object_id, 
$row-spelling ) );
 
$editor = createSuggestionsTableViewer( null );
$editor-addEditor( createShortTextViewer( 
$optionAttributeAttribute ) );


___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [93843] trunk/extensions/UserMerge/UserMerge_body.php

2011-08-03 Thread ialex
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93843

Revision: 93843
Author:   ialex
Date: 2011-08-03 17:52:08 + (Wed, 03 Aug 2011)
Log Message:
---
Removed unused global declaration

Modified Paths:
--
trunk/extensions/UserMerge/UserMerge_body.php

Modified: trunk/extensions/UserMerge/UserMerge_body.php
===
--- trunk/extensions/UserMerge/UserMerge_body.php   2011-08-03 17:42:55 UTC 
(rev 93842)
+++ trunk/extensions/UserMerge/UserMerge_body.php   2011-08-03 17:52:08 UTC 
(rev 93843)
@@ -343,9 +343,8 @@
 * @author Matthew April matthew.ap...@tbs-sct.gc.ca
 */
private function movePages( $newuser_text, $olduser_text ) {
+   global $wgOut, $wgContLang, $wgUser;

-   global $wgOut, $wgTitle, $wgContLang, $wgUser;
-   
$oldusername = trim( str_replace( '_', ' ', $olduser_text ) );
$oldusername = Title::makeTitle( NS_USER, $oldusername );
$newusername = Title::makeTitleSafe( NS_USER, 
$wgContLang-ucfirst( $newuser_text ) );


___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [93844] trunk/extensions/GPoC

2011-08-03 Thread yuvipanda
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93844

Revision: 93844
Author:   yuvipanda
Date: 2011-08-03 17:58:24 + (Wed, 03 Aug 2011)
Log Message:
---
Export CSV link available in the UI

Modified Paths:
--
trunk/extensions/GPoC/SpecialSelection.php
trunk/extensions/GPoC/templates/SelectionTemplate.php

Modified: trunk/extensions/GPoC/SpecialSelection.php
===
--- trunk/extensions/GPoC/SpecialSelection.php  2011-08-03 17:52:08 UTC (rev 
93843)
+++ trunk/extensions/GPoC/SpecialSelection.php  2011-08-03 17:58:24 UTC (rev 
93844)
@@ -32,7 +32,7 @@
public function execute( $par ) {
 global $wgOut, $wgRequest;
 
-   $name = $par;
+   $name = $wgRequest-getVal('name');
$action = $wgRequest-getVal('action'); 
 
$entries = Selection::getSelection( $name );
@@ -49,8 +49,15 @@
$wgOut-disable();
$this-makeCSV( $entries, $name );
}
+
+   $csv_link = $this-getFullTitle()-getFullUrl( array( 
+   'action' = 'csv',
+   'name' = $name
+   ) );
$template = new SelectionTemplate();
$template-set( 'articles', $entries );
+   $template-set( 'name', $name );
+   $template-set( 'csv_link', $csv_link );
 
$wgOut-addTemplate( $template );
}

Modified: trunk/extensions/GPoC/templates/SelectionTemplate.php
===
--- trunk/extensions/GPoC/templates/SelectionTemplate.php   2011-08-03 
17:52:08 UTC (rev 93843)
+++ trunk/extensions/GPoC/templates/SelectionTemplate.php   2011-08-03 
17:58:24 UTC (rev 93844)
@@ -6,11 +6,13 @@
 class SelectionTemplate extends QuickTemplate {
public function execute() {
$articles = $this-data['articles'];
+   $name = $this-data['name'];
+   $csv_link = $this-data['csv_link'];
 ?
 
 div id=
 ?php if( count($articles)  0 ) { ?
-h3Results/h3
+h3Articles in Selection ?php echo $name; ?/h3 smalla href=?php echo 
$csv_link; ?Export CSV/a/small
table
tr
thArticle/th
@@ -25,7 +27,7 @@
?php } ?
/table
 ?php } else { ? 
-pNo results found/p
+pNo such selection found/p
 ?php } ?
 /div
 


___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [93845] trunk/tools/mwmultiversion/multiversion

2011-08-03 Thread aaron
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93845

Revision: 93845
Author:   aaron
Date: 2011-08-03 18:00:17 + (Wed, 03 Aug 2011)
Log Message:
---
* Pushed implicit --wiki=aawiki param code up to MWScript.php, which avoids 
problems with files with the same name. It will no longer be assumed without 
the wrapper, but the callers using the scripts in the list were updated to use 
--wiki anyway.
* Added mctest.php  removed mergeMessageFileList.php (we don't want to run 
this on any random version) to implicit aawiki script list.

Modified Paths:
--
trunk/tools/mwmultiversion/multiversion/MWMultiVersion.php
trunk/tools/mwmultiversion/multiversion/MWScript.php

Modified: trunk/tools/mwmultiversion/multiversion/MWMultiVersion.php
===
--- trunk/tools/mwmultiversion/multiversion/MWMultiVersion.php  2011-08-03 
17:58:24 UTC (rev 93844)
+++ trunk/tools/mwmultiversion/multiversion/MWMultiVersion.php  2011-08-03 
18:00:17 UTC (rev 93845)
@@ -169,11 +169,6 @@
$dbname = substr( $argv[1], 7 ); // script.php 
--wiki=dbname
} elseif ( isset( $argv[1] )  substr( $argv[1], 0, 2 ) !== 
'--' ) {
$dbname = $argv[1]; // script.php dbname
-   } elseif ( in_array( $argv[0], self::wikilessScripts() ) ) {
-   # For addwiki.php, the DB doesn't yet exist, and for 
nextJobDB.php
-   # we don't care what DB we use. Assumme aawiki as 
Maintenance.php does.
-   $dbname = 'aawiki';
-   $argv = array_merge( array( $argv[0], --wiki=$dbname 
), array_slice( $argv, 1 ) );
}
 
if ( $dbname === '' ) {
@@ -189,7 +184,7 @@
 * @return Array
 */
private static function wikilessScripts() {
-   return array( 'addwiki.php', 'nextJobDB.php', 
'mergeMessageFileList.php' );
+   return array( 'addwiki.php', 'nextJobDB.php' );
}
 
/**

Modified: trunk/tools/mwmultiversion/multiversion/MWScript.php
===
--- trunk/tools/mwmultiversion/multiversion/MWScript.php2011-08-03 
17:58:24 UTC (rev 93844)
+++ trunk/tools/mwmultiversion/multiversion/MWScript.php2011-08-03 
18:00:17 UTC (rev 93845)
@@ -36,6 +36,18 @@
$argv[0] = $matches[1]; // make first arg the script file name
}
 
+   # For addwiki.php, the wiki DB doesn't yet exist, and for some
+   # other maintenance scripts we don't care what wiki DB is used...
+   $wikiless = array(
+   'maintenance/mctest.php',
+   'maintenance/addwiki.php',
+   'maintenance/nextJobDB.php'
+   );
+   if ( in_array( $relFile, $wikiless ) ) {
+   # Assumme aawiki as Maintenance.php does.
+   $argv = array_merge( array( $argv[0], --wiki=aawiki ), 
array_slice( $argv, 1 ) );
+   };
+
# MWScript.php should be in common/
require_once( dirname( __FILE__ ) . '/MWVersion.php' );
$file = getMediaWikiCli( $relFile );


___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [93846] trunk/tools/mwmultiversion/multiversion/MWMultiVersion.php

2011-08-03 Thread aaron
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93846

Revision: 93846
Author:   aaron
Date: 2011-08-03 18:22:39 + (Wed, 03 Aug 2011)
Log Message:
---
Follow-up r93845: removed unused function 

Modified Paths:
--
trunk/tools/mwmultiversion/multiversion/MWMultiVersion.php

Modified: trunk/tools/mwmultiversion/multiversion/MWMultiVersion.php
===
--- trunk/tools/mwmultiversion/multiversion/MWMultiVersion.php  2011-08-03 
18:00:17 UTC (rev 93845)
+++ trunk/tools/mwmultiversion/multiversion/MWMultiVersion.php  2011-08-03 
18:22:39 UTC (rev 93846)
@@ -179,14 +179,6 @@
putenv( 'MW_DBNAME=' . $dbname );
}
 
-   /*
-* Return a list of scripts that don't need a --wiki param (assume 
aawiki)
-* @return Array
-*/
-   private static function wikilessScripts() {
-   return array( 'addwiki.php', 'nextJobDB.php' );
-   }
-
/**
 * Load the DB from the site and lang for this wiki
 * @param $site string


___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [93847] trunk/phase3/includes

2011-08-03 Thread platonides
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93847

Revision: 93847
Author:   platonides
Date: 2011-08-03 18:25:04 + (Wed, 03 Aug 2011)
Log Message:
---
Follow-up r93258, r93266, r93266: Move the defines to Defines.php

Modified Paths:
--
trunk/phase3/includes/Defines.php
trunk/phase3/includes/GlobalFunctions.php

Modified: trunk/phase3/includes/Defines.php
===
--- trunk/phase3/includes/Defines.php   2011-08-03 18:22:39 UTC (rev 93846)
+++ trunk/phase3/includes/Defines.php   2011-08-03 18:25:04 UTC (rev 93847)
@@ -240,3 +240,12 @@
 define( 'APCOND_BLOCKED', 8 );
 define( 'APCOND_ISBOT', 9 );
 /**@}*/
+
+/**
+ * Protocol constants for wfExpandUrl()
+ */
+define( 'PROTO_HTTP', 'http://' );
+define( 'PROTO_HTTPS', 'https://' );
+define( 'PROTO_RELATIVE', '//' );
+define( 'PROTO_CURRENT', null );
+

Modified: trunk/phase3/includes/GlobalFunctions.php
===
--- trunk/phase3/includes/GlobalFunctions.php   2011-08-03 18:22:39 UTC (rev 
93846)
+++ trunk/phase3/includes/GlobalFunctions.php   2011-08-03 18:25:04 UTC (rev 
93847)
@@ -428,11 +428,6 @@
return $url;
 }
 
-define( 'PROTO_HTTP', 'http://' );
-define( 'PROTO_HTTPS', 'https://' );
-define( 'PROTO_RELATIVE', '//' );
-define( 'PROTO_CURRENT', null );
-
 /**
  * Expand a potentially local URL to a fully-qualified URL.  Assumes $wgServer
  * is correct.


___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [93848] trunk/phase3/includes/specials/SpecialTags.php

2011-08-03 Thread ialex
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93848

Revision: 93848
Author:   ialex
Date: 2011-08-03 19:42:34 + (Wed, 03 Aug 2011)
Log Message:
---
* Use local context instead of global variables
* Call Linker methods statically

Modified Paths:
--
trunk/phase3/includes/specials/SpecialTags.php

Modified: trunk/phase3/includes/specials/SpecialTags.php
===
--- trunk/phase3/includes/specials/SpecialTags.php  2011-08-03 18:25:04 UTC 
(rev 93847)
+++ trunk/phase3/includes/specials/SpecialTags.php  2011-08-03 19:42:34 UTC 
(rev 93848)
@@ -36,11 +36,10 @@
}
 
function execute( $par ) {
-   global $wgOut;
+   $out = $this-getOutput();
+   $out-setPageTitle( wfMsg( 'tags-title' ) );
+   $out-wrapWikiMsg( div class='mw-tags-intro'\n$1\n/div, 
'tags-intro' );
 
-   $wgOut-setPageTitle( wfMsg( 'tags-title' ) );
-   $wgOut-wrapWikiMsg( div class='mw-tags-intro'\n$1\n/div, 
'tags-intro' );
-
// Write the headers
$html = Xml::tags( 'tr', null, Xml::tags( 'th', null, wfMsgExt( 
'tags-tag', 'parseinline' ) ) .
Xml::tags( 'th', null, wfMsgExt( 
'tags-display-header', 'parseinline' ) ) .
@@ -59,35 +58,30 @@
$html .= $this-doTagRow( $tag, 0 );
}
 
-   $wgOut-addHTML( Xml::tags( 'table', array( 'class' = 
'wikitable mw-tags-table' ), $html ) );
+   $out-addHTML( Xml::tags( 'table', array( 'class' = 'wikitable 
mw-tags-table' ), $html ) );
}
 
function doTagRow( $tag, $hitcount ) {
-   static $sk = null, $doneTags = array();
-   if ( !$sk ) {
-   $sk = $this-getSkin();
-   }
+   static $doneTags = array();
 
if ( in_array( $tag, $doneTags ) ) {
return '';
}
 
-   global $wgLang;
-
$newRow = '';
$newRow .= Xml::tags( 'td', null, Xml::element( 'tt', null, 
$tag ) );
 
$disp = ChangeTags::tagDescription( $tag );
-   $disp .= ' (' . $sk-link( Title::makeTitle( NS_MEDIAWIKI, 
Tag-$tag ), wfMsgHtml( 'tags-edit' ) ) . ')';
+   $disp .= ' (' . Linker::link( Title::makeTitle( NS_MEDIAWIKI, 
Tag-$tag ), wfMsgHtml( 'tags-edit' ) ) . ')';
$newRow .= Xml::tags( 'td', null, $disp );
 
$msg = wfMessage( tag-$tag-description );
$desc = !$msg-exists() ? '' : $msg-parse();
-   $desc .= ' (' . $sk-link( Title::makeTitle( NS_MEDIAWIKI, 
Tag-$tag-description ), wfMsgHtml( 'tags-edit' ) ) . ')';
+   $desc .= ' (' . Linker::link( Title::makeTitle( NS_MEDIAWIKI, 
Tag-$tag-description ), wfMsgHtml( 'tags-edit' ) ) . ')';
$newRow .= Xml::tags( 'td', null, $desc );
 
-   $hitcount = wfMsgExt( 'tags-hitcount', array( 'parsemag' ), 
$wgLang-formatNum( $hitcount ) );
-   $hitcount = $sk-link( SpecialPage::getTitleFor( 
'Recentchanges' ), $hitcount, array(), array( 'tagfilter' = $tag ) );
+   $hitcount = wfMsgExt( 'tags-hitcount', array( 'parsemag' ), 
$this-getLang()-formatNum( $hitcount ) );
+   $hitcount = Linker::link( SpecialPage::getTitleFor( 
'Recentchanges' ), $hitcount, array(), array( 'tagfilter' = $tag ) );
$newRow .= Xml::tags( 'td', null, $hitcount );
 
$doneTags[] = $tag;


___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [93850] trunk/phase3/includes/SkinTemplate.php

2011-08-03 Thread ialex
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93850

Revision: 93850
Author:   ialex
Date: 2011-08-03 19:59:33 + (Wed, 03 Aug 2011)
Log Message:
---
Just call $wgOut-parse() instead of doing a lot of things to call 
$wgParser-parse()

Modified Paths:
--
trunk/phase3/includes/SkinTemplate.php

Modified: trunk/phase3/includes/SkinTemplate.php
===
--- trunk/phase3/includes/SkinTemplate.php  2011-08-03 19:44:07 UTC (rev 
93849)
+++ trunk/phase3/includes/SkinTemplate.php  2011-08-03 19:59:33 UTC (rev 
93850)
@@ -1337,12 +1337,10 @@
 * @private
 */
function msgWiki( $str ) {
-   global $wgParser, $wgOut;
+   global $wgOut;
 
$text = $this-translator-translate( $str );
-   $parserOutput = $wgParser-parse( $text, $wgOut-getTitle(),
-   $wgOut-parserOptions(), true );
-   echo $parserOutput-getText();
+   echo $wgOut-parse( $text );
}
 
/**


___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [93851] trunk/phase3/includes/Article.php

2011-08-03 Thread platonides
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93851

Revision: 93851
Author:   platonides
Date: 2011-08-03 20:23:10 + (Wed, 03 Aug 2011)
Log Message:
---
r93683 missed return in line 1890

Modified Paths:
--
trunk/phase3/includes/Article.php

Modified: trunk/phase3/includes/Article.php
===
--- trunk/phase3/includes/Article.php   2011-08-03 19:59:33 UTC (rev 93850)
+++ trunk/phase3/includes/Article.php   2011-08-03 20:23:10 UTC (rev 93851)
@@ -1887,6 +1887,7 @@
} else {
$rev = Revision::newFromTitle( $this-getTitle(), 
$oldid );
if ( $rev === null ) {
+   wfProfileOut( __METHOD__ );
return false;
}
$text = $rev-getText();


___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [93852] trunk/extensions/Multilang

2011-08-03 Thread ialex
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93852

Revision: 93852
Author:   ialex
Date: 2011-08-03 20:28:33 + (Wed, 03 Aug 2011)
Log Message:
---
Use the ParserFirstCallInit hook instead of an extension function to register 
parser hooks

Modified Paths:
--
trunk/extensions/Multilang/Multilang.class.php
trunk/extensions/Multilang/Multilang.php

Modified: trunk/extensions/Multilang/Multilang.class.php
===
--- trunk/extensions/Multilang/Multilang.class.php  2011-08-03 20:23:10 UTC 
(rev 93851)
+++ trunk/extensions/Multilang/Multilang.class.php  2011-08-03 20:28:33 UTC 
(rev 93852)
@@ -6,12 +6,12 @@
 * Alternative text blocks
 * Index is the language code to which it corresponds
 */
-   private $text = array();
+   private static $text = array();

/**
 * Fallback language
 */
-   private $fallback = '';
+   private static $fallback = '';
 
/**
 * Register a new alternative text block
@@ -22,11 +22,11 @@
 * @param $parser Parent parser
 * @return string
 */
-   public function languageBlock( $text, $args, $parser ) {
+   public static function languageBlock( $text, $args, $parser ) {
if( isset( $args['lang'] ) ) {
$lang = strtolower( $args['lang'] );
-   $this-text[$lang] = $text;
-   $this-updateFallback( $lang );
+   self::$text[$lang] = $text;
+   self::updateFallback( $lang );
} else {
# Disaster! We *have* to know the language code, 
otherwise
# we have no idea when to show the text in question
@@ -43,11 +43,11 @@
 * @param $parser Parent parser
 * @return string
 */
-   public function outputBlock( $text, $args, $parser ) {
+   public static function outputBlock( $text, $args, $parser ) {
global $wgLang;
# Cache is varied according to interface language...
$lang = $wgLang-getCode();
-   $text = $this-getText( $lang );
+   $text = self::getText( $lang );
$output = $parser-parse( $text, $parser-getTitle(), 
$parser-getOptions(), true, false );
return $output-getText();
}
@@ -59,8 +59,8 @@
 * @param $lang Language code
 * @return string
 */
-   private function getText( $lang ) {
-   return isset( $this-text[$lang] ) ? $this-text[$lang] : 
$this-getFallback();
+   private static function getText( $lang ) {
+   return isset( self::$text[$lang] ) ? self::$text[$lang] : 
self::getFallback();
}

/**
@@ -68,8 +68,8 @@
 *
 * @return string
 */
-   private function getFallback() {
-   return isset( $this-text[$this-fallback] ) ? 
$this-text[$this-fallback] : '';
+   private static function getFallback() {
+   return isset( self::$text[self::$fallback] ) ? 
self::$text[self::$fallback] : '';
}

/**
@@ -78,19 +78,28 @@
 *
 * @param $lang Language code
 */
-   private function updateFallback( $lang ) {
+   private static function updateFallback( $lang ) {
global $wgContLang;
-   if( $this-fallback == '' || $lang == $wgContLang-getCode() ) {
-   $this-fallback = $lang;
+   if( self::$fallback == '' || $lang == $wgContLang-getCode() ) {
+   self::$fallback = $lang;
}
}
-   
+
/**
+* Set hooks on a Parser instance
+*/
+   public static function onParserFirstCallInit( $parser ) {
+   $parser-setHook( 'language', array( __CLASS__, 'languageBlock' 
) );
+   $parser-setHook( 'multilang', array( __CLASS__, 'outputBlock' 
) );
+   return true;
+   }
+
+   /**
 * Clear all internal state information
 */
-   public function clearState() {
-   $this-text = array();
-   $this-fallback = '';
+   public static function clearState() {
+   self::$text = array();
+   self::$fallback = '';
return true;
}


Modified: trunk/extensions/Multilang/Multilang.php
===
--- trunk/extensions/Multilang/Multilang.php2011-08-03 20:23:10 UTC (rev 
93851)
+++ trunk/extensions/Multilang/Multilang.php2011-08-03 20:28:33 UTC (rev 
93852)
@@ -8,28 +8,18 @@
  * @author Rob Church robc...@gmail.com
  */
  
-if( defined( 'MEDIAWIKI' ) ) {
+if( !defined( 'MEDIAWIKI' ) ) {
+   die;
+}
 
-   $wgExtensionCredits['parserhook'][] = array(
-   'path'   

[MediaWiki-CVS] SVN: [93854] trunk/tools/mwmultiversion/scripts

2011-08-03 Thread aaron
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93854

Revision: 93854
Author:   aaron
Date: 2011-08-03 20:53:58 + (Wed, 03 Aug 2011)
Log Message:
---
* Use BINDIR in new script paths
* Removed echo in mwversionsinuse

Modified Paths:
--
trunk/tools/mwmultiversion/scripts/mwversionsinuse
trunk/tools/mwmultiversion/scripts/scap

Modified: trunk/tools/mwmultiversion/scripts/mwversionsinuse
===
--- trunk/tools/mwmultiversion/scripts/mwversionsinuse  2011-08-03 20:31:20 UTC 
(rev 93853)
+++ trunk/tools/mwmultiversion/scripts/mwversionsinuse  2011-08-03 20:53:58 UTC 
(rev 93854)
@@ -1,4 +1,6 @@
 #!/bin/sh
 # Shell wrapper for the local version of multiversion/activeMWVersions.
 # This script belongs in /usr/bin/ and should be in PATH.
-echo `/usr/local/apache/common-local/multiversion/activeMWVersions $@`
+if ! /usr/local/apache/common-local/multiversion/activeMWVersions $@; then
+   exit 1
+fi

Modified: trunk/tools/mwmultiversion/scripts/scap
===
--- trunk/tools/mwmultiversion/scripts/scap 2011-08-03 20:31:20 UTC (rev 
93853)
+++ trunk/tools/mwmultiversion/scripts/scap 2011-08-03 20:53:58 UTC (rev 
93854)
@@ -9,7 +9,7 @@
exit 1
 fi
 
-mwVerDbSets=(`mwversionsinuse --home --withdb`)
+mwVerDbSets=(`$BINDIR/mwversionsinuse --home --withdb`)
 if [ -z $mwVerDbSets ]; then
echo Unable to read wikiversions.dat or it is empty.
exit 1
@@ -43,14 +43,14 @@
 $BINDIR/sync-common
 
 
-mwVerDbSets=(`mwversionsinuse --extended --withdb`)
+mwVerDbSets=(`$BINDIR/mwversionsinuse --extended --withdb`)
 # Regenerate the extension message file list for all active MediaWiki versions
 for i in ${mwVerDbSets[@]}
 do
mwVerNum=${i%=*}
mwDbName=${i#*=}
echo Updating ExtensionMessages-$mwVerNum.php...
-   mwscript mergeMessageFileList.php --wiki=$mwDbName \
+   $BINDIR/mwscript mergeMessageFileList.php --wiki=$mwDbName \
--list-file=$SOURCE/wmf-config/extension-list \
--output=$SOURCE/wmf-config/ExtensionMessages-$mwVerNum.php
 done


___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [93856] trunk/extensions/ArchiveLinks/ApiQueryArchiveFeed.php

2011-08-03 Thread kbrown
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93856

Revision: 93856
Author:   kbrown
Date: 2011-08-03 21:42:43 + (Wed, 03 Aug 2011)
Log Message:
---
Add archive feed API list module for external archival services.

Added Paths:
---
trunk/extensions/ArchiveLinks/ApiQueryArchiveFeed.php

Added: trunk/extensions/ArchiveLinks/ApiQueryArchiveFeed.php
===
--- trunk/extensions/ArchiveLinks/ApiQueryArchiveFeed.php   
(rev 0)
+++ trunk/extensions/ArchiveLinks/ApiQueryArchiveFeed.php   2011-08-03 
21:42:43 UTC (rev 93856)
@@ -0,0 +1,72 @@
+?php
+
+class ApiQueryArchiveFeed extends ApiQueryBase {
+   function __construct ( $query, $moduleName ) {
+   parent::__construct( $query, $moduleName, 'al' );
+   }
+   
+   public function execute ( ) {
+   $params = $this-extractRequestParams();
+   
+   $this-addTables( 'el_archive_queue' );
+   $this-addFields( '*' );
+   $this-addWhereRange( 'insertion_time', $params['dir'], 
$params['start'], $params['end'] );
+   $this-addOption( 'LIMIT', $params['limit'] + 1 );
+   
+   $res = $this-select( __METHOD__ );
+   
+   $val = array( );
+   $count = 0;
+   $result = $this-getResult();
+   
+   foreach ( $res as $row ) {
+   //much of this is stolen from ApiQueryRecentChanges
+   if ( ++ $count  $params['limit'] ) {
+   $this-setContinueEnumParameter( 'start', 
wfTimestamp( TS_UNIX, $row-insertion_time ) );
+   break;
+   }
+   
+   $val['time'] = $row-insertion_time;
+$val['page_id'] = $row-page_id;
+$val['url'] = $row-url;
+
+   $fit = $result-addValue( array( 'query', 
$this-getModuleName() ), null, $val );
+   
+   if ( !$fit ) {
+   $this-setContinueEnumParameter( 'start', 
wfTimestamp( TS_UNIX, $row-insertion_time ) );
+   break;
+   }
+   }
+
+   $result = $result-setIndexedTagName_internal( array( 'query', 
$this-getModuleName() ), 'al' );
+   }
+   
+   function getVersion() {
+   return __CLASS__;
+   }
+   
+   function getAllowedParams() {
+   return array(
+   'limit' = array(
+   ApiBase::PARAM_DFLT = 10,
+   ApiBase::PARAM_TYPE = 'limit',
+   ApiBase::PARAM_MIN = 1,
+   ApiBase::PARAM_MAX = ApiBase::LIMIT_BIG1,
+   ApiBase::PARAM_MAX2 = ApiBase::LIMIT_BIG2
+   ),
+   'start' = array(
+   ApiBase::PARAM_TYPE = 'timestamp'
+   ),
+   'end' = array(
+   ApiBase::PARAM_TYPE = 'timestamp'
+   ),
+   'dir' = array(
+   ApiBase::PARAM_DFLT = 'older',
+   ApiBase::PARAM_TYPE = array(
+   'newer',
+   'older'
+   )
+   )
+   );
+   }
+}
\ No newline at end of file


___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [93857] trunk/extensions/ArchiveLinks/ApiQueryArchiveFeed.php

2011-08-03 Thread kbrown
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93857

Revision: 93857
Author:   kbrown
Date: 2011-08-03 21:44:13 + (Wed, 03 Aug 2011)
Log Message:
---
fix EOL style from r83856.

Modified Paths:
--
trunk/extensions/ArchiveLinks/ApiQueryArchiveFeed.php

Property Changed:

trunk/extensions/ArchiveLinks/ApiQueryArchiveFeed.php

Modified: trunk/extensions/ArchiveLinks/ApiQueryArchiveFeed.php
===
--- trunk/extensions/ArchiveLinks/ApiQueryArchiveFeed.php   2011-08-03 
21:42:43 UTC (rev 93856)
+++ trunk/extensions/ArchiveLinks/ApiQueryArchiveFeed.php   2011-08-03 
21:44:13 UTC (rev 93857)
@@ -1,72 +1,72 @@
-?php
-
-class ApiQueryArchiveFeed extends ApiQueryBase {
-   function __construct ( $query, $moduleName ) {
-   parent::__construct( $query, $moduleName, 'al' );
-   }
-   
-   public function execute ( ) {
-   $params = $this-extractRequestParams();
-   
-   $this-addTables( 'el_archive_queue' );
-   $this-addFields( '*' );
-   $this-addWhereRange( 'insertion_time', $params['dir'], 
$params['start'], $params['end'] );
-   $this-addOption( 'LIMIT', $params['limit'] + 1 );
-   
-   $res = $this-select( __METHOD__ );
-   
-   $val = array( );
-   $count = 0;
-   $result = $this-getResult();
-   
-   foreach ( $res as $row ) {
-   //much of this is stolen from ApiQueryRecentChanges
-   if ( ++ $count  $params['limit'] ) {
-   $this-setContinueEnumParameter( 'start', 
wfTimestamp( TS_UNIX, $row-insertion_time ) );
-   break;
-   }
-   
-   $val['time'] = $row-insertion_time;
-$val['page_id'] = $row-page_id;
-$val['url'] = $row-url;
-
-   $fit = $result-addValue( array( 'query', 
$this-getModuleName() ), null, $val );
-   
-   if ( !$fit ) {
-   $this-setContinueEnumParameter( 'start', 
wfTimestamp( TS_UNIX, $row-insertion_time ) );
-   break;
-   }
-   }
-
-   $result = $result-setIndexedTagName_internal( array( 'query', 
$this-getModuleName() ), 'al' );
-   }
-   
-   function getVersion() {
-   return __CLASS__;
-   }
-   
-   function getAllowedParams() {
-   return array(
-   'limit' = array(
-   ApiBase::PARAM_DFLT = 10,
-   ApiBase::PARAM_TYPE = 'limit',
-   ApiBase::PARAM_MIN = 1,
-   ApiBase::PARAM_MAX = ApiBase::LIMIT_BIG1,
-   ApiBase::PARAM_MAX2 = ApiBase::LIMIT_BIG2
-   ),
-   'start' = array(
-   ApiBase::PARAM_TYPE = 'timestamp'
-   ),
-   'end' = array(
-   ApiBase::PARAM_TYPE = 'timestamp'
-   ),
-   'dir' = array(
-   ApiBase::PARAM_DFLT = 'older',
-   ApiBase::PARAM_TYPE = array(
-   'newer',
-   'older'
-   )
-   )
-   );
-   }
+?php
+
+class ApiQueryArchiveFeed extends ApiQueryBase {
+   function __construct ( $query, $moduleName ) {
+   parent::__construct( $query, $moduleName, 'al' );
+   }
+   
+   public function execute ( ) {
+   $params = $this-extractRequestParams();
+   
+   $this-addTables( 'el_archive_queue' );
+   $this-addFields( '*' );
+   $this-addWhereRange( 'insertion_time', $params['dir'], 
$params['start'], $params['end'] );
+   $this-addOption( 'LIMIT', $params['limit'] + 1 );
+   
+   $res = $this-select( __METHOD__ );
+   
+   $val = array( );
+   $count = 0;
+   $result = $this-getResult();
+   
+   foreach ( $res as $row ) {
+   //much of this is stolen from ApiQueryRecentChanges
+   if ( ++ $count  $params['limit'] ) {
+   $this-setContinueEnumParameter( 'start', 
wfTimestamp( TS_UNIX, $row-insertion_time ) );
+   break;
+   }
+   
+   $val['time'] = $row-insertion_time;
+$val['page_id'] 

[MediaWiki-CVS] SVN: [93858] trunk/phase3/includes

2011-08-03 Thread aaron
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93858

Revision: 93858
Author:   aaron
Date: 2011-08-03 22:08:24 + (Wed, 03 Aug 2011)
Log Message:
---
Reverted r91942,r91943,r91949,r92156 per CR

Modified Paths:
--
trunk/phase3/includes/Wiki.php
trunk/phase3/includes/specials/SpecialEditWatchlist.php

Modified: trunk/phase3/includes/Wiki.php
===
--- trunk/phase3/includes/Wiki.php  2011-08-03 21:44:13 UTC (rev 93857)
+++ trunk/phase3/includes/Wiki.php  2011-08-03 22:08:24 UTC (rev 93858)
@@ -277,21 +277,21 @@
 
// Check for disabled actions
if ( in_array( $action, $wgDisabledActions ) ) {
-   $action = 'nosuchaction';
-   } elseif ( $action === 'historysubmit' ) {
-   // Workaround for bug #20966: inability of IE to 
provide an action dependent
-   // on which submit button is clicked.
+   return 'nosuchaction';
+   }
+
+   // Workaround for bug #20966: inability of IE to provide an 
action dependent
+   // on which submit button is clicked.
+   if ( $action === 'historysubmit' ) {
if ( $request-getBool( 'revisiondelete' ) ) {
-   $action = 'revisiondelete';
+   return 'revisiondelete';
} else {
-   $action = 'view';
+   return 'view';
}
} elseif ( $action == 'editredlink' ) {
-   $action = 'edit';
+   return 'edit';
}
 
-   // Write back the executed action
-   $request-setVal( 'action', $action );
return $action;
}
 
@@ -512,7 +512,6 @@
break;
default:
if ( wfRunHooks( 'UnknownAction', array( $act, 
$article ) ) ) {
-   $request-setVal( 'action', 
'nosuchaction' );
$output-showErrorPage( 'nosuchaction', 
'nosuchactiontext' );
}
}

Modified: trunk/phase3/includes/specials/SpecialEditWatchlist.php
===
--- trunk/phase3/includes/specials/SpecialEditWatchlist.php 2011-08-03 
21:44:13 UTC (rev 93857)
+++ trunk/phase3/includes/specials/SpecialEditWatchlist.php 2011-08-03 
22:08:24 UTC (rev 93858)
@@ -485,9 +485,7 @@
 * @return int
 */
public static function getMode( $request, $par ) {
-   $act  = $request-getVal( 'action' );
-   $mode = ( $act == 'view' ) ? $par : $act;
-   $mode = strtolower( $mode );
+   $mode = strtolower( $request-getVal( 'action', $par ) );
switch( $mode ) {
case 'clear':
case self::EDIT_CLEAR:


___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [93859] trunk/extensions/RecordAdmin

2011-08-03 Thread nad
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93859

Revision: 93859
Author:   nad
Date: 2011-08-03 22:19:21 + (Wed, 03 Aug 2011)
Log Message:
---
no double escape on quote now that JS in its own file

Modified Paths:
--
trunk/extensions/RecordAdmin/RecordAdmin_body.php
trunk/extensions/RecordAdmin/recordadmin.js

Modified: trunk/extensions/RecordAdmin/RecordAdmin_body.php
===
--- trunk/extensions/RecordAdmin/RecordAdmin_body.php   2011-08-03 22:08:24 UTC 
(rev 93858)
+++ trunk/extensions/RecordAdmin/RecordAdmin_body.php   2011-08-03 22:19:21 UTC 
(rev 93859)
@@ -20,7 +20,6 @@
 
# Name to use for creating a new record either via RecordAdmin 
or a public form
$this-guid();
-   
 
# Make recordID's of articles created with public forms 
available via recordid tag
$wgParser-setHook( $wgRecordAdminTag, array( $this, 
'expandTag' ) );

Modified: trunk/extensions/RecordAdmin/recordadmin.js
===
--- trunk/extensions/RecordAdmin/recordadmin.js 2011-08-03 22:08:24 UTC (rev 
93858)
+++ trunk/extensions/RecordAdmin/recordadmin.js 2011-08-03 22:19:21 UTC (rev 
93859)
@@ -9,7 +9,7 @@
var input = jQuery( inputs[k] );
if( input.attr('type') != 'checkbox' || 
input.attr('checked') ) {
var multi = input.val();
-   if( typeof( multi ) == 'object' ) multi 
= multi.join('\\n');
+   if( typeof( multi ) == 'object' ) multi 
= multi.join('\n');
var key = type + ':' + 
inputs[k].getAttribute('name');
var hidden = jQuery( 
document.createElement( 'input' ) );
hidden.attr( 'name', key );


___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [93860] trunk/phase3/includes

2011-08-03 Thread aaron
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93860

Revision: 93860
Author:   aaron
Date: 2011-08-03 22:37:20 + (Wed, 03 Aug 2011)
Log Message:
---
* Refactored SpecialUndelete::revDeleteLink into a Linker::getRevDeleteLink 
function
* (bug 21279) Updated DeletedContributions to use type=revision when possible 
(ar_rev_id exists)

Modified Paths:
--
trunk/phase3/includes/Linker.php
trunk/phase3/includes/specials/SpecialDeletedContributions.php
trunk/phase3/includes/specials/SpecialUndelete.php

Modified: trunk/phase3/includes/Linker.php
===
--- trunk/phase3/includes/Linker.php2011-08-03 22:19:21 UTC (rev 93859)
+++ trunk/phase3/includes/Linker.php2011-08-03 22:37:20 UTC (rev 93860)
@@ -1769,6 +1769,50 @@
}
 
/**
+* Get a revision-deletion link, or disabled link, or nothing, depending
+* on user permissions  the settings on the revision.
+*
+* Will use forward-compatible revision ID in the Special:RevDelete link
+* if possible, otherwise the timestamp-based ID which may break after
+* undeletion.
+*
+* @param User $user
+* @param Revision $rev
+* @param Revision $title
+* @return string HTML fragment
+*/
+   public static function getRevDeleteLink( User $user, Revision $rev, 
Title $title ) {
+   $canHide = $user-isAllowed( 'deleterevision' );
+   if ( $canHide || ( $rev-getVisibility()  $user-isAllowed( 
'deletedhistory' ) ) ) {
+   if( !$rev-userCan( Revision::DELETED_RESTRICTED ) ) {
+   $revdlink = Linker::revDeleteLinkDisabled( 
$canHide ); // revision was hidden from sysops
+   } else {
+   if ( $rev-getId() ) {
+   // RevDelete links using revision ID 
are stable across
+   // page deletion and undeletion; use 
when possible.
+   $query = array(
+   'type'   = 'revision',
+   'target' = 
$title-getPrefixedDBkey(),
+   'ids'= $rev-getId()
+   );
+   } else {
+   // Older deleted entries didn't save a 
revision ID.
+   // We have to refer to these by 
timestamp, ick!
+   $query = array(
+   'type'   = 'archive',
+   'target' = 
$title-getPrefixedDBkey(),
+   'ids'= $rev-getTimestamp()
+   );
+   }
+   return Linker::revDeleteLink( $query,
+   $rev-isDeleted( 
File::DELETED_RESTRICTED ), $canHide );
+   }
+   } else {
+   return '';
+   }
+   }
+
+   /**
 * Creates a (show/hide) link for deleting revisions/log entries
 *
 * @param $query Array: query parameters to be passed to link()
@@ -2003,4 +2047,3 @@
return call_user_func_array( array( 'Linker', $fname ), $args );
}
 }
-

Modified: trunk/phase3/includes/specials/SpecialDeletedContributions.php
===
--- trunk/phase3/includes/specials/SpecialDeletedContributions.php  
2011-08-03 22:19:21 UTC (rev 93859)
+++ trunk/phase3/includes/specials/SpecialDeletedContributions.php  
2011-08-03 22:37:20 UTC (rev 93860)
@@ -213,21 +213,8 @@
}
 
// Revision delete link
-   $canHide = $wgUser-isAllowed( 'deleterevision' );
-   if( $canHide || ($rev-getVisibility()  
$wgUser-isAllowed('deletedhistory')) ) {
-   if( !$rev-userCan( Revision::DELETED_RESTRICTED ) ) {
-   $del = $this-mSkin-revDeleteLinkDisabled( 
$canHide ); // revision was hidden from sysops
-   } else {
-   $query = array(
-   'type' = 'archive',
-   'target' = $page-getPrefixedDbkey(),
-   'ids' = $rev-getTimestamp() );
-   $del = $this-mSkin-revDeleteLink( $query,
-   $rev-isDeleted( 
Revision::DELETED_RESTRICTED ), $canHide ) . ' ';
-   }
-   } else {
-   $del = '';
-   }
+   $del = 

[MediaWiki-CVS] SVN: [93861] USERINFO/ben

2011-08-03 Thread root
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93861

Revision: 93861
Author:   root
Date: 2011-08-03 23:12:39 + (Wed, 03 Aug 2011)
Log Message:
---
added a description of myself

Added Paths:
---
USERINFO/ben

Added: USERINFO/ben
===
--- USERINFO/ben(rev 0)
+++ USERINFO/ben2011-08-03 23:12:39 UTC (rev 93861)
@@ -0,0 +1,5 @@
+name: Ben Hartshorne
+email: bhartsho...@wikimedia.org
+languages spoken: English
+irc: maplebed
+since: 2011-07-25


___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [93862] trunk/parsers/wikidom

2011-08-03 Thread inez
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93862

Revision: 93862
Author:   inez
Date: 2011-08-03 23:14:08 + (Wed, 03 Aug 2011)
Log Message:
---
Add JSON view to the new demo

Modified Paths:
--
trunk/parsers/wikidom/demos/es/index2.html
trunk/parsers/wikidom/lib/es/es.ParagraphBlock.js

Added Paths:
---
trunk/parsers/wikidom/lib/FormatJSON.js

Modified: trunk/parsers/wikidom/demos/es/index2.html
===
--- trunk/parsers/wikidom/demos/es/index2.html  2011-08-03 23:12:39 UTC (rev 
93861)
+++ trunk/parsers/wikidom/demos/es/index2.html  2011-08-03 23:14:08 UTC (rev 
93862)
@@ -39,7 +39,7 @@
width: 95%;
margin: auto;
}
-   #wikitext-source {
+   .source {
min-height: 150px; 
margin: 0;
padding: 1em;
@@ -69,13 +69,16 @@
td width=50%
div id=source-wrapper
h3Wikitext Source/h3
-   div id=wikitext-source/div
+   div id=wikitext-source 
class=source/div
+   h3JSON Source/h3
+   div id=json-source 
class=source/div
/div  
/td   
/tr   
/table
 
script type=text/javascript 
src=../../lib/jquery.js/script
+   script type=text/javascript 
src=../../lib/jquery.json.js/script
script type=text/javascript 
src=../../lib/es/es.js/script
script type=text/javascript 
src=../../lib/es/es.EventEmitter.js/script
script type=text/javascript 
src=../../lib/es/es.Position.js/script
@@ -93,7 +96,7 @@
script type=text/javascript 
src=../../lib/es/es.ListBlockItem.js/script
script type=text/javascript 
src=../../lib/es/es.ListBlock.js/script
script type=text/javascript 
src=../../lib/es/es.Cursor.js/script
-
+   script type=text/javascript 
src=../../lib/FormatJSON.js/script
script src=../../lib/wiki.js type=text/javascript/script
script src=../../lib/wiki.util.js 
type=text/javascript/script
script src=../../lib/wiki.AnnotationRenderer.js 
type=text/javascript/script
@@ -317,8 +320,9 @@
clearTimeout( previewTimeout );
}
previewTimeout = setTimeout( function 
() {
-   
console.log(doc.getWikiDomDocument());
-   $( '#wikitext-source' ).text( 
wikitextRenderer.render( doc.getWikiDomDocument() ) );
+   var data = 
doc.getWikiDomDocument();
+   $( '#wikitext-source' ).text( 
wikitextRenderer.render( data ) );
+   $( '#json-source' ).text( 
FormatJSON( data ) ); 
}, 100 );
} );
 

Added: trunk/parsers/wikidom/lib/FormatJSON.js
===
--- trunk/parsers/wikidom/lib/FormatJSON.js (rev 0)
+++ trunk/parsers/wikidom/lib/FormatJSON.js 2011-08-03 23:14:08 UTC (rev 
93862)
@@ -0,0 +1,81 @@
+function RealTypeOf(v) {
+   if (typeof (v) == object) {
+   if (v === null) return null;
+   if (v.constructor == (new Array).constructor) return array;
+   if (v.constructor == (new Date).constructor) return date;
+   if (v.constructor == (new RegExp).constructor) return regex;
+   return object;
+   }
+   return typeof (v);
+}
+function FormatJSON(oData, sIndent) {
+   if (arguments.length  2) {
+   var sIndent = ;
+   }
+   var sIndentStyle = ;
+   var sDataType = RealTypeOf(oData);
+
+   // open object
+   if (sDataType == array) {
+   if (oData.length == 0) {
+   return [];
+   }
+   var sHTML = [;
+   } else {
+   var iCount = 0;
+   $.each(oData, function () {
+   iCount++;
+   return;
+   });
+   if (iCount == 0) { // object is empty
+   return {};
+   }
+   var sHTML = {;
+   }
+
+  

[MediaWiki-CVS] SVN: [93863] USERINFO/ben

2011-08-03 Thread root
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93863

Revision: 93863
Author:   root
Date: 2011-08-03 23:16:14 + (Wed, 03 Aug 2011)
Log Message:
---
whitespace change

Modified Paths:
--
USERINFO/ben

Modified: USERINFO/ben
===
--- USERINFO/ben2011-08-03 23:14:08 UTC (rev 93862)
+++ USERINFO/ben2011-08-03 23:16:14 UTC (rev 93863)
@@ -3,3 +3,4 @@
 languages spoken: English
 irc: maplebed
 since: 2011-07-25
+


___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [93864] USERINFO/ben

2011-08-03 Thread ben
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93864

Revision: 93864
Author:   ben
Date: 2011-08-03 23:17:10 + (Wed, 03 Aug 2011)
Log Message:
---
whitespace change

Modified Paths:
--
USERINFO/ben

Modified: USERINFO/ben
===
--- USERINFO/ben2011-08-03 23:16:14 UTC (rev 93863)
+++ USERINFO/ben2011-08-03 23:17:10 UTC (rev 93864)
@@ -3,4 +3,3 @@
 languages spoken: English
 irc: maplebed
 since: 2011-07-25
-


___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [93865] USERINFO/ben

2011-08-03 Thread demon
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93865

Revision: 93865
Author:   demon
Date: 2011-08-03 23:23:30 + (Wed, 03 Aug 2011)
Log Message:
---
eol-style

Property Changed:

USERINFO/ben


Property changes on: USERINFO/ben
___
Added: svn:eol-style
   + native


___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [93866] trunk/parsers/wikidom

2011-08-03 Thread inez
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93866

Revision: 93866
Author:   inez
Date: 2011-08-03 23:26:17 + (Wed, 03 Aug 2011)
Log Message:
---
Use xlinks and ilinks instead of links

Modified Paths:
--
trunk/parsers/wikidom/demos/es/index.html
trunk/parsers/wikidom/demos/es/index2.html
trunk/parsers/wikidom/lib/es/es.Content.js
trunk/parsers/wikidom/lib/wiki.WikitextRenderer.js

Modified: trunk/parsers/wikidom/demos/es/index.html
===
--- trunk/parsers/wikidom/demos/es/index.html   2011-08-03 23:23:30 UTC (rev 
93865)
+++ trunk/parsers/wikidom/demos/es/index.html   2011-08-03 23:26:17 UTC (rev 
93866)
@@ -86,8 +86,8 @@
{ 
'type': 'italic', 'range': { 'start': 17, 'end': 26 } },
// 
wrap is should be a link to #
{
-   
'type': 'link',
-   
'data': { 'href': './' },
+   
'type': 'xlink',
+   
'data': { 'href': '#' },

'range': { 'start': 22, 'end': 29 }
},
]
@@ -202,7 +202,7 @@
'text': 
'Fourth item',

'annotations': [

{
-   
'type': 'link',
+   
'type': 'ilink',

'range': {

'start': 7,

'end': 11
@@ -269,7 +269,7 @@
} );
$( '#es-toolbar-link' ).click( function() {
surface.annotateContent( 'toggle', {
-   'type': 'link',
+   'type': 'xlink',
'data': { 'href': '#' }
} );
return false;

Modified: trunk/parsers/wikidom/demos/es/index2.html
===
--- trunk/parsers/wikidom/demos/es/index2.html  2011-08-03 23:23:30 UTC (rev 
93865)
+++ trunk/parsers/wikidom/demos/es/index2.html  2011-08-03 23:26:17 UTC (rev 
93866)
@@ -119,8 +119,8 @@
{ 
'type': 'italic', 'range': { 'start': 17, 'end': 26 } },
// 
wrap is should be a link to #
{
-   
'type': 'link',
-   
'data': { 'href': './' },
+   
'type': 'xlink',
+   
'data': { 'href': '#' },

'range': { 'start': 22, 'end': 29 }
},
]
@@ -303,7 +303,7 @@
} );
$( '#es-toolbar-link' ).click( function() {
surface.annotateContent( 'toggle', {
-   'type': 'link',
+   'type': 'xlink',
'data': { 'href': '#' }
} );
return false;

Modified: trunk/parsers/wikidom/lib/es/es.Content.js
===
--- 

[MediaWiki-CVS] SVN: [93867] trunk/debs/wikimedia-task-dns-auth

2011-08-03 Thread ben
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93867

Revision: 93867
Author:   ben
Date: 2011-08-03 23:29:08 + (Wed, 03 Aug 2011)
Log Message:
---
moving the subversion repository for dns template from localhost to sockpuppet

Modified Paths:
--
trunk/debs/wikimedia-task-dns-auth/authdns-update
trunk/debs/wikimedia-task-dns-auth/debian/control

Modified: trunk/debs/wikimedia-task-dns-auth/authdns-update
===
--- trunk/debs/wikimedia-task-dns-auth/authdns-update   2011-08-03 23:26:17 UTC 
(rev 93866)
+++ trunk/debs/wikimedia-task-dns-auth/authdns-update   2011-08-03 23:29:08 UTC 
(rev 93867)
@@ -17,7 +17,7 @@
 LANGLISTSOURCE=
 DBLIST=$POWERDNSDIR/all.dblist
 DBLISTSOURCE=
-SVNROOT=file:///var/lib/svnroot
+SVNROOT=svn+ssh://sockpuppet.pmtpa.wmnet/svnroot/configuration
 REPONAME=pdns-templates
 
 PATH=/bin:/usr/bin:/usr/local/bin

Modified: trunk/debs/wikimedia-task-dns-auth/debian/control
===
--- trunk/debs/wikimedia-task-dns-auth/debian/control   2011-08-03 23:26:17 UTC 
(rev 93866)
+++ trunk/debs/wikimedia-task-dns-auth/debian/control   2011-08-03 23:29:08 UTC 
(rev 93867)
@@ -7,7 +7,12 @@
 
 Package: wikimedia-task-dns-auth
 Architecture: all
-Depends: pdns-server (= 2.9.22), pdns-backend-geo (= 2.9.22), 
pdns-backend-pipe (= 2.9.22), python, rsync
+Depends: pdns-server (= 2.9.22),
+pdns-backend-geo (= 2.9.22),
+pdns-backend-pipe (= 2.9.22),
+python,
+rsync,
+subversion
 Description: Provides a Wikimedia authoritative DNS server
  Package wikimedia-task-dns-auth depends on the appropriate packages
  that need to be installed on a Wikimedia authoritative DNS server,


___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [93868] trunk/debs/wikimedia-task-dns-auth/authdns-update

2011-08-03 Thread ben
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93868

Revision: 93868
Author:   ben
Date: 2011-08-03 23:33:23 + (Wed, 03 Aug 2011)
Log Message:
---
adding protection against running the script without a valid ssh agent

Modified Paths:
--
trunk/debs/wikimedia-task-dns-auth/authdns-update

Modified: trunk/debs/wikimedia-task-dns-auth/authdns-update
===
--- trunk/debs/wikimedia-task-dns-auth/authdns-update   2011-08-03 23:29:08 UTC 
(rev 93867)
+++ trunk/debs/wikimedia-task-dns-auth/authdns-update   2011-08-03 23:33:23 UTC 
(rev 93868)
@@ -38,6 +38,14 @@
shift
 done
 
+if ssh-add -l/dev/null 21
+then
+echo Found your ssh agent.
+else
+echo Can't contact your ssh agent.  You must forward your ssh agent to 
use this script.
+exit 2
+fi
+
 echo Will skip slave(s) $SKIP.
 
 # export the current templates from svn


___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [93869] trunk/debs/wikimedia-base

2011-08-03 Thread ben
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93869

Revision: 93869
Author:   ben
Date: 2011-08-04 00:50:47 + (Thu, 04 Aug 2011)
Log Message:
---
removing vimrc.local from this package and putting it in puppet instead for 
easier editing and better config standardization.

Modified Paths:
--
trunk/debs/wikimedia-base/debian/conffiles
trunk/debs/wikimedia-base/debian/rules

Removed Paths:
-
trunk/debs/wikimedia-base/vimrc.local

Modified: trunk/debs/wikimedia-base/debian/conffiles
===
--- trunk/debs/wikimedia-base/debian/conffiles  2011-08-03 23:33:23 UTC (rev 
93868)
+++ trunk/debs/wikimedia-base/debian/conffiles  2011-08-04 00:50:47 UTC (rev 
93869)
@@ -1 +0,0 @@
-/etc/vim/vimrc.local

Modified: trunk/debs/wikimedia-base/debian/rules
===
--- trunk/debs/wikimedia-base/debian/rules  2011-08-03 23:33:23 UTC (rev 
93868)
+++ trunk/debs/wikimedia-base/debian/rules  2011-08-04 00:50:47 UTC (rev 
93869)
@@ -60,8 +60,6 @@
install -d $(CURDIR)/debian/wikimedia-base/usr/share/doc/wikimedia-base
install -m 0644 apt_preferences 
$(CURDIR)/debian/wikimedia-base/usr/share/doc/wikimedia-base/apt_preferences
install -m 0644 sysctl.conf 
$(CURDIR)/debian/wikimedia-base/usr/share/doc/wikimedia-base/sysctl.conf
-   install -d $(CURDIR)/debian/wikimedia-base/etc/vim
-   install -m 0644 vimrc.local 
$(CURDIR)/debian/wikimedia-base/etc/vim/vimrc.local
 
 # Build architecture-independent files here.
 binary-indep: build install

Deleted: trunk/debs/wikimedia-base/vimrc.local
===
--- trunk/debs/wikimedia-base/vimrc.local   2011-08-03 23:33:23 UTC (rev 
93868)
+++ trunk/debs/wikimedia-base/vimrc.local   2011-08-04 00:50:47 UTC (rev 
93869)
@@ -1,19 +0,0 @@
-if t_Co  2 || has(gui_running)
-  syntax on
-  set hlsearch
-endif
-
-colo murphy
-set viminfo='50,%,:50
-set backup writebackup
-filetype plugin indent on
-
- Only do this part when compiled with support for autocommands
-if has(autocmd)
-   When editing a file, always jump to the last cursor position
-  autocmd BufReadPost *
-  \ if line('\)  0  line ('\) = line($) |
-  \   exe normal! g'\ |
-  \ endif
-endif
-


___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [93870] trunk/extensions/Favorites

2011-08-03 Thread jlemley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93870

Revision: 93870
Author:   jlemley
Date: 2011-08-04 00:57:36 + (Thu, 04 Aug 2011)
Log Message:
---
Added parser argument. Fixed formatting. Fixed edit page count.

Modified Paths:
--
trunk/extensions/Favorites/FavParser.php
trunk/extensions/Favorites/FavoritedItem.php
trunk/extensions/Favorites/FavoritelistEditor.php
trunk/extensions/Favorites/Favorites.php
trunk/extensions/Favorites/SpecialFavoritelist.php
trunk/extensions/Favorites/favorites.i18n.php

Modified: trunk/extensions/Favorites/FavParser.php
===
--- trunk/extensions/Favorites/FavParser.php2011-08-04 00:50:47 UTC (rev 
93869)
+++ trunk/extensions/Favorites/FavParser.php2011-08-04 00:57:36 UTC (rev 
93870)
@@ -2,58 +2,66 @@
 
 class FavParser {
 
-function wfSpecialFavoritelist() {
+   function wfSpecialFavoritelist($argv, $parser) {
+   
+   global $wgUser, $wgOut, $wgLang, $wgRequest;
+   global $wgRCShowFavoritingUsers, $wgEnotifFavoritelist, 
$wgShowUpdatedMarker;
+   $output = '';

-   global $wgUser, $wgOut, $wgLang, $wgRequest;
-   global $wgRCShowFavoritingUsers, $wgEnotifFavoritelist, 
$wgShowUpdatedMarker;
-   $output = '';
-
-   $skin = $wgUser-getSkin();
-   $specialTitle = SpecialPage::getTitleFor( 'Favoritelist' );
-   //$wgOut-setRobotPolicy( 'noindex,nofollow' );
-
-   # Anons don't get a favoritelist
-   if( $wgUser-isAnon() ) {
-   //$wgOut-setPageTitle( wfMsg( 'favoritenologin' ) );
-   $llink = $skin-linkKnown(
-   SpecialPage::getTitleFor( 'Userlogin' ), 
-   wfMsg( 'loginreqlink' ),
-   array(),
-   array( 'returnto' = $specialTitle-getPrefixedText() )
-   );
-   $output = wfMsgHtml( 'favoritelistanontext', $llink ) ;
+   $skin = $wgUser-getSkin();
+   $specialTitle = SpecialPage::getTitleFor( 'Favoritelist' );
+   //$wgOut-setRobotPolicy( 'noindex,nofollow' );
+   
+   # Anons don't get a favoritelist
+   if( $wgUser-isAnon() ) {
+   //$wgOut-setPageTitle( wfMsg( 'favoritenologin' ) );
+   $llink = $skin-linkKnown(
+   SpecialPage::getTitleFor( 'Userlogin' ), 
+   wfMsg( 'loginreqlink' ),
+   array(),
+   array( 'returnto' = 
$specialTitle-getPrefixedText() )
+   );
+   $output = wfMsgHtml( 'favoritelistanontext', $llink ) ;
+   
+   
+   return $output ;
+   
+   }
+   
+   $output = $this-viewFavList($wgUser, $output, $wgRequest);
+   if ( array_key_exists('editlink', $argv)  $argv['editlink']) {
+   # Add an edit link if you want it:
+   $output .= div id='contentSub'br . 
+   $skin-link(
+   SpecialPage::getTitleFor( 
'Favoritelist', 'edit' ),
+   wfMsgHtml( favoritelisttools-edit ),
+   array(),
+   array(),
+   array( 'known', 'noclasses' )
+   ) . /div;
+   }
+   
return $output ;
-   
}
 
-
-

-   $output = $this-viewFavList($wgUser, $output, $wgRequest);
-   return $output ;
-}
-
-   
private function viewFavList ($user, $output, $request) {
-   global $wgUser, $wgOut, $wgLang, $wgRequest;
-   $uid = $wgUser-getId();
-   $output = $this-showNormalForm( $output, $user );
-
-   $dbr = wfGetDB( DB_SLAVE, 'favoritelist' );
+   global $wgUser, $wgOut, $wgLang, $wgRequest;
+   $uid = $wgUser-getId();
+   $output = $this-showNormalForm( $output, $user );

-
-   $favoritelistCount = $dbr-selectField( 'favoritelist', 'COUNT(*)',
-   array( 'fl_user' = $uid ), __METHOD__ );
-   // Adjust for page X, talk:page X, which are both stored separately,
-   // but treated together
-   $nitems = floor($favoritelistCount);
-
-   if( $nitems == 0 ) {
-   $output = wfmsg('nofavoritelist');
+   $dbr = wfGetDB( DB_SLAVE, 'favoritelist' );

+   $favoritelistCount = $dbr-selectField( 'favoritelist', 
'COUNT(*)',
+   array( 'fl_user' = $uid ), __METHOD__ );
+   $nitems = floor($favoritelistCount);
+   
+   if( $nitems == 0 ) {
+

[MediaWiki-CVS] SVN: [93871] trunk/phase3/includes/DefaultSettings.php

2011-08-03 Thread mah
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93871

Revision: 93871
Author:   mah
Date: 2011-08-04 00:57:43 + (Thu, 04 Aug 2011)
Log Message:
---
Fix bug #27132: Uncomment movefile right in default settings

Modified Paths:
--
trunk/phase3/includes/DefaultSettings.php

Modified: trunk/phase3/includes/DefaultSettings.php
===
--- trunk/phase3/includes/DefaultSettings.php   2011-08-04 00:57:36 UTC (rev 
93870)
+++ trunk/phase3/includes/DefaultSettings.php   2011-08-04 00:57:43 UTC (rev 
93871)
@@ -3351,7 +3351,7 @@
 $wgGroupPermissions['user']['move'] = true;
 $wgGroupPermissions['user']['move-subpages']= true;
 $wgGroupPermissions['user']['move-rootuserpages'] = true; // can move root 
userpages
-//$wgGroupPermissions['user']['movefile'] = true;  // Disabled for 
now due to possible bugs and security concerns
+$wgGroupPermissions['user']['movefile'] = true;
 $wgGroupPermissions['user']['read'] = true;
 $wgGroupPermissions['user']['edit'] = true;
 $wgGroupPermissions['user']['createpage']   = true;


___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [93872] branches/REL1_17/extensions/Favorites

2011-08-03 Thread jlemley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93872

Revision: 93872
Author:   jlemley
Date: 2011-08-04 01:02:33 + (Thu, 04 Aug 2011)
Log Message:
---
Fixed move and delete bugs.  Added parser argument. Fixed formatting. Fixed 
edit page count.

Modified Paths:
--
branches/REL1_17/extensions/Favorites/FavParser.php
branches/REL1_17/extensions/Favorites/FavoritedItem.php
branches/REL1_17/extensions/Favorites/FavoritelistEditor.php
branches/REL1_17/extensions/Favorites/Favorites.php
branches/REL1_17/extensions/Favorites/SpecialFavoritelist.php
branches/REL1_17/extensions/Favorites/favorites.i18n.php

Modified: branches/REL1_17/extensions/Favorites/FavParser.php
===
--- branches/REL1_17/extensions/Favorites/FavParser.php 2011-08-04 00:57:43 UTC 
(rev 93871)
+++ branches/REL1_17/extensions/Favorites/FavParser.php 2011-08-04 01:02:33 UTC 
(rev 93872)
@@ -2,58 +2,66 @@
 
 class FavParser {
 
-function wfSpecialFavoritelist() {
+   function wfSpecialFavoritelist($argv, $parser) {
+   
+   global $wgUser, $wgOut, $wgLang, $wgRequest;
+   global $wgRCShowFavoritingUsers, $wgEnotifFavoritelist, 
$wgShowUpdatedMarker;
+   $output = '';

-   global $wgUser, $wgOut, $wgLang, $wgRequest;
-   global $wgRCShowFavoritingUsers, $wgEnotifFavoritelist, 
$wgShowUpdatedMarker;
-   $output = '';
-
-   $skin = $wgUser-getSkin();
-   $specialTitle = SpecialPage::getTitleFor( 'Favoritelist' );
-   //$wgOut-setRobotPolicy( 'noindex,nofollow' );
-
-   # Anons don't get a favoritelist
-   if( $wgUser-isAnon() ) {
-   //$wgOut-setPageTitle( wfMsg( 'favoritenologin' ) );
-   $llink = $skin-linkKnown(
-   SpecialPage::getTitleFor( 'Userlogin' ), 
-   wfMsg( 'loginreqlink' ),
-   array(),
-   array( 'returnto' = $specialTitle-getPrefixedText() )
-   );
-   $output = wfMsgHtml( 'favoritelistanontext', $llink ) ;
+   $skin = $wgUser-getSkin();
+   $specialTitle = SpecialPage::getTitleFor( 'Favoritelist' );
+   //$wgOut-setRobotPolicy( 'noindex,nofollow' );
+   
+   # Anons don't get a favoritelist
+   if( $wgUser-isAnon() ) {
+   //$wgOut-setPageTitle( wfMsg( 'favoritenologin' ) );
+   $llink = $skin-linkKnown(
+   SpecialPage::getTitleFor( 'Userlogin' ), 
+   wfMsg( 'loginreqlink' ),
+   array(),
+   array( 'returnto' = 
$specialTitle-getPrefixedText() )
+   );
+   $output = wfMsgHtml( 'favoritelistanontext', $llink ) ;
+   
+   
+   return $output ;
+   
+   }
+   
+   $output = $this-viewFavList($wgUser, $output, $wgRequest);
+   if ( array_key_exists('editlink', $argv)  $argv['editlink']) {
+   # Add an edit link if you want it:
+   $output .= div id='contentSub'br . 
+   $skin-link(
+   SpecialPage::getTitleFor( 
'Favoritelist', 'edit' ),
+   wfMsgHtml( favoritelisttools-edit ),
+   array(),
+   array(),
+   array( 'known', 'noclasses' )
+   ) . /div;
+   }
+   
return $output ;
-   
}
 
-
-

-   $output = $this-viewFavList($wgUser, $output, $wgRequest);
-   return $output ;
-}
-
-   
private function viewFavList ($user, $output, $request) {
-   global $wgUser, $wgOut, $wgLang, $wgRequest;
-   $uid = $wgUser-getId();
-   $output = $this-showNormalForm( $output, $user );
-
-   $dbr = wfGetDB( DB_SLAVE, 'favoritelist' );
+   global $wgUser, $wgOut, $wgLang, $wgRequest;
+   $uid = $wgUser-getId();
+   $output = $this-showNormalForm( $output, $user );

-
-   $favoritelistCount = $dbr-selectField( 'favoritelist', 'COUNT(*)',
-   array( 'fl_user' = $uid ), __METHOD__ );
-   // Adjust for page X, talk:page X, which are both stored separately,
-   // but treated together
-   $nitems = floor($favoritelistCount);
-
-   if( $nitems == 0 ) {
-   $output = wfmsg('nofavoritelist');
+   $dbr = wfGetDB( DB_SLAVE, 'favoritelist' );

+   $favoritelistCount = $dbr-selectField( 'favoritelist', 
'COUNT(*)',
+   array( 'fl_user' = 

[MediaWiki-CVS] SVN: [93873] branches/REL1_16/extensions/Favorites

2011-08-03 Thread jlemley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93873

Revision: 93873
Author:   jlemley
Date: 2011-08-04 01:02:58 + (Thu, 04 Aug 2011)
Log Message:
---
Fixed move and delete bugs.  Added parser argument. Fixed formatting. Fixed 
edit page count.

Modified Paths:
--
branches/REL1_16/extensions/Favorites/FavParser.php
branches/REL1_16/extensions/Favorites/FavoritedItem.php
branches/REL1_16/extensions/Favorites/FavoritelistEditor.php
branches/REL1_16/extensions/Favorites/Favorites.php
branches/REL1_16/extensions/Favorites/SpecialFavoritelist.php
branches/REL1_16/extensions/Favorites/favorites.i18n.php

Modified: branches/REL1_16/extensions/Favorites/FavParser.php
===
--- branches/REL1_16/extensions/Favorites/FavParser.php 2011-08-04 01:02:33 UTC 
(rev 93872)
+++ branches/REL1_16/extensions/Favorites/FavParser.php 2011-08-04 01:02:58 UTC 
(rev 93873)
@@ -2,58 +2,66 @@
 
 class FavParser {
 
-function wfSpecialFavoritelist() {
+   function wfSpecialFavoritelist($argv, $parser) {
+   
+   global $wgUser, $wgOut, $wgLang, $wgRequest;
+   global $wgRCShowFavoritingUsers, $wgEnotifFavoritelist, 
$wgShowUpdatedMarker;
+   $output = '';

-   global $wgUser, $wgOut, $wgLang, $wgRequest;
-   global $wgRCShowFavoritingUsers, $wgEnotifFavoritelist, 
$wgShowUpdatedMarker;
-   $output = '';
-
-   $skin = $wgUser-getSkin();
-   $specialTitle = SpecialPage::getTitleFor( 'Favoritelist' );
-   //$wgOut-setRobotPolicy( 'noindex,nofollow' );
-
-   # Anons don't get a favoritelist
-   if( $wgUser-isAnon() ) {
-   //$wgOut-setPageTitle( wfMsg( 'favoritenologin' ) );
-   $llink = $skin-linkKnown(
-   SpecialPage::getTitleFor( 'Userlogin' ), 
-   wfMsg( 'loginreqlink' ),
-   array(),
-   array( 'returnto' = $specialTitle-getPrefixedText() )
-   );
-   $output = wfMsgHtml( 'favoritelistanontext', $llink ) ;
+   $skin = $wgUser-getSkin();
+   $specialTitle = SpecialPage::getTitleFor( 'Favoritelist' );
+   //$wgOut-setRobotPolicy( 'noindex,nofollow' );
+   
+   # Anons don't get a favoritelist
+   if( $wgUser-isAnon() ) {
+   //$wgOut-setPageTitle( wfMsg( 'favoritenologin' ) );
+   $llink = $skin-linkKnown(
+   SpecialPage::getTitleFor( 'Userlogin' ), 
+   wfMsg( 'loginreqlink' ),
+   array(),
+   array( 'returnto' = 
$specialTitle-getPrefixedText() )
+   );
+   $output = wfMsgHtml( 'favoritelistanontext', $llink ) ;
+   
+   
+   return $output ;
+   
+   }
+   
+   $output = $this-viewFavList($wgUser, $output, $wgRequest);
+   if ( array_key_exists('editlink', $argv)  $argv['editlink']) {
+   # Add an edit link if you want it:
+   $output .= div id='contentSub'br . 
+   $skin-link(
+   SpecialPage::getTitleFor( 
'Favoritelist', 'edit' ),
+   wfMsgHtml( favoritelisttools-edit ),
+   array(),
+   array(),
+   array( 'known', 'noclasses' )
+   ) . /div;
+   }
+   
return $output ;
-   
}
 
-
-

-   $output = $this-viewFavList($wgUser, $output, $wgRequest);
-   return $output ;
-}
-
-   
private function viewFavList ($user, $output, $request) {
-   global $wgUser, $wgOut, $wgLang, $wgRequest;
-   $uid = $wgUser-getId();
-   $output = $this-showNormalForm( $output, $user );
-
-   $dbr = wfGetDB( DB_SLAVE, 'favoritelist' );
+   global $wgUser, $wgOut, $wgLang, $wgRequest;
+   $uid = $wgUser-getId();
+   $output = $this-showNormalForm( $output, $user );

-
-   $favoritelistCount = $dbr-selectField( 'favoritelist', 'COUNT(*)',
-   array( 'fl_user' = $uid ), __METHOD__ );
-   // Adjust for page X, talk:page X, which are both stored separately,
-   // but treated together
-   $nitems = floor($favoritelistCount);
-
-   if( $nitems == 0 ) {
-   $output = wfmsg('nofavoritelist');
+   $dbr = wfGetDB( DB_SLAVE, 'favoritelist' );

+   $favoritelistCount = $dbr-selectField( 'favoritelist', 
'COUNT(*)',
+   array( 'fl_user' = 

[MediaWiki-CVS] SVN: [93874] trunk/phase3/includes/DefaultSettings.php

2011-08-03 Thread krinkle
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93874

Revision: 93874
Author:   krinkle
Date: 2011-08-04 05:44:52 + (Thu, 04 Aug 2011)
Log Message:
---
Removing left-over comment from r67733.

Modified Paths:
--
trunk/phase3/includes/DefaultSettings.php

Modified: trunk/phase3/includes/DefaultSettings.php
===
--- trunk/phase3/includes/DefaultSettings.php   2011-08-04 01:02:58 UTC (rev 
93873)
+++ trunk/phase3/includes/DefaultSettings.php   2011-08-04 05:44:52 UTC (rev 
93874)
@@ -111,7 +111,7 @@
  *
  * Defaults to {$wgScriptPath}/redirect{$wgScriptExtension}.
  */
-$wgRedirectScript   = false; /// defaults to
+$wgRedirectScript   = false;
 
 /**
  * The URL path to load.php.


___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs