本文整理汇总了PHP中W3_Request::get_integer方法的典型用法代码示例。如果您正苦于以下问题:PHP W3_Request::get_integer方法的具体用法?PHP W3_Request::get_integer怎么用?PHP W3_Request::get_integer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类W3_Request
的用法示例。
在下文中一共展示了W3_Request::get_integer方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: action_new_relic_view_new_relic_app
/**
* New Relic tab
*/
function action_new_relic_view_new_relic_app()
{
$nerser = w3_instance('W3_NewRelicService');
$view_application = W3_Request::get_integer('view_application', 0);
$dashboard = '';
if ($view_application) {
$dashboard = $nerser->get_dashboard($view_application);
}
echo $dashboard;
}
示例2: change_filename_length
function change_filename_length()
{
try {
w3_require_once(W3TC_LIB_W3_DIR . '/Request.php');
$new = W3_Request::get_integer('maxlength');
$this->_config->set('minify.auto.filename_length', $new);
set_transient('w3tc_minify_tested_filename_length', true, 3600 * 24);
$this->_config->save();
w3_require_once(W3TC_LIB_MINIFY_DIR . '/Minify/Cache/File.php');
$cache = 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);
$cache->flush();
echo 1;
} catch (Exception $ex) {
echo $ex->getMessage();
}
exit;
}
示例3: read_request
/**
* Reads config from request
*/
function read_request()
{
require_once W3TC_LIB_W3_DIR . '/Request.php';
$request = W3_Request::get_request();
foreach ($this->_keys as $key => $type) {
$request_key = str_replace('.', '_', $key);
if (!isset($request[$request_key])) {
continue;
}
switch ($type) {
case 'string':
$this->set($key, W3_Request::get_string($request_key));
break;
case 'int':
case 'integer':
$this->set($key, W3_Request::get_integer($request_key));
break;
case 'float':
case 'double':
$this->set($key, W3_Request::get_double($request_key));
break;
case 'bool':
case 'boolean':
$this->set($key, W3_Request::get_boolean($request_key));
break;
case 'array':
$this->set($key, W3_Request::get_array($request_key));
break;
}
}
}
示例4: action_flush_pgcache_purge_page
/**
* PgCache purge page
*
* @return void
*/
function action_flush_pgcache_purge_page()
{
w3_require_once(W3TC_LIB_W3_DIR . '/Request.php');
$post_id = W3_Request::get_integer('post_id');
do_action('w3tc_purge_from_pgcache', $post_id);
w3_admin_redirect(array('w3tc_note' => 'pgcache_purge_page'), true);
}
示例5: action_cdn_purge_attachment
/**
* CDN Purge Post
*
* @return void
*/
function action_cdn_purge_attachment()
{
w3_require_once(W3TC_LIB_W3_DIR . '/Request.php');
$results = array();
$attachment_id = W3_Request::get_integer('attachment_id');
$w3_plugin_cdn = w3_instance('W3_Plugin_CdnAdmin');
if ($w3_plugin_cdn->purge_attachment($attachment_id, $results)) {
w3_admin_redirect(array('w3tc_note' => 'cdn_purge_attachment'), true);
} else {
w3_admin_redirect(array('w3tc_error' => 'cdn_purge_attachment'), true);
}
}
示例6: pgcache_purge_page
/**
* PgCache purge page
*
* @return void
*/
function pgcache_purge_page()
{
require_once W3TC_LIB_W3_DIR . '/Request.php';
require_once W3TC_LIB_W3_DIR . '/PgCache.php';
$post_id = W3_Request::get_integer('post_id');
$w3_pgcache =& W3_PgCache::instance();
if ($w3_pgcache->flush_post($post_id)) {
$this->redirect(array('w3tc_note' => 'pgcache_purge_page'), true);
} else {
$this->redirect(array('w3tc_error' => 'pgcache_purge_page'), true);
}
}
示例7: action_cdn_use_netdna_maxcdn_pull_zone
/**
* Configures the plugin to use the zone id provided in request
*/
function action_cdn_use_netdna_maxcdn_pull_zone()
{
w3_require_once(W3TC_LIB_W3_DIR . '/Request.php');
w3_require_once(W3TC_LIB_NETDNA_DIR . '/NetDNA.php');
$cdn_engine = W3_Request::get_string('type');
$this->validate_cdnengine_is_netdna_maxcdn($cdn_engine);
$authorization_key = W3_Request::get_string('authorization_key');
$this->validate_authorization_key($authorization_key);
$zone_id = W3_Request::get_integer('zone_id');
$keys = explode('+', $authorization_key);
list($alias, $consumer_key, $consumer_secret) = $keys;
$api = new NetDNA($alias, $consumer_key, $consumer_secret);
$this->validate_account($api);
try {
$pull_zone = $api->get_zone($zone_id);
if ($pull_zone) {
$custom_domains = $api->get_custom_domains($pull_zone['id']);
if (sizeof($custom_domains) > 0) {
$result = array('result' => 'valid', 'cnames' => array($custom_domains));
$test = true;
foreach ($custom_domains as $url) {
$test = $test && $this->test_cdn_url($url);
}
if ($test) {
$this->_config->set("cdn.enabled", true);
}
} else {
$name = $pull_zone['name'];
$result = array('result' => 'valid', 'cnames' => array("{$name}.{$alias}.netdna-cdn.com"));
$test = $this->test_cdn_url("{$name}.{$alias}.netdna-cdn.com");
if ($test) {
$this->_config->set("cdn.enabled", true);
}
}
$this->_config->set("cdn.enabled", true);
$this->_config->set("cdn.{$cdn_engine}.zone_id", $pull_zone['id']);
$this->_config->set("cdn.{$cdn_engine}.domain", $result['cnames']);
$this->_config->save();
} else {
$result = array('result' => 'error', 'message' => sprintf(__('The provided zone id was not connected to the provided authorization key.', 'w3-total-cache')));
}
} catch (Exception $ex) {
$result = array('result' => 'error', 'message' => $ex->getMessage());
}
echo json_encode($result);
exit;
}
示例8: widget_latest_control
/**
* Latest widget control
*
* @param integer $widget_id
* @param array $form_inputs
* @return void
*/
function widget_latest_control($widget_id, $form_inputs = array())
{
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
w3_require_once(W3TC_LIB_W3_DIR . '/Request.php');
$this->_config->set('widget.latest.items', W3_Request::get_integer('w3tc_widget_latest_items', 3));
$this->_config->save();
delete_transient($this->_widget_latest_cache_key());
}
include W3TC_INC_DIR . '/widget/latest_control.php';
}
示例9: cdn_rename_domain_process
/**
* CDN rename domain process
*/
function cdn_rename_domain_process()
{
set_time_limit(1000);
require_once W3TC_LIB_W3_DIR . '/Request.php';
require_once W3TC_LIB_W3_DIR . '/Plugin/Cdn.php';
$w3_plugin_cdn =& W3_Plugin_Cdn::instance();
$limit = W3_Request::get_integer('limit');
$offset = W3_Request::get_integer('offset');
$names = W3_Request::get_array('names');
$count = null;
$total = null;
$results = array();
@$w3_plugin_cdn->rename_domain($names, $limit, $offset, $count, $total, $results);
echo sprintf("{limit: %d, offset: %d, count: %d, total: %s, results: [\r\n", $limit, $offset, $count, $total);
$results_count = count($results);
foreach ($results as $index => $result) {
echo sprintf("\t{old: '%s', new: '%s', result: %d, error: '%s'}", addslashes($result['old']), addslashes($result['new']), addslashes($result['result']), addslashes($result['error']));
if ($index < $results_count - 1) {
echo ',';
}
echo "\r\n";
}
echo ']}';
}