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


PHP w3_get_host函数代码示例

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


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

示例1: get_imported_legacy_config_keys

 /**
  * Reads legacy config file
  * @param int $blog_id
  * @param bool $force_master
  * @return array
  */
 public function get_imported_legacy_config_keys($blog_id, $force_master = false)
 {
     $suffix = '';
     if ($force_master) {
     } else {
         if ($blog_id > 0) {
             if (w3_is_network()) {
                 if (w3_is_subdomain_install()) {
                     $suffix = '-' . w3_get_domain(w3_get_host());
                 } else {
                     // try subdir blog
                     $request_uri = rtrim($_SERVER['REQUEST_URI'], '/');
                     $site_home_uri = w3_get_base_path();
                     if (substr($request_uri, 0, strlen($site_home_uri)) == $site_home_uri) {
                         $request_path_in_wp = '/' . substr($request_uri, strlen($site_home_uri));
                         $n = strpos($request_path_in_wp, '/', 1);
                         if ($n === false) {
                             $blog_path_in_wp = substr($request_path_in_wp, 1);
                         } else {
                             $blog_path_in_wp = substr($request_path_in_wp, 1, $n - 1);
                         }
                         $suffix = '-' . ($blog_path_in_wp != 'wp-admin' ? $blog_path_in_wp . '.' : '') . w3_get_domain(w3_get_host());
                     }
                 }
             }
         }
     }
     $filename = WP_CONTENT_DIR . '/w3-total-cache-config' . $suffix . '.php';
     $legacy_config = W3_ConfigData::get_array_from_file($filename);
     if (is_array($legacy_config) && isset($legacy_config['pgcache.engine']) && $legacy_config['pgcache.engine'] == 'file_pgcache') {
         $legacy_config['pgcache.engine'] = 'file_generic';
     }
     return $legacy_config;
 }
开发者ID:easinewe,项目名称:Avec2016,代码行数:40,代码来源:ConfigCompatibility.php

示例2: _get_origin

 /**
  * Returns origin
  *
  * @return string
  */
 function _get_origin()
 {
     if ($this->type == W3TC_CDN_CF_TYPE_S3) {
         $origin = sprintf('%s.s3.amazonaws.com', $this->_config['bucket']);
     } else {
         $origin = w3_get_host();
     }
     return $origin;
 }
开发者ID:beetleskin,项目名称:kathen,代码行数:14,代码来源:Cf.php

示例3: action_payment_code

 function action_payment_code()
 {
     w3_require_once(W3TC_LIB_W3_DIR . '/Request.php');
     $request_type = W3_Request::get_string('request_type');
     $request_id = date('YmdHi');
     $return_url = admin_url('admin.php?page=w3tc_support&request_type=' . $request_type . '&payment=1&request_id=' . $request_id);
     $cancel_url = admin_url('admin.php?page=w3tc_dashboard');
     $form_values = array("cmd" => "_xclick", "business" => W3TC_PAYPAL_BUSINESS, "item_name" => esc_attr(sprintf('%s: %s (#%s)', ucfirst(w3_get_host()), $this->_json_request_types[$request_type], $request_id)), "amount" => sprintf('%.2f', $this->_request_prices[$request_type]), "currency_code" => "USD", "no_shipping" => "1", "rm" => "2", "return" => esc_attr($return_url), "cancel_return" => esc_attr($cancel_url));
     echo json_encode($form_values);
     die;
 }
开发者ID:jfbelisle,项目名称:magexpress,代码行数:11,代码来源:Services.php

示例4: cleanup_local

 function cleanup_local()
 {
     $engine = $this->_config->get_string('pgcache.engine');
     switch ($engine) {
         case 'file':
             w3_require_once(W3TC_LIB_W3_DIR . '/Cache/File/Cleaner.php');
             $w3_cache_file_cleaner = new W3_Cache_File_Cleaner(array('cache_dir' => w3_cache_blog_dir('page'), 'clean_timelimit' => $this->_config->get_integer('timelimit.cache_gc')));
             $w3_cache_file_cleaner->clean();
             break;
         case 'file_generic':
             w3_require_once(W3TC_LIB_W3_DIR . '/Cache/File/Cleaner/Generic.php');
             if (w3_get_blog_id() == 0) {
                 $flush_dir = W3TC_CACHE_PAGE_ENHANCED_DIR;
             } else {
                 $flush_dir = W3TC_CACHE_PAGE_ENHANCED_DIR . '/' . w3_get_domain(w3_get_host());
             }
             $w3_cache_file_cleaner_generic = new W3_Cache_File_Cleaner_Generic(array('exclude' => array('.htaccess'), 'cache_dir' => $flush_dir, 'expire' => $this->_config->get_integer('browsercache.html.lifetime'), 'clean_timelimit' => $this->_config->get_integer('timelimit.cache_gc')));
             $w3_cache_file_cleaner_generic->clean();
             break;
     }
 }
