当前位置: 首页>>代码示例>>PHP>>正文


PHP Installer::getVar方法代码示例

本文整理汇总了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;
	}
开发者ID:nahoj,项目名称:mediawiki_ynh,代码行数:33,代码来源:LocalSettingsGenerator.php

示例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'];
 }
开发者ID:GodelDesign,项目名称:Godel,代码行数:27,代码来源:LocalSettingsGenerator.php


注:本文中的Installer::getVar方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。