wiki.techinc.nl/includes/DevelopmentSettings.php
Adam Wight 68c3154cb9 Enable VisualEditor newwikitext mode in CI
This allows browser tests to access the "new wikitext" mode, but
should not affect any tests which don't explicitly enable the
associated beta preference.

Bug: T270240
Change-Id: I2ba889e1a5dd03549d8d7cb00678a30882ff03fe
2021-01-11 12:44:10 +00:00

102 lines
2.9 KiB
PHP

<?php
/**
* Extra settings useful for MediaWiki development.
*
* To enable built-in debug and development settings, add the
* following to your LocalSettings.php file.
*
* require "$IP/includes/DevelopmentSettings.php";
*
* Alternatively, if running phpunit.php (or another Maintenance script),
* you can use the --mwdebug option to automatically load these settings.
*
* @file
*/
/**
* Debugging for PHP
*/
// Enable showing of errors
error_reporting( -1 );
ini_set( 'display_errors', 1 );
/**
* Debugging for MediaWiki
*/
global $wgDevelopmentWarnings, $wgShowExceptionDetails, $wgShowHostnames,
$wgDebugRawPage, $wgCommandLineMode, $wgDebugLogFile,
$wgDBerrorLog, $wgDebugLogGroups;
// Use of wfWarn() should cause tests to fail
$wgDevelopmentWarnings = true;
// Enable showing of errors
$wgShowExceptionDetails = true;
$wgShowHostnames = true;
$wgDebugRawPage = true; // T49960
// Enable log files
$logDir = getenv( 'MW_LOG_DIR' );
if ( $logDir ) {
if ( $wgCommandLineMode ) {
$wgDebugLogFile = "$logDir/mw-debug-cli.log";
} else {
$wgDebugLogFile = "$logDir/mw-debug-www.log";
}
$wgDBerrorLog = "$logDir/mw-dberror.log";
$wgDebugLogGroups['ratelimit'] = "$logDir/mw-ratelimit.log";
$wgDebugLogGroups['error'] = "$logDir/mw-error.log";
$wgDebugLogGroups['exception'] = "$logDir/mw-error.log";
}
unset( $logDir );
/**
* Make testing possible (or easier)
*/
global $wgRateLimits, $wgEnableJavaScriptTest, $wgRestAPIAdditionalRouteFiles;
// Disable rate-limiting to allow integration tests to run unthrottled
// in CI and for devs locally (T225796)
$wgRateLimits = [];
// Enable Special:JavaScriptTest and allow `npm run qunit` to work
// https://www.mediawiki.org/wiki/Manual:JavaScript_unit_testing
$wgEnableJavaScriptTest = true;
// Enable development/experimental endpoints
$wgRestAPIAdditionalRouteFiles = [ 'includes/Rest/coreDevelopmentRoutes.json' ];
/**
* Experimental changes that may later become the default.
* (Must reference a Phabricator ticket)
*/
global $wgSQLMode, $wgLegacyJavaScriptGlobals, $wgLocalisationCacheConf,
$wgCacheDirectory, $wgEnableUploads, $wgCiteBookReferencing;
// Enable MariaDB/MySQL strict mode (T108255)
$wgSQLMode = 'TRADITIONAL';
// Disable legacy javascript globals in CI and for devs (T72470)
$wgLegacyJavaScriptGlobals = false;
// Localisation Cache to StaticArray (T218207)
$wgLocalisationCacheConf['store'] = 'array';
// Experimental Book Referencing feature (T236255)
$wgCiteBookReferencing = true;
// The default value is false, but for development it is useful to set this to the system temp
// directory by default (T218207)
$wgCacheDirectory = TempFSFile::getUsableTempDirectory() .
DIRECTORY_SEPARATOR .
rawurlencode( WikiMap::getCurrentWikiId() );
// Enable uploads for FileImporter browser tests (T190829)
$wgEnableUploads = true;
// Enable the new wikitext mode for browser testing (T270240)
$wgVisualEditorEnableWikitext = true;