当前位置: 首页>>代码示例>>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;未经允许,请勿转载。