开发者ID:novichkovv,项目名称:candoweightloss,代码行数:21,代码来源:PgCacheAdmin.php

示例5: sprintf

?>
</p>

        <p><strong>Price: <?php 
echo sprintf('%.2f', $this->_request_prices[$request_type]);
?>
 USD</strong></p>

        <p>
            <input type="hidden" name="cmd" value="_xclick" />
            <input type="hidden" name="business" value="<?php 
echo W3TC_PAYPAL_BUSINESS;
?>
" />
            <input type="hidden" name="item_name" value="<?php 
echo htmlspecialchars(sprintf('%s: %s (#%s)', ucfirst(w3_get_host()), $this->_request_types[$request_type], $request_id));
?>
" />
            <input type="hidden" name="amount" value="<?php 
echo sprintf('%.2f', $this->_request_prices[$request_type]);
?>
" />
            <input type="hidden" name="currency_code" value="USD" />
            <input type="hidden" name="no_shipping" value="1" />
            <input type="hidden" name="rm" value="2" />
            <input type="hidden" name="return" value="<?php 
echo htmlspecialchars($return_url);
?>
" />
            <input type="hidden" name="cancel_return" value="<?php 
echo htmlspecialchars($cancel_url);
开发者ID:nxtclass,项目名称:NXTClass,代码行数:31,代码来源:payment.php

示例6: htmlspecialchars

                </td>
            </tr>
            <tr>
                <th><label for="cloudflare_key"><acronym title="Application Programming Interface">API</acronym> key:</label></th>
                <td>
                    <input id="cloudflare_key" class="w3tc-ignore-change" type="password" name="cloudflare.key" value="<?php 
echo htmlspecialchars($this->_config->get_string('cloudflare.key'));
?>
" size="60" /> (<a href="https://www.cloudflare.com/my-account.html">find it here</a>)
                </td>
            </tr>
            <tr>
                <th>Domain:</th>
                <td>
                    <input id="cloudflare_zone" type="text" name="cloudflare.zone" value="<?php 
echo htmlspecialchars($this->_config->get_string('cloudflare.zone', w3_get_host()));
?>
" size="40" />
                </td>
            </tr>
            <tr>
                <th>Security level:</th>
                <td>
                    <input type="hidden" name="cloudflare_seclvl_old" value="<?php 
echo $cloudflare_seclvl;
?>
" />
                    <select name="cloudflare_seclvl_new" class="w3tc-ignore-change">
                        <?php 
