本文整理汇总了PHP中Installer::getVar方法的典型用法代码示例。如果您正苦于以下问题:PHP Installer::getVar方法的具体用法?PHP Installer::getVar怎么用?PHP Installer::getVar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Installer
的用法示例。
在下文中一共展示了Installer::getVar方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getText
/**
* Return the full text of the generated LocalSettings.php file,
* including the extensions
*
* @return String
*/
public function getText() {
$localSettings = $this->getDefaultText();
if ( count( $this->extensions ) ) {
$extensions = $this->installer->findExtensions();
$localSettings .= "
# Enabled Extensions. Most extensions are enabled by including the base extension file here
# but check specific extension documentation for more details
# The following extensions were automatically enabled:\n";
$ip = $this->installer->getVar( 'IP' );
foreach ( $this->extensions as $ext) {
$path = str_replace( $ip, '', $extensions[$ext]['path'] );
$prefix = '';
if ( $path !== $extensions[$ext]['path'] ) {
$prefix = '$IP';
}
$path = $prefix . self::escapePhpString( $path );
$localSettings .= "require_once \"$path\";\n";
}
}
$localSettings .= "\n\n# End of automatically generated settings.
# Add more configuration options below.\n\n";
return $localSettings;
}
示例2: __construct
/**
* Constructor.
*
* @param $installer Installer subclass
*/
public function __construct(Installer $installer)
{
$this->installer = $installer;
$this->extensions = $installer->getVar('_Extensions');
$db = $installer->getDBInstaller($installer->getVar('wgDBtype'));
$confItems = array_merge(array('wgScriptPath', 'wgScriptExtension', 'wgPasswordSender', 'wgImageMagickConvertCommand', 'wgShellLocale', 'wgLanguageCode', 'wgEnableEmail', 'wgEnableUserEmail', 'wgDiff3', 'wgEnotifUserTalk', 'wgEnotifWatchlist', 'wgEmailAuthentication', 'wgDBtype', 'wgSecretKey', 'wgRightsUrl', 'wgSitename', 'wgRightsIcon', 'wgRightsText', 'wgRightsCode', 'wgMainCacheType', 'wgEnableUploads', 'wgMainCacheType', '_MemCachedServers', 'wgDBserver', 'wgDBuser', 'wgDBpassword', 'wgUseInstantCommons', 'wgUpgradeKey', 'wgDefaultSkin', 'wgMetaNamespace', 'wgResourceLoaderMaxQueryLength'), $db->getGlobalNames());
$unescaped = array('wgRightsIcon');
$boolItems = array('wgEnableEmail', 'wgEnableUserEmail', 'wgEnotifUserTalk', 'wgEnotifWatchlist', 'wgEmailAuthentication', 'wgEnableUploads', 'wgUseInstantCommons');
foreach ($confItems as $c) {
$val = $installer->getVar($c);
if (in_array($c, $boolItems)) {
$val = wfBoolToStr($val);
}
if (!in_array($c, $unescaped)) {
$val = self::escapePhpString($val);
}
$this->values[$c] = $val;
}
$this->dbSettings = $db->getLocalSettings();
$this->safeMode = $installer->getVar('_SafeMode');
$this->values['wgEmergencyContact'] = $this->values['wgPasswordSender'];
}