本文整理匯總了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'];
}