• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP w3_is_https函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中w3_is_https函数的典型用法代码示例。如果您正苦于以下问题:PHP w3_is_https函数的具体用法?PHP w3_is_https怎么用?PHP w3_is_https使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: flush

 /**
  * Flush varnish cache
  */
 function flush()
 {
     if (!is_network_admin()) {
         $this->_purge(w3_get_home_url() . '/.*');
     } else {
         global $wpdb;
         $protocall = w3_is_https() ? 'https://' : 'http://';
         // If WPMU Domain Mapping plugin is installed and active
         if (defined('SUNRISE_LOADED') && SUNRISE_LOADED && isset($wpdb->dmtable) && !empty($wpdb->dmtable)) {
             $blogs = $wpdb->get_results("SELECT {$wpdb->blogs}.domain, {$wpdb->blogs}.path, {$wpdb->dmtable}.domain AS mapped_domain\n                                    FROM {$wpdb->dmtable}\n                                    RIGHT JOIN {$wpdb->blogs} ON {$wpdb->dmtable}.blog_id = {$wpdb->blogs}.blog_id\n                                    WHERE site_id = {$wpdb->siteid}\n                                    AND spam = 0\n                                    AND deleted = 0\n                                    AND archived = '0'\n                                   ");
             foreach ($blogs as $blog) {
                 if (!isset($blog->mapped_domain)) {
                     $url = $protocall . $blog->domain . (strlen($blog->path) > 1 ? '/' . trim($blog->path, '/') : '') . '/.*';
                 } else {
                     $url = $protocall . $blog->mapped_domain . '/.*';
                 }
                 $this->_purge($url);
             }
         } else {
             if (!w3_is_subdomain_install()) {
                 $this->_purge(w3_get_home_url() . '/.*');
             } else {
                 $blogs = $wpdb->get_results("\n                                        SELECT domain, path\n                                        FROM {$wpdb->blogs}\n                                        WHERE site_id = '{$wpdb->siteid}'\n                                        AND spam = 0\n                                        AND deleted = 0\n                                        AND archived = '0'\n                                    ");
                 foreach ($blogs as $blog) {
                     $url = $protocall . $blog->domain . (strlen($blog->path) > 1 ? '/' . trim($blog->path, '/') : '') . '/.*';
                     $this->_purge($url);
                 }
             }
         }
     }
 }
开发者ID:marqui678,项目名称:finalchance.Panopta,代码行数:34,代码来源:VarnishFlush.php


示例2: w3_download

/**
 * Downloads URL into a file
 *
 * @param string $url
 * @param string $file
 * @return boolean
 */
function w3_download($url, $file)
{
    if (strpos($url, '//') === 0) {
        $url = (w3_is_https() ? 'https:' : 'http:') . $url;
    }
    $response = w3_http_get($url);
    if (!is_wp_error($response) && $response['response']['code'] == 200) {
        return @file_put_contents($file, $response['body']);
    }
    return false;
}
开发者ID:easinewe,项目名称:Avec2016,代码行数:18,代码来源:http.php


示例3: action_widget_latest_ajax

 /**
  * Prints latest widget contents
  *
  * @return void
  */
 function action_widget_latest_ajax()
 {
     // load content of feed
     global $wp_version;
     $items = array();
     $items_count = $this->_config->get_integer('widget.latest.items');
     if ($wp_version >= 2.8) {
         include_once ABSPATH . WPINC . '/feed.php';
         $feed = fetch_feed(W3TC_FEED_URL);
         if (!is_wp_error($feed)) {
             $feed_items = $feed->get_items(0, $items_count);
             foreach ($feed_items as $feed_item) {
                 $items[] = array('link' => $feed_item->get_link(), 'title' => $feed_item->get_title(), 'description' => $feed_item->get_description());
             }
         }
     } else {
         include_once ABSPATH . WPINC . '/rss.php';
         $rss = fetch_rss(W3TC_FEED_URL);
         if (is_object($rss)) {
             $items = array_slice($rss->items, 0, $items_count);
         }
     }
     // Removes feedburner tracking images when site is https
     if (w3_is_https()) {
         $total = sizeof($items);
         for ($i = 0; $i < $total; $i++) {
             if (isset($items[$i]['description'])) {
                 $items[$i]['description'] = preg_replace('/<img[^>]+src[^>]+W3TOTALCACHE[^>]+>/', '', $items[$i]['description']);
             }
         }
     }
     ob_start();
     include W3TC_INC_DIR . '/widget/latest_ajax.php';
     // Default lifetime in cache of 12 hours (same as the feeds)
     set_transient($this->_widget_latest_cache_key(), ob_get_flush(), 43200);
     die;
 }
