r98256 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r98255‎ | r98256 | r98257 >
Date:21:14, 27 September 2011
Author:aaron
Status:resolved (Comments)
Tags:
Comment:
Added getMWVersion script to get the MW version corresponding to a wiki db name
Modified paths:
  • /trunk/tools/mwmultiversion/multiversion/getMWVersion (added) (history)

Diff [purge]

Index: trunk/tools/mwmultiversion/multiversion/getMWVersion
@@ -0,0 +1,26 @@
 2+#!/usr/bin/env php
 3+<?php
 4+error_reporting( 0 );
 5+// This script prints the MW version associated with a specified wikidb.
 6+if ( count( $argv ) < 2 ) {
 7+ die( "Usage: getMWVersion <dbname> \n" );
 8+}
 9+/**
 10+ * Prints the MW version associated with a specified wikidb (as listed e.g. in all.dblist).
 11+ * @param $dbName string
 12+ * @return string MW code version (e.g. "php-x.xx" or "php-trunk")
 13+ */
 14+function getWikiVersion( $dbName ) {
 15+ $db = dba_open( '/usr/local/apache/common-local/wikiversions.cdb', 'r', 'cdb' );
 16+ if ( $db ) {
 17+ $version = dba_fetch( "ver:$dbName", $db );
 18+ dba_close( $db );
 19+ if ( $version !== false ) {
 20+ return $version; // found version entry
 21+ }
 22+ die( "wikiversions.cdb has no extra version entry for `$dbName`.\n" );
 23+ }
 24+ die( "Unable to open wikiversions.cdb.\n" );
 25+}
 26+
 27+echo getWikiVersion( $argv[1] );
Property changes on: trunk/tools/mwmultiversion/multiversion/getMWVersion
___________________________________________________________________
Added: svn:executable
128 + *

Comments

#Comment by Catrope (talk | contribs)   20:31, 4 October 2011

eol-style seems to have been added later, marking resolved.

Status & tagging log