Revision: 48847
Author:   kim
Date:     2009-03-26 01:16:50 +0000 (Thu, 26 Mar 2009)

Log Message:
-----------
duplicate command, step 1       
(isolate all unique elements in the LocalSettings file,
so that we can generate from scratch)

Modified Paths:
--------------
    trunk/wikiation/installer/mediawiki_installer.py

Added Paths:
-----------
    trunk/wikiation/installer/LocalSettings.php

Removed Paths:
-------------
    trunk/wikiation/installer/LocalSettings.php.template

Added: trunk/wikiation/installer/LocalSettings.php
===================================================================
--- trunk/wikiation/installer/LocalSettings.php                         (rev 0)
+++ trunk/wikiation/installer/LocalSettings.php 2009-03-26 01:16:50 UTC (rev 
48847)
@@ -0,0 +1,143 @@
+<?php
+
+# This file was automatically generated by the MediaWiki installer.
+# If you make manual changes, please keep track in case you need to
+# recreate them later.
+#
+# See includes/DefaultSettings.php for all configurable settings
+# and their default values, but don't forget to make changes in _this_
+# file, not there.
+
+error_reporting( E_ALL | E_STRICT);
+
+# If you customize your file layout, set $IP to the directory that contains
+# the other MediaWiki files. It will be used as a base to locate files.
+if( defined( 'MW_INSTALL_PATH' ) ) {
+       $IP = MW_INSTALL_PATH;
+} else {
+       $IP = dirname( __FILE__ );
+}
+
+$path = array( $IP, "$IP/includes", "$IP/languages" );
+set_include_path( implode( PATH_SEPARATOR, $path ) . PATH_SEPARATOR . 
get_include_path() );
+
+require_once( "$IP/includes/DefaultSettings.php" );
+
+# If PHP's memory limit is very low, some operations may fail.
+# ini_set( 'memory_limit', '20M' );
+
+if ( $wgCommandLineMode ) {
+       if ( isset( $_SERVER ) && array_key_exists( 'REQUEST_METHOD', $_SERVER 
) ) {
+               die( "This script must be run from the command line\n" );
+       }
+}
+## Uncomment this to disable output compression
+# $wgDisableOutputCompression = true;
+
+require_once ("$IP/InstallerUniqueSettings.php");
+
+## The URL base path to the directory containing the wiki;
+## defaults for all runtime URL paths are based off of this.
+$wgScriptExtension  = ".php";
+
+
+## For more information on customizing the URLs please see:
+## http://www.mediawiki.org/wiki/Manual:Short_URL
+
+$wgEnableEmail      = true;
+$wgEnableUserEmail  = true;
+
+$wgEmergencyContact = "webmas...@localhost";
+$wgPasswordSender = "webmas...@localhost";
+
+## For a detailed description of the following switches see
+## http://www.mediawiki.org/wiki/Extension:Email_notification 
+## and http://www.mediawiki.org/wiki/Extension:Email_notification
+## There are many more options for fine tuning available see
+## /includes/DefaultSettings.php
+## UPO means: this is also a user preference option
+$wgEnotifUserTalk = true; # UPO
+$wgEnotifWatchlist = true; # UPO
+$wgEmailAuthentication = true;
+
+$wgDBtype           = "mysql";
+$wgDBserver         = "localhost";
+$wgDBuser           = "root";
+$wgDBpassword       = "";
+
+# MySQL specific settings
+$wgDBprefix         = "";
+
+# MySQL table options to use during installation or update
+$wgDBTableOptions   = "TYPE=InnoDB";
+
+# Experimental charset support for MySQL 4.1/5.0.
+$wgDBmysql5 = false;
+
+# Postgres specific settings
+$wgDBport           = "5432";
+$wgDBmwschema       = "mediawiki";
+$wgDBts2schema      = "public";
+
+## Shared memory settings
+$wgMainCacheType = CACHE_ACCEL;
+$wgMemCachedServers = array();
+
+## To enable image uploads, make sure the 'images' directory
+## is writable, then set this to true:
+$wgEnableUploads       = false;
+# $wgUseImageMagick = true;
+# $wgImageMagickConvertCommand = "/usr/bin/convert";
+
+## If you want to use image uploads under safe mode,
+## create the directories images/archive, images/thumb and
+## images/temp, and make them all writable. Then uncomment
+## this, if it's not already uncommented:
+# $wgHashedUploadDirectory = false;
+
+## If you have the appropriate support software installed
+## you can enable inline LaTeX equations:
+$wgUseTeX           = false;
+
+$wgLocalInterwiki   = $wgSitename;
+
+$wgLanguageCode = "en";
+
+$wgProxyKey = 
"eeedfbcf7f4e6238a2db7959e50e5e19d0e0c1a6500dbfaa5d38f6dabe801c76";
+
+## Default skin: you can change the default skin. Use the internal symbolic
+## names, ie 'standard', 'nostalgia', 'cologneblue', 'monobook':
+$wgDefaultSkin = 'monobook';
+
+## For attaching licensing metadata to pages, and displaying an
+## appropriate copyright notice / icon. GNU Free Documentation
+## License and Creative Commons licenses are supported so far.
+# $wgEnableCreativeCommonsRdf = true;
+$wgRightsPage = ""; # Set to the title of a wiki page that describes your 
license/copyright
+$wgRightsUrl = "";
+$wgRightsText = "";
+$wgRightsIcon = "";
+# $wgRightsCode = ""; # Not yet used
+
+$wgDiff3 = "/usr/bin/diff3";
+
+# When you make changes to this configuration file, this will make
+# sure that cached pages are cleared.
+$wgCacheEpoch = max( $wgCacheEpoch, gmdate( 'YmdHis', @filemtime( __FILE__ ) ) 
);
+
+$wgGroupPermissions['*'    ]['read']            = true;
+$wgGroupPermissions['*'    ]['write']            = false;
+
+
+# No wiki is complete without a logo.
+$wgLogo="$wgScriptPath/Logo.png";
+
+# load Localsettings specific to particular modules
+
+$additional_settings=glob("$IP/LocalSettings/*.php");
+foreach ($additional_settings as $file) {
+       require_once($file);
+}
+
+
+?>

