[MediaWiki-CodeReview] [MediaWiki r109739]: New comment added

2012-01-23 Thread MediaWiki Mail
"Reedy" posted a comment on MediaWiki.r109739.
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/109739#c29919

Commit summary for MediaWiki.r109739:

Followup r109711

When given a script, it may or may not have the full path. So cannot do a 
direct array comparison. Which means it can be: $relFile, $maintenance . 
$relFile, $wikimediaMaintenance . $relFile

Try all locations, and if no matches to the wikiless presume it needs a wiki 
parameter (or else, it's a script we haven't been told is wikiless yet, tough! 
add it yourself)

The scripts that have moved for 1.19 can be removed from the phase3/maintenance 
$wikiless list after 1.19 is sitewide

Reedy's comment:

Re-educating users to give the full path (though, that is what they are more 
traditionally used to) would be so much easier ;)

I'm gonna revert out most of this for the moment, until I get more time to 
actually work on it. Reduces the chance of accidentally getting partially 
broken versions live on WMF

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r109739]: New comment added

2012-01-23 Thread MediaWiki Mail
"Reedy" posted a comment on MediaWiki.r109739.
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/109739#c29918

Commit summary for MediaWiki.r109739:

Followup r109711

When given a script, it may or may not have the full path. So cannot do a 
direct array comparison. Which means it can be: $relFile, $maintenance . 
$relFile, $wikimediaMaintenance . $relFile

Try all locations, and if no matches to the wikiless presume it needs a wiki 
parameter (or else, it's a script we haven't been told is wikiless yet, tough! 
add it yourself)

The scripts that have moved for 1.19 can be removed from the phase3/maintenance 
$wikiless list after 1.19 is sitewide

Reedy's comment:

Oh..

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r109739]: New comment added

2012-01-23 Thread MediaWiki Mail
"Reedy" posted a comment on MediaWiki.r109739.
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/109739#c29916

Commit summary for MediaWiki.r109739:

Followup r109711

When given a script, it may or may not have the full path. So cannot do a 
direct array comparison. Which means it can be: $relFile, $maintenance . 
$relFile, $wikimediaMaintenance . $relFile

Try all locations, and if no matches to the wikiless presume it needs a wiki 
parameter (or else, it's a script we haven't been told is wikiless yet, tough! 
add it yourself)

The scripts that have moved for 1.19 can be removed from the phase3/maintenance 
$wikiless list after 1.19 is sitewide

Reedy's comment:


+   $relFile = $argv[0];
+
+   # Check if a --wiki param was given...
+   # Maintenance.php will treat $argv[1] as the wiki if it doesn't start 
'-'
+   if ( !isset( $argv[1] ) || !preg_match( '/^([^-]|--wiki(=|$))/', 
$argv[1] ) ) {
+   // All the possible locations of a wikiless script
+   $possibles = array( $relFile, $maintenance . $relFile, 
$wikimediaMaintenance . $relFile );
+   foreach( $possibles as $poss ) {
+   if ( in_array( $poss, $wikiless ) ) {
+   # Assume aawiki as Maintenance.php does.
+   $argv = array_merge( array( $argv[0], 
"--wiki=aawiki" ), array_slice( $argv, 1 ) );
+   break;
+   }
+   }
+   }


$argv[0] is pulled off before the array is overwritten

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r109739]: New comment added

2012-01-22 Thread MediaWiki Mail
"Aaron Schulz" posted a comment on MediaWiki.r109739.
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/109739#c29900

Commit summary for MediaWiki.r109739:

Followup r109711

When given a script, it may or may not have the full path. So cannot do a 
direct array comparison. Which means it can be: $relFile, $maintenance . 
$relFile, $wikimediaMaintenance . $relFile

Try all locations, and if no matches to the wikiless presume it needs a wiki 
parameter (or else, it's a script we haven't been told is wikiless yet, tough! 
add it yourself)

The scripts that have moved for 1.19 can be removed from the phase3/maintenance 
$wikiless list after 1.19 is sitewide

Aaron Schulz's comment:

Also, be sure to read my BZ comment :)

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r109739]: New comment added

2012-01-22 Thread MediaWiki Mail
"Aaron Schulz" posted a comment on MediaWiki.r109739.
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/109739#c29899

Commit summary for MediaWiki.r109739:

Followup r109711

When given a script, it may or may not have the full path. So cannot do a 
direct array comparison. Which means it can be: $relFile, $maintenance . 
$relFile, $wikimediaMaintenance . $relFile

Try all locations, and if no matches to the wikiless presume it needs a wiki 
parameter (or else, it's a script we haven't been told is wikiless yet, tough! 
add it yourself)

The scripts that have moved for 1.19 can be removed from the phase3/maintenance 
$wikiless list after 1.19 is sitewide

Aaron Schulz's comment:

You do "$argv[0] = $matches[1]; // make first arg the script file name" before 
ever storing the original. Things like "mwscript 
extensions/FlaggedRevs/maintenance/FILE" won't work with this since it will do 
getMediaWikiCli( "FILE" ).

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview