Page MenuHomeDevCentral

D3742.id9679.diff
No OneTemporary

D3742.id9679.diff

diff --git a/composer.json b/composer.json
--- a/composer.json
+++ b/composer.json
@@ -18,7 +18,8 @@
"require": {
"vlucas/phpdotenv": "^5.5.0",
"nasqueron/saas-service": "^0.0.2",
- "keruald/commands": "^0.0.1"
+ "keruald/commands": "^0.0.1",
+ "keruald/omnitools": "^0.14.0"
},
"require-dev": {
"squizlabs/php_codesniffer": "3.*",
diff --git a/config/CommonSettings.php b/config/CommonSettings.php
--- a/config/CommonSettings.php
+++ b/config/CommonSettings.php
@@ -2,6 +2,7 @@
namespace Nasqueron\SAAS\MediaWiki\Configuration;
+use Keruald\OmniTools\DataTypes\Option\Option;
use Nasqueron\SAAS\ConfigurationException;
use Nasqueron\SAAS\MediaWiki\WithExecutablesPathsFix;
use Nasqueron\SAAS\MediaWiki\WithLog;
@@ -13,6 +14,8 @@
use WithScribunto;
use WithLog;
+ const CACHE_NONE = 0;
+
///
/// Individual set of settings
///
@@ -87,6 +90,34 @@
}
}
+ private static function getReadOnly (Option $readOnly) : array {
+ if ($readOnly->isNone() || PHP_SAPI === "cli") {
+ return [];
+ }
+
+ return [
+ 'wgReadOnly' => $readOnly->getValue(),
+
+ // DB caching
+ 'wgMessageCacheType' => self::CACHE_NONE,
+ 'wgMainCacheType' => self::CACHE_NONE,
+ 'wgParserCacheType' => self::CACHE_NONE,
+ 'wgSessionCacheType' => self::CACHE_NONE,
+ 'wgLocalisationCacheConf' => [
+ "class" => "LocalisationCache",
+ "store" => "detect",
+ "storeClass" => "LCStoreNull",
+ "storeDirectory" => false,
+ "storeServer" => [],
+ "forceRecache" => false,
+ "manualRecache" => false,
+ ],
+
+ // Thumbnails
+ 'wgIgnoreImageErrors' => true,
+ ];
+ }
+
///
/// Helper methods to apply those settings fix
///
@@ -105,6 +136,7 @@
$mappedSettings = [];
$mappedSettings += self::getRightsSettings($settings['saasLicense']);
$mappedSettings += self::getUrlSettings($settings['saasUrlScheme']);
+ $mappedSettings += self::getReadOnly($settings['saasReadOnly']);
return $mappedSettings;
}
diff --git a/config/Settings.php b/config/Settings.php
--- a/config/Settings.php
+++ b/config/Settings.php
@@ -2,6 +2,8 @@
namespace Nasqueron\SAAS\MediaWiki\Configuration;
+use Keruald\OmniTools\DataTypes\Option\None;
+
class Settings extends MappableSettings {
static public function getDatabaseMap () : array {
@@ -15,6 +17,14 @@
static public function getMappedSettings () : array {
return [
+ ///
+ /// Maintenance
+ ///
+
+ 'saasReadOnly' => [
+ 'default' => new None,
+ ],
+
///
/// MediaWiki Core
///

File Metadata

Mime Type
text/plain
Expires
Tue, Oct 28, 06:14 (17 h, 21 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3111265
Default Alt Text
D3742.id9679.diff (2 KB)

Event Timeline