foreach ($cloudflare_seclvls as $cloudflare_seclvl_key => $cloudflare_seclvl_label) {
    ?>
开发者ID:pyropictures,项目名称:wordpress-plugins,代码行数:31,代码来源:general.php

示例7: _get_cache

 /**
  * Returns cache object
  *
  * @param null $blog_id
  * @param string $group
  * @return W3_Cache_Base
  */
 function _get_cache($blog_id = null, $group = 'transient')
 {
     static $cache = array();
     if (is_null($blog_id) && $group != 'site-transient') {
         $blog_id = $this->_blog_id;
     } else {
         $blog_id = 0;
     }
     if (!isset($cache[$blog_id])) {
         $engine = $this->_config->get_string('fragmentcache.engine');
         switch ($engine) {
             case 'memcached':
                 $engineConfig = array('servers' => $this->_config->get_array('fragmentcache.memcached.servers'), 'persistant' => $this->_config->get_boolean('fragmentcache.memcached.persistant'));
                 break;
             case 'file':
                 $engineConfig = array('section' => 'fragment', 'locking' => $this->_config->get_boolean('fragmentcache.file.locking'), 'flush_timelimit' => $this->_config->get_integer('timelimit.cache_flush'));
                 break;
             default:
                 $engineConfig = array();
         }
         $engineConfig['blog_id'] = $blog_id;
         $engineConfig['module'] = 'fragmentcache';
         $engineConfig['host'] = w3_get_host();
         $engineConfig['instance_id'] = w3_get_instance_id();
         w3_require_once(W3TC_LIB_W3_DIR . '/Cache.php');
         $cache[$blog_id] = W3_Cache::instance($engine, $engineConfig);
     }
     return $cache[$blog_id];
 }
开发者ID:novichkovv,项目名称:candoweightloss,代码行数:36,代码来源:FragmentCache.php

示例8: _get_cache

 /**
  * Returns cache object
  *
  * @return W3_Cache_Base
  */
 function _get_cache()
 {
     static $cache = array();
     if (!isset($cache[0])) {
         $engine = $this->_config->get_string('pgcache.engine');
         switch ($engine) {
             case 'memcached':
                 $engineConfig = array('servers' => $this->_config->get_array('pgcache.memcached.servers'), 'persistant' => $this->_config->get_boolean('pgcache.memcached.persistant'));
                 break;
             case 'file':
                 $engineConfig = array('section' => 'page', 'flush_parent' => w3_get_blog_id() == 0, 'locking' => $this->_config->get_boolean('pgcache.file.locking'), 'flush_timelimit' => $this->_config->get_integer('timelimit.cache_flush'));
                 break;
             case 'file_generic':
                 if (w3_get_blog_id() == 0) {
                     $flush_dir = W3TC_CACHE_PAGE_ENHANCED_DIR;
                 } else {
                     $flush_dir = W3TC_CACHE_PAGE_ENHANCED_DIR . '/' . w3_get_domain(w3_get_host());
                 }
                 $engineConfig = array('exclude' => array('.htaccess'), 'expire' => $this->_lifetime, 'cache_dir' => W3TC_CACHE_PAGE_ENHANCED_DIR, 'locking' => $this->_config->get_boolean('pgcache.file.locking'), 'flush_timelimit' => $this->_config->get_integer('timelimit.cache_flush'), 'flush_dir' => $flush_dir);
                 break;
             default:
                 $engineConfig = array();
         }
         $engineConfig['use_expired_data'] = true;
         $engineConfig['module'] = 'pgcache';
         $engineConfig['host'] = w3_get_host();
         $engineConfig['instance_id'] = w3_get_instance_id();
         w3_require_once(W3TC_LIB_W3_DIR . '/Cache.php');
         $cache[0] = W3_Cache::instance($engine, $engineConfig);
     }
     return $cache[0];
 }
开发者ID:easinewe,项目名称:Avec2016,代码行数:37,代码来源:PgCache.php

示例9: htmlspecialchars

	<td>
		<input id="cdn_cf2_secret" class="w3tc-ignore-change"
                       <?php 
$this->sealing_disabled('cdn');
?>
 type="password" name="cdn.cf2.secret" value="<?php 
echo htmlspecialchars($this->_config->get_string('cdn.cf2.secret'));
?>
" size="60" />
	</td>
</tr>
<tr>
	<th>Origin:</th>
	<td>
		<?php 
echo w3_get_host();
?>
		<input id="cdn_create_container"
                       <?php 
$this->sealing_disabled('cdn');
?>
 class="button {type: 'cf2', nonce: '<?php 
echo wp_create_nonce('w3tc');
?>
'}" type="button" value="Create distribution" />
        <span id="cdn_create_container_status" class="w3tc-status w3tc-process"></span>
	</td>
</tr>
<tr>
	<th><label for="cdn_cf2_ssl"><acronym title="Secure Sockets Layer">SSL</acronym> support:</label></th>
	<td>
开发者ID:marqui678,项目名称:finalchance.Panopta,代码行数:31,代码来源:cf2.php

示例10: _import_legacy_config

 /**
  * Reads legacy config file
  *
  * @param object $compiled_config
  * @return array
  */
 private function _import_legacy_config($compiled_config)
 {
     $suffix = '';
     if ($this->_blog_id > 0) {
         if (w3_is_network()) {
             if (w3_is_subdomain_install()) {
                 $suffix = '-' . w3_get_domain(w3_get_host());
             } else {
                 // try subdir blog
                 $request_uri = rtrim($_SERVER['REQUEST_URI'], '/');
                 $site_home_uri = w3_get_base_path();
                 if (substr($request_uri, 0, strlen($site_home_uri)) == $site_home_uri) {
                     $request_path_in_wp = '/' . substr($request_uri, strlen($site_home_uri));
                     $n = strpos($request_path_in_wp, '/', 1);
                     if ($n === false) {
                         $blog_path_in_wp = substr($request_path_in_wp, 1);
                     } else {
                         $blog_path_in_wp = substr($request_path_in_wp, 1, $n - 1);
                     }
                     $suffix = '-' . ($blog_path_in_wp != 'wp-admin' ? $blog_path_in_wp . '.' : '') . w3_get_domain(w3_get_host());
                 }
             }
         }
     }
     $filename = WP_CONTENT_DIR . '/w3-total-cache-config' . $suffix . '.php';
     return $compiled_config->get_array_from_file($filename);
 }
开发者ID:marqui678,项目名称:finalchance.Panopta,代码行数:33,代码来源:ConfigWriter.php

示例11: _get_cache

 /**
  * Returns minify cache object
  *
  * @return object
  */
 function _get_cache()
 {
     static $cache = array();
     if (!isset($cache[0])) {
         switch ($this->_config->get_string('minify.engine')) {
             case 'memcached':
                 w3_require_once(W3TC_LIB_W3_DIR . '/Cache/Memcached.php');
                 w3_require_once(W3TC_LIB_MINIFY_DIR . '/Minify/Cache/Memcache.php');
                 $w3_cache_memcached = new W3_Cache_Memcached(array('blog_id' => w3_get_blog_id(), 'instance_id' => w3_get_instance_id(), 'host' => w3_get_host(), 'module' => 'minify', 'servers' => $this->_config->get_array('minify.memcached.servers'), 'persistant' => $this->_config->get_boolean('minify.memcached.persistant')));
                 $cache[0] = new Minify_Cache_Memcache($w3_cache_memcached, 0, w3_get_blog_id(), w3_get_instance_id());
                 break;
             case 'apc':
                 w3_require_once(W3TC_LIB_MINIFY_DIR . '/Minify/Cache/APC.php');
                 $cache[0] = new Minify_Cache_APC(0, w3_get_blog_id(), w3_get_instance_id());
                 break;
             case 'eaccelerator':
                 w3_require_once(W3TC_LIB_MINIFY_DIR . '/Minify/Cache/Eaccelerator.php');
                 $cache[0] = new Minify_Cache_Eaccelerator(0, w3_get_blog_id(), w3_get_instance_id());
                 break;
             case 'xcache':
                 w3_require_once(W3TC_LIB_MINIFY_DIR . '/Minify/Cache/XCache.php');
                 $cache[0] = new Minify_Cache_XCache(0, w3_get_blog_id(), w3_get_instance_id());
                 break;
             case 'wincache':
                 w3_require_once(W3TC_LIB_MINIFY_DIR . '/Minify/Cache/Wincache.php');
                 $cache[0] = new Minify_Cache_Wincache(0, w3_get_blog_id(), w3_get_instance_id());
                 break;
             case 'file':
             default:
                 w3_require_once(W3TC_LIB_MINIFY_DIR . '/Minify/Cache/File.php');
                 $cache[0] = new Minify_Cache_File(w3_cache_blog_dir('minify'), array('.htaccess', 'index.php', '*.old'), $this->_config->get_boolean('minify.file.locking'), $this->_config->get_integer('timelimit.cache_flush'), w3_get_blog_id() == 0 ? W3TC_CACHE_MINIFY_DIR : null);
                 break;
         }
     }
     return $cache[0];
 }
开发者ID:easinewe,项目名称:Avec2016,代码行数:41,代码来源:Minify.php

示例12: _get_cache

 /**
  * Returns cache object
  *
  * @return W3_Cache_Base
  */
 function _get_cache()
 {
     static $cache = array();
     if (!isset($cache[0])) {
         $engine = $this->_config->get_string('dbcache.engine');
         switch ($engine) {
             case 'memcached':
                 $engineConfig = array('servers' => $this->_config->get_array('dbcache.memcached.servers'), 'persistant' => $this->_config->get_boolean('dbcache.memcached.persistant'));
                 break;
             case 'file':
                 $engineConfig = array('use_wp_hash', true, 'section' => 'db', 'locking' => $this->_config->get_boolean('dbcache.file.locking'), 'flush_timelimit' => $this->_config->get_integer('timelimit.cache_flush'));
                 break;
             default:
                 $engineConfig = array();
         }
         $engineConfig['module'] = 'dbcache';
         $engineConfig['host'] = w3_get_host();
         $engineConfig['instance_id'] = w3_get_instance_id();
         w3_require_once(W3TC_LIB_W3_DIR . '/Cache.php');
         $cache[0] = W3_Cache::instance($engine, $engineConfig);
     }
     return $cache[0];
 }
开发者ID:gumbysgoo,项目名称:bestilblomster,代码行数:28,代码来源:DbCache.php

示例13: _e

    ?>
</a>)
                </td>
            </tr>
            <tr>
                <th><?php 
    _e('Domain:', 'w3-total-cache');
    ?>
