Skip to content

Commit

Permalink
making MediaWiki's cache directory into a volume
Browse files Browse the repository at this point in the history
  • Loading branch information
naresh-kumar-babu committed Jun 19, 2024
1 parent 9b933e5 commit b243977
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions _sources/canasta/CanastaDefaultSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,34 @@
$wgCdnServersNoPurge[] = '172.16.0.0/12'; // 172.16.0.0 – 172.31.255.255
$wgCdnServersNoPurge[] = '192.168.0.0/16'; // 192.168.0.0 – 192.168.255.255

/**
* Returns boolean value from environment variable
* Must return the same result as isTrue function in run-apache.sh file
* @param $value
* @return bool
*/
function isEnvTrue( $name ): bool {
$value = getenv( $name );
switch ( $value ) {
case "True":
case "TRUE":
case "true":
case "1":
return true;
}
return false;
}

$DOCKER_MW_VOLUME = getenv( 'MW_VOLUME' );

## Set $wgCacheDirectory to a writable directory on the web server
## to make your wiki go slightly faster. The directory should not
## be publicly accessible from the web.
$wgCacheDirectory = isEnvTrue( 'MW_USE_CACHE_DIRECTORY' ) ? "$DOCKER_MW_VOLUME/l10n_cache" : false;

# SemanticMediaWiki
$smwgConfigFileDir = "$DOCKER_MW_VOLUME/extensions/SemanticMediaWiki/config";

# Include user defined CommonSettings.php file
if ( file_exists( $canastaCommonSettingsFilePath ) ) {
require_once "$canastaCommonSettingsFilePath";
Expand Down

0 comments on commit b243977

Please sign in to comment.