Deleted: trunk/wikiation/installer/LocalSettings.php.template
===================================================================
--- trunk/wikiation/installer/LocalSettings.php.template        2009-03-25 
20:25:35 UTC (rev 48846)
+++ trunk/wikiation/installer/LocalSettings.php.template        2009-03-26 
01:16:50 UTC (rev 48847)
@@ -1,145 +0,0 @@
-<?php
-
-# This file was automatically generated by the MediaWiki installer.
-# If you make manual changes, please keep track in case you need to
-# recreate them later.
-#
-# See includes/DefaultSettings.php for all configurable settings
-# and their default values, but don't forget to make changes in _this_
-# file, not there.
-
-error_reporting( E_ALL | E_STRICT);
-
-# If you customize your file layout, set $IP to the directory that contains
-# the other MediaWiki files. It will be used as a base to locate files.
-if( defined( 'MW_INSTALL_PATH' ) ) {
-       $IP = MW_INSTALL_PATH;
-} else {
-       $IP = dirname( __FILE__ );
-}
-
-$path = array( $IP, "$IP/includes", "$IP/languages" );
-set_include_path( implode( PATH_SEPARATOR, $path ) . PATH_SEPARATOR . 
get_include_path() );
-
-require_once( "$IP/includes/DefaultSettings.php" );
-
-# If PHP's memory limit is very low, some operations may fail.
-# ini_set( 'memory_limit', '20M' );
-
-if ( $wgCommandLineMode ) {
-       if ( isset( $_SERVER ) && array_key_exists( 'REQUEST_METHOD', $_SERVER 
) ) {
-               die( "This script must be run from the command line\n" );
-       }
-}
-## Uncomment this to disable output compression
-# $wgDisableOutputCompression = true;
-
-$wgSitename         = "Wikiation_<<TARGET>>";
-
-## The URL base path to the directory containing the wiki;
-## defaults for all runtime URL paths are based off of this.
-$wgScriptPath       = "<<BASE_SCRIPTPATH>><<TARGET>>";
-$wgScriptExtension  = ".php";
-
-
-## For more information on customizing the URLs please see:
-## http://www.mediawiki.org/wiki/Manual:Short_URL
-
-$wgEnableEmail      = true;
-$wgEnableUserEmail  = true;
-
-$wgEmergencyContact = "webmas...@localhost";
-$wgPasswordSender = "webmas...@localhost";
-
-## For a detailed description of the following switches see
-## http://www.mediawiki.org/wiki/Extension:Email_notification 
-## and http://www.mediawiki.org/wiki/Extension:Email_notification
-## There are many more options for fine tuning available see
-## /includes/DefaultSettings.php
-## UPO means: this is also a user preference option
-$wgEnotifUserTalk = true; # UPO
-$wgEnotifWatchlist = true; # UPO
-$wgEmailAuthentication = true;
-
-$wgDBtype           = "mysql";
-$wgDBserver         = "localhost";
-$wgDBname           = '<<TARGET>>';
-$wgDBuser           = "root";
-$wgDBpassword       = "";
-
-# MySQL specific settings
-$wgDBprefix         = "";
-
-# MySQL table options to use during installation or update
-$wgDBTableOptions   = "TYPE=InnoDB";
-
-# Experimental charset support for MySQL 4.1/5.0.
-$wgDBmysql5 = false;
-
-# Postgres specific settings
-$wgDBport           = "5432";
-$wgDBmwschema       = "mediawiki";
-$wgDBts2schema      = "public";
-
-## Shared memory settings
-$wgMainCacheType = CACHE_ACCEL;
-$wgMemCachedServers = array();
-
-## To enable image uploads, make sure the 'images' directory
-## is writable, then set this to true:
-$wgEnableUploads       = false;
-# $wgUseImageMagick = true;
-# $wgImageMagickConvertCommand = "/usr/bin/convert";
-
-## If you want to use image uploads under safe mode,
-## create the directories images/archive, images/thumb and
-## images/temp, and make them all writable. Then uncomment
-## this, if it's not already uncommented:
-# $wgHashedUploadDirectory = false;
-
-## If you have the appropriate support software installed
-## you can enable inline LaTeX equations:
-$wgUseTeX           = false;
-
-$wgLocalInterwiki   = $wgSitename;
-
-$wgLanguageCode = "en";
-
-$wgProxyKey = 
"eeedfbcf7f4e6238a2db7959e50e5e19d0e0c1a6500dbfaa5d38f6dabe801c76";
-
-## Default skin: you can change the default skin. Use the internal symbolic
-## names, ie 'standard', 'nostalgia', 'cologneblue', 'monobook':
-$wgDefaultSkin = 'monobook';
-
-## For attaching licensing metadata to pages, and displaying an
-## appropriate copyright notice / icon. GNU Free Documentation
-## License and Creative Commons licenses are supported so far.
-# $wgEnableCreativeCommonsRdf = true;
-$wgRightsPage = ""; # Set to the title of a wiki page that describes your 
license/copyright
-$wgRightsUrl = "";
-$wgRightsText = "";
-$wgRightsIcon = "";
-# $wgRightsCode = ""; # Not yet used
-
-$wgDiff3 = "/usr/bin/diff3";
-
-# When you make changes to this configuration file, this will make
-# sure that cached pages are cleared.
-$wgCacheEpoch = max( $wgCacheEpoch, gmdate( 'YmdHis', @filemtime( __FILE__ ) ) 
);
-
-$wgGroupPermissions['*'    ]['read']            = true;
-$wgGroupPermissions['*'    ]['write']            = false;
-
-
-# No wiki is complete without a logo.
-$wgLogo="$wgScriptPath/Logo.png";
-
-# load Localsettings specific to particular modules
-
-$additional_settings=glob("$IP/LocalSettings/*.php");
-foreach ($additional_settings as $file) {
-       require_once($file);
-}
-
-
-?>

