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


PHP WebRequest::getQueryValues方法代码示例

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

示例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);
 }
开发者ID:micha6554,项目名称:mediawiki-extensions-MobileFrontend,代码行数:22,代码来源:MobileFrontend.skin.hooks.php


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