Jump to content

User:Jeroen De Dauw/LocalSettings.php

From mediawiki.org
error_reporting(E_ALL| E_STRICT);
ini_set("display_errors", 1);




if ( 0 ) {
	## Database settings
	$wgDBtype           = "mysql";
	$wgDBserver         = "localhost";
	$wgDBname           = "mw_dev";
	$wgDBuser           = "";
	$wgDBpassword       = '';

	# MySQL specific settings
	$wgDBprefix         = "mw_";

	# MySQL table options to use during installation or update
	$wgDBTableOptions   = "ENGINE=InnoDB, DEFAULT CHARSET=binary";

	# Experimental charset support for MySQL 5.0.
	$wgDBmysql5 = false;
}
else {
	## Database settings
	$wgDBtype           = "sqlite";
	$wgDBserver         = "";
	$wgDBname           = "mwdev.sqlite";
	$wgDBuser           = "";
	$wgDBpassword       = "";

	# SQLite-specific settings
	$wgSQLiteDataDir    = "/var/data";
}




$wgMainCacheType = CACHE_ACCEL;
$wgMessageCacheType = CACHE_ACCEL;
$wgParserCacheType = CACHE_ACCEL;

$wgDisableCounters = true;
$wgMiserMode = true;

$wgUseGzip = true;
$wgEnableSidebarCache = true;

//$wgUseFileCache = true;
$wgFileCacheDirectory = "$IP/cache";
$wgShowIPinHeader = false;
$wgCacheDirectory = "$IP/cache";

###
# Debug output
###
$wgShowExceptionDetails = true;
$wgShowSQLErrors        = true;
$wgDebugComments        = true;
$wgLogQueries           = true;
$wgDebugDumpSql         = true;
$wgDevelopmentWarnings  = true;
$wgDebugProfiling 		= true;
$wgDebugTimestamps 		= true;
$wgDebugPrintHttpHeaders= false;
$wgResourceLoaderDebug = true;
$wgDeprecationReleaseLimit = false;
$wgDebugToolbar = true;

$wgLegacyJavaScriptGlobals = false;
$wgEnableJavaScriptTest = true;

$wgDeprecationReleaseLimit = false;

$extensions = array();

if ( 0 ) {
	$extensions = array_merge( $extensions, array(
		'UploadWizard',
		//'Interwiki',
		'Awesomeness',
		//'Survey',
		'Nuke',
	) );
}

if ( 0 ) {
	$extensions = array_merge( $extensions, array(
		//'Gitweb',
		'Diff',
	) );
}

if ( 0 ) {
	$extensions = array_merge( $extensions, array(
		'DataValues',
		'Validator',
		'Maps',
	) );
}

if ( 1 ) {
	$wgDeprecationReleaseLimit = '1.18';
	$wgLegacyJavaScriptGlobals = true;
	$extensions = array_merge( $extensions, array(
//		'ParserFunctions',
		//'Widgets',
		'ParserHooks',
		//'SubPageList',
		'Validator',
		'SemanticMediaWiki',

		//'SemanticResultFormats',
		//'SemanticCompoundQueries',
		//'SemanticInternalObjects',
		//'SemanticForms',
		'Maps',
		'SemanticMaps',
	) );
}

function qs() {}

if ( 1 ) {
	define( 'WB_EXPERIMENTAL_FEATURES', true );

	//require_once( __DIR__ . "/extensions/DataValues/DataValues.php" );
	//require_once( __DIR__ . "/extensions/Wikibase/lib/WikibaseLib.php" );
	//require_once( __DIR__ . "/extensions/Wikibase/client/WikibaseClient.php" );
	//call_user_func( function() {
		require_once( __DIR__ . "/extensions/Wikibase/repo/Wikibase.php" );

	//} );

	//require_once( __DIR__ . "/extensions/Wikibase/Wikibase.php" );
	//require_once( __DIR__ . "/extensions/Wikibase/client/ExampleSettings.php" );
	require_once( __DIR__ . "/extensions/Wikibase/repo/ExampleSettings.php" );

	$wgExtraNamespaces[WB_NS_PROPERTY] = 'Prop';
	$wgExtraNamespaces[WB_NS_PROPERTY_TALK] = 'Prop_talk';

//	$wgWBSettings['entityPrefixes'] = array(
//		'i' => \Wikibase\Item::ENTITY_TYPE,
//		'p' => \Wikibase\Property::ENTITY_TYPE,
//		'q' => \Wikibase\Query::ENTITY_TYPE,
//	);

	$extensions = array_merge( $extensions, array(
		'Ask',
		'UniversalLanguageSelector',
	) );
}

if ( 1 ) {
	$extensions = array_merge( $extensions, array(
	//	'CreatePage',
		'cldr',
	//	'WikiEditor',
	//	'Vector',
		'EducationProgram',
	) );
}

if ( 0 ) {
	$wgDeprecationReleaseLimit = '1.17';

	$extensions = array_merge( $extensions,  array(
		'ParserFunctions',
		'SemanticMediaWiki',
		'SemanticInternalObjects',
		'SemanticForms',
		'WhoInspired',
	) );
}

//$wgExtensionAssetsPath = $wgScriptPath . '/../extensions';

foreach( $extensions as $extension ) {
	require_once( __DIR__ . "/extensions/$extension/$extension.php" );
}

enableSemantics( 'foo.bar' );

$wgHooks['SkinTemplateOutputPageBeforeExec'][] = 'makeSMWPoweredBy';
function makeSMWPoweredBy(&$skintempl, &$tpl) {
    global $wgScriptPath;

    $url = htmlspecialchars( "$wgScriptPath/extensions/SemanticMediaWiki/skins/images/smw_button.png" );
    $tpl->set( 'poweredbyico', '<a href="http://semantic-mediawiki.org/"><img src="' . $url . '" alt="Powered by Semantic MediaWiki"/></a>' );
    return true;
}

//$wgExtensionFunctions[] = function() {
//    $GLOBALS['wgUploadNavigationUrl'] = SpecialPage::getTitleFor( 'UploadWizard' )->getLocalURL();
//    return true;
//};

//$smwgShowFactbox = SMW_FACTBOX_SHOWN;

$wgExportFromNamespaces = true;
$wgNamespacesWithSubpages[NS_MAIN] = true;

function q() {
    foreach ( func_get_args() as $arg ) {
        var_dump( $arg );
        echo "\n";
    }
    die('.');
}

function qq() {
    static $n=0;$n++;
    $args = func_get_args();
    $c = array_pop( $args );
    if ( $c<$n ) {
        call_user_func_array( 'q', $args );
    }
}

function eq() {
	static $n=0;$n++;
	$args = func_get_args();
	foreach ( $args as $arg ) {
		var_dump( $arg );
		echo "\n";
	}
	throw new MWException('.' . json_encode( $args ));
}

function eqq() {
    static $n=0;$n++;
    $args = func_get_args();
    $c = array_pop( $args );
    $c = is_null( $c ) ? 0 : $c;
    if ( $c<$n ) {
		foreach ( $args as $arg ) {
			var_dump( $arg );
			echo "\n";
		}
        throw new MWException('.');
    }
}