开发者ID:rongandat,项目名称:sallumeh,代码行数:42,代码来源:Forum.php


示例4: w3_get_url_ssl

/**
 * Returns SSL URL if current connection is https
 * @param string $url
 * @return string
 */
function w3_get_url_ssl($url)
{
    if (w3_is_https()) {
        $url = str_replace('http://', 'https://', $url);
    }
    return $url;
}
开发者ID:nuevomediagroup,项目名称:nmg-code,代码行数:12,代码来源:define.php


示例5: w3_download

/**
 * Downloads data to a file
 *
 * @param string $url
 * @param string $file
 * @return boolean
 */
function w3_download($url, $file)
{
    if (strpos($url, '//') === 0) {
        $url = (w3_is_https() ? 'https:' : 'http:') . $url;
    }
    $data = w3_http_get($url);
    if ($data !== false) {
        return @file_put_contents($file, $data);
    }
    return false;
}
开发者ID:niko-lgdcom,项目名称:archives,代码行数:18,代码来源:define.php


示例6: _get_scheme

 /**
  * Returns scheme
  *
  * @return string
  */
 function _get_scheme()
 {
     switch ($this->_config['ssl']) {
         default:
         case 'auto':
             $scheme = w3_is_https() ? 'https' : 'http';
             break;
         case 'enabled':
             $scheme = 'https';
             break;
         case 'disabled':
             $scheme = 'http';
             break;
         case 'rejected':
             $scheme = 'http';
             break;
     }
     return $scheme;
 }
开发者ID:marqui678,项目名称:finalchance.Panopta,代码行数:24,代码来源:Base.php


示例7: _get_encryption

 /**
  * Returns current encryption
  *
  * @return string
  */
 function _get_encryption()
 {
     if (w3_is_https()) {
         return 'ssl';
     }
     return '';
 }
开发者ID:easinewe,项目名称:Avec2016,代码行数:12,代码来源:PgCache.php


示例8: can_cdn

 /**
  * Check if we can do CDN logic
  * @return boolean
  */
 function can_cdn()
 {
     /**
      * Skip if admin
      */
     if (defined('WP_ADMIN')) {
         $this->cdn_reject_reason = 'wp-admin';
         return false;
     }
     /**
      * Check for WPMU's and WP's 3.0 short init
      */
     if (defined('SHORTINIT') && SHORTINIT) {
         $this->cdn_reject_reason = 'Short init';
         return false;
     }
     /**
      * Check User agent
      */
     if (!$this->check_ua()) {
         $this->cdn_reject_reason = 'user agent is rejected';
         return false;
     }
     /**
      * Check request URI
      */
     if (!$this->check_request_uri()) {
         $this->cdn_reject_reason = 'request URI is rejected';
         return false;
     }
     /**
      * Do not replace urls if SSL and SSL support is do not replace
      */
     if (w3_is_https() && $this->_config->get_boolean('cdn.reject.ssl')) {
         $this->cdn_reject_reason = 'SSL is rejected';
         return false;
     }
     return true;
 }
开发者ID:marqui678,项目名称:finalchance.Panopta,代码行数:43,代码来源:Cdn.php


示例9: w3_get_site_url_ssl

/**
 * Returns SSL site url
 *
 * @return string
 */
function w3_get_site_url_ssl()
{
    $site_url = w3_get_site_url();
    if (w3_is_https()) {
        $site_url = str_replace('http:', 'https:', $site_url);
    }
    return $site_url;
}
开发者ID:alx,项目名称:SBek-Arak,代码行数:13,代码来源:define.php


示例10: format_url

 /**
  * Formats object URL
  *
  * @param string $path
  * @return string
  */
 function format_url($path)
 {
     $domain = $this->get_domain();
     if ($domain) {
         $url = sprintf('%s://%s%s', w3_is_https() ? 'https' : 'http', $domain, $path);
         return $url;
     }
     return false;
 }
开发者ID:TheReaCompany,项目名称:pooplog,代码行数:15,代码来源:Base.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP w3_is_litespeed函数代码示例发布时间:2022-05-23
下一篇:
PHP w3_is_enterprise函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap