X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Finstaller%2FLocalSettingsGenerator.php;h=c0ba300d368e7152dbfe3aa6fd3019d075de82a2;hb=70b2767512832b304c9db24cc2203961b6512c70;hp=3c8a5b1d409ed60d2b2f1c8425ace02e9e55bf4c;hpb=baf61e0bb8668baf46eabd9cd1f3125b6f55fbe7;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/installer/LocalSettingsGenerator.php b/includes/installer/LocalSettingsGenerator.php index 3c8a5b1d40..c0ba300d36 100644 --- a/includes/installer/LocalSettingsGenerator.php +++ b/includes/installer/LocalSettingsGenerator.php @@ -49,6 +49,7 @@ class LocalSettingsGenerator { $this->installer = $installer; $this->extensions = $installer->getVar( '_Extensions' ); + $this->skins = $installer->getVar( '_Skins' ); $db = $installer->getDBInstaller( $installer->getVar( 'wgDBtype' ) ); @@ -129,13 +130,26 @@ class LocalSettingsGenerator { /** * Return the full text of the generated LocalSettings.php file, - * including the extensions + * including the extensions and skins. * * @return string */ public function getText() { $localSettings = $this->getDefaultText(); + if ( count( $this->skins ) ) { + $localSettings .= " +# Enabled skins. +# The following skins were automatically enabled:\n"; + + foreach ( $this->skins as $skinName ) { + $encSkinName = self::escapePhpString( $skinName ); + $localSettings .= "require_once \"\$IP/skins/$encSkinName/$encSkinName.php\";\n"; + } + + $localSettings .= "\n"; + } + if ( count( $this->extensions ) ) { $localSettings .= " # Enabled Extensions. Most extensions are enabled by including the base extension file here @@ -146,9 +160,12 @@ class LocalSettingsGenerator { $encExtName = self::escapePhpString( $extName ); $localSettings .= "require_once \"\$IP/extensions/$encExtName/$encExtName.php\";\n"; } + + $localSettings .= "\n"; } - $localSettings .= "\n\n# End of automatically generated settings. + $localSettings .= " +# End of automatically generated settings. # Add more configuration options below.\n\n"; return $localSettings; @@ -202,7 +219,6 @@ class LocalSettingsGenerator { $locale = ''; } - //$rightsUrl = $this->values['wgRightsUrl'] ? '' : '#'; // @todo FIXME: I'm unused! $hashedUploads = $this->safeMode ? '' : '#'; $metaNamespace = ''; if ( $this->values['wgMetaNamespace'] !== $this->values['wgSitename'] ) { @@ -221,6 +237,8 @@ class LocalSettingsGenerator { wfBoolToStr( $perm ) . ";\n"; } } + $groupRights .= "\n"; + if ( ( isset( $this->groupPermissions['*']['edit'] ) && $this->groupPermissions['*']['edit'] === false ) && ( isset( $this->groupPermissions['*']['createaccount'] ) && @@ -228,12 +246,12 @@ class LocalSettingsGenerator { && ( isset( $this->groupPermissions['*']['read'] ) && $this->groupPermissions['*']['read'] !== false ) ) { - $noFollow = "\n# Set \$wgNoFollowLinks to true if you open up your wiki to editing by\n" + $noFollow = "# Set \$wgNoFollowLinks to true if you open up your wiki to editing by\n" . "# the general public and wish to apply nofollow to external links as a\n" . "# deterrent to spammers. Nofollow is not a comprehensive anti-spam solution\n" . "# and open wikis will generally require other anti-spam measures; for more\n" . "# information, see https://www.mediawiki.org/wiki/Manual:Combating_spam\n" - . "\$wgNoFollowLinks = false;"; + . "\$wgNoFollowLinks = false;\n\n"; } } @@ -353,10 +371,6 @@ ${serverSetting} # web installer while LocalSettings.php is in place \$wgUpgradeKey = \"{$this->values['wgUpgradeKey']}\"; -## Default skin: you can change the default skin. Use the internal symbolic -## names, ie 'vector', 'monobook': -\$wgDefaultSkin = \"{$this->values['wgDefaultSkin']}\"; - ## For attaching licensing metadata to pages, and displaying an ## appropriate copyright notice / icon. GNU Free Documentation ## License and Creative Commons licenses are supported so far. @@ -368,6 +382,9 @@ ${serverSetting} # Path to the GNU diff3 utility. Used for conflict resolution. \$wgDiff3 = \"{$this->values['wgDiff3']}\"; -{$groupRights}{$noFollow}"; +{$groupRights}{$noFollow}## Default skin: you can change the default skin. Use the internal symbolic +## names, ie 'vector', 'monobook': +\$wgDefaultSkin = \"{$this->values['wgDefaultSkin']}\"; +"; } }