本文整理汇总了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;
}
示例2: getHostUrl
public function getHostUrl()
{
if (waRequest::isHttps()) {
$url = 'https://';
} else {
$url = 'http://';
}
$url .= waRequest::server('HTTP_HOST');
return $url;
}
示例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;
}
示例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.'));
}
}
}