本文整理汇总了PHP中WebRequest::getQueryValues方法的典型用法代码示例。如果您正苦于以下问题:PHP WebRequest::getQueryValues方法的具体用法?PHP WebRequest::getQueryValues怎么用?PHP WebRequest::getQueryValues使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WebRequest
的用法示例。
在下文中一共展示了WebRequest::getQueryValues方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
public function execute( $subPage ) {
if ( session_id() == '' ) {
wfSetupSession();
}
$this->load();
// Check for [[Special:Userlogin/signup]]. This affects form display and
// page title.
if ( $subPage == 'signup' ) {
$this->mType = 'signup';
}
$this->setHeaders();
// If logging in and not on HTTPS, either redirect to it or offer a link.
global $wgSecureLogin;
if ( WebRequest::detectProtocol() !== 'https' ) {
$title = $this->getFullTitle();
$query = array(
'returnto' => $this->mReturnTo,
'returntoquery' => $this->mReturnToQuery,
'title' => null,
) + $this->mRequest->getQueryValues();
$url = $title->getFullURL( $query, false, PROTO_HTTPS );
if ( $wgSecureLogin && wfCanIPUseHTTPS( $this->getRequest()->getIP() ) ) {
$url = wfAppendQuery( $url, 'fromhttp=1' );
$this->getOutput()->redirect( $url );
// Since we only do this redir to change proto, always vary
$this->getOutput()->addVaryHeader( 'X-Forwarded-Proto' );
return;
} else {
// A wiki without HTTPS login support should set $wgServer to
// http://somehost, in which case the secure URL generated
// above won't actually start with https://
if ( substr( $url, 0, 8 ) === 'https://' ) {
$this->mSecureLoginUrl = $url;
}
}
}
if ( !is_null( $this->mCookieCheck ) ) {
$this->onCookieRedirectCheck( $this->mCookieCheck );
return;
} elseif ( $this->mPosted ) {
if ( $this->mCreateaccount ) {
$this->addNewAccount();
return;
} elseif ( $this->mCreateaccountMail ) {
$this->addNewAccountMailPassword();
return;
} elseif ( ( 'submitlogin' == $this->mAction ) || $this->mLoginattempt ) {
$this->processLogin();
return;
}
}
$this->mainLoginForm( '' );
}
示例2: desktopFooter
/**
* Appends a mobile view link to the desktop footer
* @param Skin $sk
* @param QuickTemplate $tpl
* @param MobileContext $ctx
* @param Title $title
* @param WebRequest $req
*/
public static function desktopFooter($sk, $tpl, $ctx, $title, $req)
{
$footerlinks = $tpl->data['footerlinks'];
$args = $req->getQueryValues();
// avoid title being set twice
unset($args['title'], $args['useformat']);
$args['mobileaction'] = 'toggle_view_mobile';
$mobileViewUrl = $title->getFullURL($args);
$mobileViewUrl = $ctx->getMobileUrl($mobileViewUrl);
$link = Html::element('a', array('href' => $mobileViewUrl, 'class' => 'noprint stopMobileRedirectToggle'), wfMessage('mobile-frontend-view')->text());
$tpl->set('mobileview', $link);
$footerlinks['places'][] = 'mobileview';
$tpl->set('footerlinks', $footerlinks);
}