本文整理汇总了PHP中Installer::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Installer::__construct方法的具体用法?PHP Installer::__construct怎么用?PHP Installer::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Installer
的用法示例。
在下文中一共展示了Installer::__construct方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
/**
* Constructor.
*
* @param string $siteName
* @param string $admin
* @param array $option
*/
function __construct($siteName, $admin = null, array $option = [])
{
global $wgContLang;
parent::__construct();
if (isset($option['scriptpath'])) {
$this->specifiedScriptPath = true;
}
foreach ($this->optionMap as $opt => $global) {
if (isset($option[$opt])) {
$GLOBALS[$global] = $option[$opt];
$this->setVar($global, $option[$opt]);
}
}
if (isset($option['lang'])) {
global $wgLang, $wgLanguageCode;
$this->setVar('_UserLang', $option['lang']);
$wgContLang = Language::factory($option['lang']);
$wgLang = Language::factory($option['lang']);
$wgLanguageCode = $option['lang'];
RequestContext::getMain()->setLanguage($wgLang);
}
$this->setVar('wgSitename', $siteName);
$metaNS = $wgContLang->ucfirst(str_replace(' ', '_', $siteName));
if ($metaNS == 'MediaWiki') {
$metaNS = 'Project';
}
$this->setVar('wgMetaNamespace', $metaNS);
if ($admin) {
$this->setVar('_AdminName', $admin);
}
if (!isset($option['installdbuser'])) {
$this->setVar('_InstallUser', $this->getVar('wgDBuser'));
$this->setVar('_InstallPassword', $this->getVar('wgDBpassword'));
} else {
$this->setVar('_InstallUser', $option['installdbuser']);
$this->setVar('_InstallPassword', isset($option['installdbpass']) ? $option['installdbpass'] : "");
// Assume that if we're given the installer user, we'll create the account.
$this->setVar('_CreateDBAccount', true);
}
if (isset($option['pass'])) {
$this->setVar('_AdminPassword', $option['pass']);
}
// Set up the default skins
$skins = $this->findExtensions('skins');
$this->setVar('_Skins', $skins);
if ($skins) {
$skinNames = array_map('strtolower', $skins);
$this->setVar('wgDefaultSkin', $this->getDefaultSkin($skinNames));
}
}
示例2: array
/**
* Constructor.
*
* @param $siteName
* @param $admin
* @param $option Array
*/
function __construct($siteName, $admin = null, array $option = array())
{
global $wgContLang;
parent::__construct();
if (isset($option['scriptpath'])) {
$this->specifiedScriptPath = true;
}
foreach ($this->optionMap as $opt => $global) {
if (isset($option[$opt])) {
$GLOBALS[$global] = $option[$opt];
$this->setVar($global, $option[$opt]);
}
}
if (isset($option['lang'])) {
global $wgLang, $wgLanguageCode;
$this->setVar('_UserLang', $option['lang']);
$wgContLang = Language::factory($option['lang']);
$wgLang = Language::factory($option['lang']);
$wgLanguageCode = $option['lang'];
}
$this->setVar('wgSitename', $siteName);
$metaNS = $wgContLang->ucfirst(str_replace(' ', '_', $siteName));
if ($metaNS == 'MediaWiki') {
$metaNS = 'Project';
}
$this->setVar('wgMetaNamespace', $metaNS);
if ($admin) {
$this->setVar('_AdminName', $admin);
}
if (!isset($option['installdbuser'])) {
$this->setVar('_InstallUser', $this->getVar('wgDBuser'));
$this->setVar('_InstallPassword', $this->getVar('wgDBpassword'));
} else {
$this->setVar('_InstallUser', $option['installdbuser']);
$this->setVar('_InstallPassword', isset($option['installdbpass']) ? $option['installdbpass'] : "");
}
if (isset($option['pass'])) {
$this->setVar('_AdminPassword', $option['pass']);
}
}
示例3: __construct
/**
* Creates a new FTPInstaller object.
*
* @param string $targetDir the full path on the machine the ftp server is running
* @param string $source name of the source tar archive
* @param FTP $ftp active ftp connection
* @param FileHandler $fileHandler
* @param string $folder extract only the files from this subfolder
*/
public function __construct($targetDir, $source, FTP $ftp, $fileHandler = null, $folder = '')
{
$this->ftp = $ftp;
parent::__construct($targetDir, $source, $fileHandler, $folder);
}
示例4: __construct
/**
* Constructor.
*
* @param $request WebRequest
*/
public function __construct(WebRequest $request)
{
parent::__construct();
$this->output = new WebInstallerOutput($this);
$this->request = $request;
// Add parser hooks
global $wgParser;
$wgParser->setHook('downloadlink', array($this, 'downloadLinkHook'));
$wgParser->setHook('doclink', array($this, 'docLink'));
}
示例5:
/**
* Constructor.
* @see install.form.InstallForm for the expected parameters
* @param $xmlDescriptor string descriptor path
* @param $params array installer parameters
* @param $isPlugin boolean true iff a plugin is being installed
*/
function __construct($xmlDescriptor, $params, $isPlugin)
{
parent::__construct($xmlDescriptor, $params, $isPlugin);
}
示例6:
/**
* Constructor.
* @param $params array upgrade parameters
*/
function __construct($params, $installFile = 'upgrade.xml', $isPlugin = false)
{
parent::__construct($installFile, $params, $isPlugin);
}
示例7: __construct
/**
* Constructor.
*/
public function __construct()
{
parent::__construct();
// TODO
}