Skip to content

Commit

Permalink
Make MediaWiki's l10n_cache directory into a volume (#406)
Browse files Browse the repository at this point in the history
* making MediaWiki's cache directory into a volume

* making MediaWiki's cache directory into a volume
  • Loading branch information
naresh-kumar-babu authored Jun 24, 2024
1 parent 4f386a5 commit cdbf912
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions _sources/canasta/CanastaDefaultSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,31 @@
$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;

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

0 comments on commit cdbf912

Please sign in to comment.