當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。