</th>
                <td>
                    <input id="cloudflare_zone" type="text" name="cloudflare.zone"
                        <?php 
    $this->sealing_disabled('cloudflare');
    ?>
                        value="<?php 
    echo esc_attr($this->_config->get_string('cloudflare.zone', w3_get_host()));
    ?>
" size="40" />
                </td>
            </tr>
            <tr>
                <th><?php 
    _e('Security level:', 'w3-total-cache');
    ?>
</th>
                <td>
                    <input type="hidden" name="cloudflare_sec_lvl_old" value="<?php 
    echo $cloudflare_seclvl;
    ?>
" />
                    <select name="cloudflare_sec_lvl_new"
开发者ID:gumbysgoo,项目名称:bestilblomster,代码行数:31,代码来源:general.php

示例14: sprintf

?>
</p>
		
		<p><strong><?php 
echo sprintf(__('Price: %.2f USD', 'w3-total-cache'), $this->_request_prices[$request_type]);
?>
</strong></p>

        <p>
            <input type="hidden" name="cmd" value="_xclick" />
            <input type="hidden" name="business" value="<?php 
echo W3TC_PAYPAL_BUSINESS;
?>
" />
            <input type="hidden" name="item_name" value="<?php 
echo esc_attr(sprintf('%s: %s (#%s)', ucfirst(w3_get_host()), $this->_request_types[$request_type], $request_id));
?>
" />
            <input type="hidden" name="amount" value="<?php 
