當前位置: 首頁>>代碼示例>>PHP>>正文


PHP waRequest::isHttps方法代碼示例

本文整理匯總了PHP中waRequest::isHttps方法的典型用法代碼示例。如果您正苦於以下問題:PHP waRequest::isHttps方法的具體用法?PHP waRequest::isHttps怎麽用?PHP waRequest::isHttps使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在waRequest的用法示例。


在下文中一共展示了waRequest::isHttps方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: checkRights

 public function checkRights($module, $action)
 {
     if ($module == 'frontend' && waRequest::param('ssl') && (strpos($action, 'my') === 0 || $action === 'checkout')) {
         if (!waRequest::isHttps()) {
             $url = 'https://' . waRequest::server('HTTP_HOST') . wa()->getConfig()->getCurrentUrl();
             wa()->getResponse()->redirect($url, 301);
         }
     } elseif ($module == 'order' || $module == 'orders') {
         return wa()->getUser()->getRights('shop', 'orders');
     }
     return true;
 }
開發者ID:Lazary,項目名稱:webasyst,代碼行數:12,代碼來源:shopConfig.class.php

示例2: getHostUrl

 public function getHostUrl()
 {
     if (waRequest::isHttps()) {
         $url = 'https://';
     } else {
         $url = 'http://';
     }
     $url .= waRequest::server('HTTP_HOST');
     return $url;
 }
開發者ID:Lazary,項目名稱:webasyst,代碼行數:10,代碼來源:waSystemConfig.class.php

示例3: getUrlByRoute

 /**
  * @static
  * @param array $route
  * @param string $domain
  * @return string
  */
 public static function getUrlByRoute($route, $domain = null)
 {
     $url = self::clearUrl($route['url']);
     if ($domain) {
         if (parse_url($domain, PHP_URL_HOST) == waRequest::server('HTTP_HOST')) {
             $https = waRequest::isHttps();
         } else {
             $https = false;
         }
         return 'http' . ($https ? 's' : '') . '://' . self::getDomainUrl($domain) . '/' . $url;
     }
     return $url;
 }
開發者ID:Favorskij,項目名稱:webasyst-framework,代碼行數:19,代碼來源:waRouting.class.php

示例4: getStaticFiles

 /**
  * Prepare favicon and robots.txt
  * 
  * @param string $domain
  */
 protected function getStaticFiles($domain)
 {
     $path = wa()->getDataPath(null, true) . '/data/' . $domain . '/favicon.ico';
     if (file_exists($path)) {
         $favicon = wa()->getDataUrl('data/' . $domain . '/favicon.ico', true);
     } else {
         $favicon = 'http' . (waRequest::isHttps() ? 's' : '') . '://' . $domain . '/favicon.ico';
     }
     $path = wa()->getDataPath(null, true) . '/data/' . $domain . '/apple-touch-icon.png';
     if (file_exists($path)) {
         $touchicon = wa()->getDataUrl('data/' . $domain . '/apple-touch-icon.png', true);
     } else {
         $touchicon = false;
     }
     $path = wa()->getDataPath(null, true) . '/data/' . $domain . '/robots.txt';
     if (file_exists($path)) {
         $robots = file_get_contents($path);
     } else {
         $robots = '';
     }
     $this->view->assign('robots', $robots);
     $this->view->assign('favicon', $favicon);
     $this->view->assign('touchicon', $touchicon);
     if (strpos($domain, '/') !== false) {
         $this->view->assign('touchicon_message', sprintf(_w('Touch icon you upload here will not take effect for you website %s because your website is set for a subfolder on a domain. Touch icon uploaded using the form above will be set only for websites set from the domain root folder.'), $domain));
         $this->view->assign('favicon_message', sprintf(_w('Favicon image you upload here will not take effect for you website %s because your website is set for a subfolder on a domain. Favicon uploaded using the form above will be set only for websites set from the domain root folder.'), $domain));
         $this->view->assign('robots_message', sprintf(_w('Rules you set above for robots.txt will not take effect for you website %s because your website is set for a subfolder on a domain. Rules for robots.txt from the form above will be effective only for websites set to the domain root folder.'), $domain));
     } else {
         $root_path = $this->getConfig()->getRootPath();
         if (file_exists($root_path . '/favicon.ico')) {
             $this->view->assign('favicon_message', _w('File favicon.ico exists in the Webasyst framework installation folder. The favicon you upload here will be overridden by the icon uploaded as file unless you delete this file.'));
         }
         if (file_exists($root_path . '/apple-touch-icon.png')) {
             $this->view->assign('touchicon_message', _w('File apple-touch-icon.png exists in the Webasyst framework installation folder. The touch icon you upload here will be overridden by the icon uploaded as file unless you delete this file.'));
         }
         if (file_exists($root_path . '/robots.txt')) {
             $this->view->assign('robots_message', _w('File robots.txt exists in the Webasyst framework installation folder. Rules for robots.txt you specify above will not take effect unless you delete this file.'));
         }
     }
 }
開發者ID:cjmaximal,項目名稱:webasyst-framework,代碼行數:45,代碼來源:siteSettings.action.php


注:本文中的waRequest::isHttps方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。