本文整理汇总了PHP中Util_Environment::remove_query方法的典型用法代码示例。如果您正苦于以下问题:PHP Util_Environment::remove_query方法的具体用法?PHP Util_Environment::remove_query怎么用?PHP Util_Environment::remove_query使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Util_Environment
的用法示例。
在下文中一共展示了Util_Environment::remove_query方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: create_addin
/**
* Creates add-in
*
* @throws Util_WpFile_FilesystemOperationException
*/
private function create_addin()
{
$src = W3TC_INSTALL_FILE_DB;
$dst = W3TC_ADDIN_FILE_DB;
if ($this->db_installed()) {
if ($this->is_dbcache_add_in()) {
$script_data = @file_get_contents($dst);
if ($script_data == @file_get_contents($src)) {
return;
}
} else {
if (get_transient('w3tc_remove_add_in_dbcache') == 'yes') {
// user already manually asked to remove another plugin's add in,
// we should try to apply ours
// (in case of missing permissions deletion could fail)
} else {
if (!$this->db_check_old_add_in()) {
if (isset($_GET['page'])) {
$url = 'admin.php?page=' . $_GET['page'] . '&';
} else {
$url = basename(Util_Environment::remove_query($_SERVER['REQUEST_URI'])) . '?page=w3tc_dashboard&';
}
$remove_url = Util_Ui::admin_url($url . 'w3tc_default_remove_add_in=dbcache');
throw new Util_WpFile_FilesystemOperationException(sprintf(__('The Database add-in file db.php is not a W3 Total Cache drop-in.
Remove it or disable Database Caching. %s', 'w3-total-cache'), Util_Ui::button_link(__('Remove it for me', 'w3-total-cache'), wp_nonce_url($remove_url, 'w3tc'))));
}
}
}
}
Util_WpFile::copy_file($src, $dst);
}
示例2: _url_has_to_be_replaced
function _url_has_to_be_replaced($url, $extension)
{
static $extensions = null;
if ($extensions === null) {
$core = Dispatcher::component('BrowserCache_Core');
$extensions = $core->get_replace_extensions($this->_config);
}
static $exceptions = null;
if ($exceptions === null) {
$exceptions = $this->_config->get_array('browsercache.replace.exceptions');
}
if (!in_array($extension, $extensions)) {
return false;
}
$test_url = Util_Environment::remove_query($url);
foreach ($exceptions as $exception) {
if (trim($exception) && preg_match('~' . $exception . '~', $test_url)) {
return false;
}
}
return true;
}