Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F24894011
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
5 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/config/MappableSettings.php b/config/MappableSettings.php
index 6737a9d..b1ed7ed 100644
--- a/config/MappableSettings.php
+++ b/config/MappableSettings.php
@@ -1,46 +1,46 @@
<?php
namespace Nasqueron\SAAS\MediaWiki\Configuration;
///
/// Temporary hack to get clean configuration.
///
/// Plan is to deploy the MediaWiki SaaS on a dedicated node.
///
/// Meanwhile, as we share the main Nasqueron MySQL database,
-/// with an history of databases going back to 2001, we need
+/// with a history of databases going back to 2001, we need
/// to map nicely named site key to actual databases names.
abstract class MappableSettings {
abstract static public function getDatabaseMap() : array;
abstract static public function getMappedSettings() : array;
static public function getSettings () : array {
$settings = [];
foreach (static::getMappedSettings() as $setting => $values) {
$settings[$setting] = self::mapDatabases($values);
}
return $settings;
}
static private function mapDatabases ($items) {
$setting = [];
foreach ($items as $key => $value) {
$mappedKey = self::mapDatabase($key);
$setting[$mappedKey] = $value;
}
return $setting;
}
static private function mapDatabase ($key) {
foreach (static::getDatabaseMap() as $canonical => $actual) {
if ($key === $canonical) {
return $actual;
}
}
return $key;
}
}
diff --git a/src/WithExecutablesPathsFix.php b/src/WithExecutablesPathsFix.php
index bb837e7..f91ee01 100644
--- a/src/WithExecutablesPathsFix.php
+++ b/src/WithExecutablesPathsFix.php
@@ -1,32 +1,32 @@
<?php
namespace Nasqueron\SAAS\MediaWiki;
trait WithExecutablesPathsFix {
/**
* Add settings to set binary paths for executables.
*
- * By default MediaWiki hardcodes Linux-centric paths for binaries.
+ * By default, MediaWiki hardcodes Linux-centric paths for binaries.
* Other OSes could store elsewhere binaries, like in /usr/local/bin
*
* @param array $settings
* @param string $path
*/
public static function fixExecutablePaths (array &$settings, string $path) {
foreach (self::getExecutables() as $setting => $executable) {
$settings[$setting]['default'] = $path . '/' . $executable;
}
}
private static function getExecutables (): array {
return [
"wgExiftool" => "exiftool",
"wgExiv2Command" => "exiv2",
"wgGitBin" => "git",
"wgImageMagickConvertCommand" => "convert",
"wgJpegTran" => "jpegtran",
"wgPhpCli" => "php",
];
}
}
diff --git a/src/WithLog.php b/src/WithLog.php
index aca0e47..48bdb8a 100644
--- a/src/WithLog.php
+++ b/src/WithLog.php
@@ -1,65 +1,65 @@
<?php
namespace Nasqueron\SAAS\MediaWiki;
trait WithLog {
public static function enableLog () : void {
$GLOBALS['wgMWLoggerDefaultSpi'] = self::getLoggerConfiguration();
}
private static function getLogPath () : string {
return "/var/log/mediawiki/error.log";
}
private static function getLoggerConfiguration () : array {
// See https://www.mediawiki.org/wiki/Manual:MonologSpi
return [
'class' => '\\MediaWiki\\Logger\\MonologSpi',
'args' => [[
'loggers' => [
'@default' => [
'processors' => [
'wiki',
'psr',
'web',
- // Disable introspection if you use an handler like
+ // Disable introspection if you use a handler like
// FingersCrossedHandler with several log entries.
'introspection',
],
'handlers' => [
'stream',
],
],
],
'processors' => [
'wiki' => [
'class' => '\\MediaWiki\\Logger\\Monolog\\WikiProcessor',
],
'psr' => [
'class' => '\\Monolog\\Processor\\PsrLogMessageProcessor',
],
'web' => [
'class' => '\\Monolog\\Processor\\WebProcessor',
],
'introspection' => [
'class' => '\\Monolog\\Processor\\IntrospectionProcessor',
],
],
'handlers' => [
'stream' => [
'class' => '\\Monolog\\Handler\\StreamHandler',
'args' => [ self::getLogPath(), LogLevel::Error->value ],
'formatter' => 'line',
],
],
'formatters' => [
'line' => [
'class' => '\\Monolog\\Formatter\\LineFormatter'
],
],
]],
];
}
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Wed, Mar 18, 12:38 (1 d, 13 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3534176
Default Alt Text
(5 KB)
Attached To
Mode
rSAASMW SaaS MediaWiki
Attached
Detach File
Event Timeline
Log In to Comment