Modified: trunk/wikiation/installer/mediawiki_installer.py
===================================================================
--- trunk/wikiation/installer/mediawiki_installer.py    2009-03-25 20:25:35 UTC 
(rev 48846)
+++ trunk/wikiation/installer/mediawiki_installer.py    2009-03-26 01:16:50 UTC 
(rev 48847)
@@ -227,16 +227,25 @@
 
 
 def localsettings(target):
-       """create a localSettings.php file, for target mediawiki instance based
-       on the LocalSettings.php.template file
+       """Copy over our LocalSettings.php , and create 
InstallerUniqueSettings.php
+       (which contains settings unique to this instance)
        LocalSettings.php is the main configuration file for mediawiki."""
 
-       template=settings.installerdir+"/LocalSettings.php.template"
-       localsettings=settings.instancesdir+"/"+target+"/LocalSettings.php"
-       
replacements={'<<TARGET>>':target,"<<BASE_SCRIPTPATH>>":settings.base_scriptpath}
-       replace_generic(replacements,template,localsettings)    
-       subdir=settings.instancesdir+"/"+target+"/LocalSettings"
-       os.mkdir(subdir)
+       here=settings.installerdir+"/LocalSettings.php"
+       instancedir=settings.instancesdir+"/"+target
+       there=instancedir+"/LocalSettings.php"
+       shutil.copy2(here,there)
+       
+       
uniquesettings=settings.instancesdir+"/"+target+"/InstallerUniqueSettings.php"
+       unique=file(uniquesettings,"w")
+       unique.write('<?php\n')
+       unique.write('$wgSitename = "Wikiation_'+target+'";\n')
+       unique.write('$wgScriptPath = 
"'+settings.base_scriptpath+"/"+target+'";\n')
+       unique.write('$wgDBname = "'+target+'";\n')
+       unique.write('?>\n')
+       
+       unique.close()
+       
 
 def logo(target):
        """copy a nice logo"""



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

Reply via email to