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


PHP Zend_Controller_Request_Http::isSecure方法代码示例

本文整理汇总了PHP中Zend_Controller_Request_Http::isSecure方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Controller_Request_Http::isSecure方法的具体用法?PHP Zend_Controller_Request_Http::isSecure怎么用?PHP Zend_Controller_Request_Http::isSecure使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_Controller_Request_Http的用法示例。


在下文中一共展示了Zend_Controller_Request_Http::isSecure方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: isValid

 /**
  * See if the request the proper security
  *
  * @param  Zend_Controller_Request_Http $request The request to check
  * @return boolean
  */
 public function isValid($request)
 {
     if (!$request->isSecure()) {
         $this->_error(self::NOT_SECURE);
         return false;
     }
     return true;
 }
开发者ID:bgao-ca,项目名称:moodle-local_mr,代码行数:14,代码来源:secure.php

示例2: match

 /**
  * Overrides match to detect port
  *
  * @param Zend_Controller_Request_Http $request
  * @return array|false
  */
 public function match($request)
 {
     if ($this->hasPort()) {
         // Check that the port matches the route port
         $host = $request->getHttpHost();
         if (preg_match(self::PORT_REGEXP, $host, $m)) {
             $port = (int) $m[1];
         } else {
             // Assign a default port according to the scheme
             $port = $request->isSecure() ? 443 : 80;
         }
         if ($port !== (int) $this->getPort()) {
             return false;
         }
     }
     // Default match
     return parent::match($request);
 }
开发者ID:SandeepUmredkar,项目名称:PortalSMIP,代码行数:24,代码来源:Hostname.php

示例3: getRequestPaths

 /**
  * Gets the request paths from the specified request object.
  *
  * @param Zend_Controller_Request_Http $request
  *
  * @return array Keys: basePath, host, protocol, fullBasePath, requestUri
  */
 public static function getRequestPaths(Zend_Controller_Request_Http $request)
 {
     $basePath = $request->getBasePath();
     if ($basePath === '' || substr($basePath, -1) != '/') {
         $basePath .= '/';
     }
     $host = $request->getServer('HTTP_HOST');
     if (!$host) {
         $host = $request->getServer('SERVER_NAME');
         $serverPort = intval($request->getServer('SERVER_PORT'));
         if ($serverPort && $serverPort != 80 && $serverPort != 443) {
             $host .= ':' . $serverPort;
         }
     }
     $protocol = $request->isSecure() ? 'https' : 'http';
     $requestUri = $request->getRequestUri();
     return array('basePath' => $basePath, 'host' => $host, 'protocol' => $protocol, 'fullBasePath' => $protocol . '://' . $host . $basePath, 'requestUri' => $requestUri, 'fullUri' => $protocol . '://' . $host . $requestUri);
 }
开发者ID:hahuunguyen,项目名称:DTUI_201105,代码行数:25,代码来源:Application.php

示例4: _initZendX

 protected function _initZendX()
 {
     $view = new Zend_View();
     $website = Zend_Registry::get('website');
     $misc = Zend_Registry::get('misc');
     $url = preg_replace('~^https?://~', '', $website['url']);
     $request = new Zend_Controller_Request_Http();
     $protocol = $request->getScheme();
     $view->addHelperPath('ZendX/JQuery/View/Helper/', 'ZendX_JQuery_View_Helper');
     if ($misc['jquery'] == 'local') {
         $view->jQuery()->setLocalPath($protocol . '://' . $url . 'system/js/external/jquery/jquery.js');
     } else {
         $view->jQuery()->setCdnSsl($request->isSecure())->setVersion($misc['jqversion']);
     }
     if ($misc['jqueryui'] == 'local') {
         $view->jQuery()->setUiLocalPath($protocol . '://' . $url . 'system/js/external/jquery/jquery-ui.js');
     } else {
         $view->jQuery()->setUiVersion($misc['jquversion']);
     }
     $viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer($view);
     Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);
 }
开发者ID:PavloKovalov,项目名称:seotoaster,代码行数:22,代码来源:Bootstrap.php

示例5: _checkShouldBeSecure

 /**
  * Check that request uses https protocol if it should.
  * Function redirects user to correct URL if needed.
  *
  * @param Zend_Controller_Request_Http $request
  * @param string $path
  * @return void
  */
 protected function _checkShouldBeSecure(Zend_Controller_Request_Http $request, $path = '')
 {
     if (!Mage::isInstalled() || $request->getPost()) {
         return;
     }
     if ($this->_shouldBeSecure($path) && !$request->isSecure()) {
         $url = $this->_getCurrentSecureUrl($request);
         if ($this->_shouldRedirectToSecure()) {
             $url = Mage::getSingleton('Mage_Core_Model_Url')->getRedirectUrl($url);
         }
         Mage::app()->getFrontController()->getResponse()->setRedirect($url)->sendResponse();
         exit;
     }
 }
开发者ID:,项目名称:,代码行数:22,代码来源:


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