echo sprintf('%.2f', $this->_request_prices[$request_type]);
?>
" />
            <input type="hidden" name="currency_code" value="USD" />
            <input type="hidden" name="no_shipping" value="1" />
            <input type="hidden" name="rm" value="2" />
            <input type="hidden" name="return" value="<?php 
echo esc_attr($return_url);
?>
" />
            <input type="hidden" name="cancel_return" value="<?php 
echo esc_attr($cancel_url);
开发者ID:gumbysgoo,项目名称:bestilblomster,代码行数:31,代码来源:payment.php

示例15: extension

 /**
  * @param $extensions
  * @param W3_Config $config
  * @return mixed
  */
 function extension($extensions, $config)
 {
     global $current_user;
     $message = array();
     $message[] = 'CloudFlare';
     $cloudflare_signup_email = '';
     $cloudflare_signup_user = '';
     if (is_a($current_user, 'WP_User')) {
         if ($current_user->user_email) {
             $cloudflare_signup_email = $current_user->user_email;
         }
         if ($current_user->user_login && $current_user->user_login != 'admin') {
             $cloudflare_signup_user = $current_user->user_login;
         }
     }
     $extensions['cloudflare'] = array('name' => 'CloudFlare', 'author' => 'W3 EDGE', 'description' => sprintf(__('CloudFlare protects and accelerates websites. <a href="%s" target="_blank">Sign up now for free</a> to get started,
     	or if you have an account simply log in to obtain your <abbr title="Application Programming Interface">API</abbr> key from the <a target="_blank" href="https://www.cloudflare.com/my-account">account page</a> to enter it on the General Settings box that appears after plugin activation.
     	Contact the CloudFlare <a href="http://www.cloudflare.com/help.html" target="_blank">support team</a> with any questions.', 'w3-total-cache'), 'https://www.cloudflare.com/sign-up.html?affiliate=w3edge&amp;seed_domain=' . w3_get_host() . '&amp;email=' . htmlspecialchars($cloudflare_signup_email) . '&amp;username=' . htmlspecialchars($cloudflare_signup_user)), 'author uri' => 'http://www.w3-edge.com/', 'extension uri' => 'http://www.w3-edge.com/', 'extension id' => 'cloudflare', 'version' => '1.0', 'enabled' => true, 'requirements' => implode(', ', $message), 'path' => 'w3-total-cache/extensions/CloudFlare.php');
     return $extensions;
 }
开发者ID:jfbelisle,项目名称:magexpress,代码行数:25,代码来源:CloudFlareAdmin.php


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