MediaWiki  1.28.0
LocalSettingsGenerator Class Reference

Class for generating LocalSettings.php file. More...

Collaboration diagram for LocalSettingsGenerator:

Public Member Functions

 __construct (Installer $installer)
 Constructor. More...
 
 getText ()
 Return the full text of the generated LocalSettings.php file, including the extensions and skins. More...
 
 setGroupRights ($group, $rightsArr)
 For $wgGroupPermissions, set a given ['group']['permission'] value. More...
 
 writeFile ($fileName)
 Write the generated LocalSettings to a file. More...
 

Static Public Member Functions

static escapePhpString ($string)
 Returns the escaped version of a string of php code. More...
 

Protected Member Functions

 buildMemcachedServerList ()
 
 getDefaultText ()
 

Protected Attributes

 $dbSettings = ''
 
 $extensions = []
 
 $groupPermissions = []
 
Installer $installer
 
 $IP
 
 $values = []
 

Private Member Functions

 generateExtEnableLine ($dir, $name)
 Generate the appropriate line to enable the given extension or skin. More...
 

Detailed Description

Class for generating LocalSettings.php file.

Since
1.17

Definition at line 30 of file LocalSettingsGenerator.php.

Constructor & Destructor Documentation

LocalSettingsGenerator::__construct ( Installer  $installer)

Constructor.

Parameters
Installer$installer

Definition at line 48 of file LocalSettingsGenerator.php.

References $installer, as, extensions, Installer\getDBInstaller(), Installer\getVar(), skins, values, and wfBoolToStr().

Member Function Documentation

LocalSettingsGenerator::buildMemcachedServerList ( )
protected
Returns
string

Definition at line 214 of file LocalSettingsGenerator.php.

References $ret, as, and values.

Referenced by getDefaultText().

static LocalSettingsGenerator::escapePhpString (   $string)
static

Returns the escaped version of a string of php code.

Parameters
string$string
Returns
string

Definition at line 114 of file LocalSettingsGenerator.php.

Referenced by SqliteInstaller\getLocalSettings(), MysqlInstaller\getLocalSettings(), and MssqlInstaller\getLocalSettings().

LocalSettingsGenerator::generateExtEnableLine (   $dir,
  $name 
)
private

Generate the appropriate line to enable the given extension or skin.

Parameters
string$dirEither "extensions" or "skins"
string$nameName of extension/skin
Exceptions
InvalidArgumentException
Returns
string

Definition at line 182 of file LocalSettingsGenerator.php.

References $dir, and $name.

Referenced by getText().

LocalSettingsGenerator::getDefaultText ( )
protected
Returns
string

Definition at line 235 of file LocalSettingsGenerator.php.

References as, buildMemcachedServerList(), values, and wfBoolToStr().

Referenced by getText().

LocalSettingsGenerator::getText ( )

Return the full text of the generated LocalSettings.php file, including the extensions and skins.

Returns
string

Definition at line 138 of file LocalSettingsGenerator.php.

References as, extensions, generateExtEnableLine(), getDefaultText(), and skins.

Referenced by writeFile().

LocalSettingsGenerator::setGroupRights (   $group,
  $rightsArr 
)

For $wgGroupPermissions, set a given ['group']['permission'] value.

Parameters
string$groupGroup name
array$rightsArrAn array of permissions, in the form of: [ 'right' => true, 'right2' => false ]

Definition at line 103 of file LocalSettingsGenerator.php.

LocalSettingsGenerator::writeFile (   $fileName)

Write the generated LocalSettings to a file.

Parameters
string$fileNameFull path to filename to write to

Definition at line 207 of file LocalSettingsGenerator.php.

References getText().

Member Data Documentation

LocalSettingsGenerator::$dbSettings = ''
protected

Definition at line 35 of file LocalSettingsGenerator.php.

LocalSettingsGenerator::$extensions = []
protected

Definition at line 32 of file LocalSettingsGenerator.php.

LocalSettingsGenerator::$groupPermissions = []
protected

Definition at line 34 of file LocalSettingsGenerator.php.

Installer LocalSettingsGenerator::$installer
protected

Definition at line 41 of file LocalSettingsGenerator.php.

Referenced by __construct().

LocalSettingsGenerator::$IP
protected

Definition at line 36 of file LocalSettingsGenerator.php.

LocalSettingsGenerator::$values = []
protected

Definition at line 33 of file LocalSettingsGenerator.php.


The documentation for this class was generated from the following file: