本文整理汇总了PHP中Mage_Core_Controller_Request_Http::getHttpHost方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Core_Controller_Request_Http::getHttpHost方法的具体用法?PHP Mage_Core_Controller_Request_Http::getHttpHost怎么用?PHP Mage_Core_Controller_Request_Http::getHttpHost使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Core_Controller_Request_Http
的用法示例。
在下文中一共展示了Mage_Core_Controller_Request_Http::getHttpHost方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testGetHttpHost
public function testGetHttpHost()
{
$this->assertEquals('localhost', $this->_model->getHttpHost());
$_SERVER['HTTP_HOST'] = 'example.com:80';
$this->assertEquals($_SERVER['HTTP_HOST'], $this->_model->getHttpHost(false));
$this->assertEquals('example.com', $this->_model->getHttpHost());
}
示例2: _validateSignature
/**
* Validate signature
*
* @throws Mage_Oauth_Exception
*/
protected function _validateSignature()
{
$util = new Zend_Oauth_Http_Utility();
$calculatedSign = $util->sign(array_merge($this->_params, $this->_protocolParams), $this->_protocolParams['oauth_signature_method'], $this->_consumer->getSecret(), $this->_token->getSecret(), $this->_request->getMethod(), $this->_request->getScheme() . '://' . $this->_request->getHttpHost() . $this->_request->getRequestUri());
if ($calculatedSign != $this->_protocolParams['oauth_signature']) {
$this->_throwException('', self::ERR_SIGNATURE_INVALID);
}
}