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


PHP W3_Request类代码示例

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


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

示例1: view

 /**
  * New Relic tab
  */
 function view()
 {
     $applications = array();
     $dashboard = '';
     /**
      * @var $nerser W3_NewRelicService
      */
     $nerser = w3_instance('W3_NewRelicService');
     $new_relic_configured = $this->_config->get_string('newrelic.account_id') && $this->_config->get_string('newrelic.api_key') && $this->_config->get_string('newrelic.application_id');
     $view_application = $this->_config->get_string('newrelic.application_id');
     $new_relic_enabled = $this->_config->get_boolean('newrelic.enabled');
     $verify_running = $nerser->verify_running();
     $application_settings = array();
     if (!is_array($verify_running)) {
         try {
             $application_settings = $nerser->get_application_settings();
         } catch (Exception $ex) {
             $application_settings = array();
         }
     }
     if ($view_metric = W3_Request::get_boolean('view_metric', false)) {
         $metric_names = $nerser->get_metric_names(W3_Request::get_string('regex', ''));
     }
     include W3TC_INC_DIR . '/options/new_relic.php';
 }
开发者ID:rongandat,项目名称:sallumeh,代码行数:28,代码来源:MonitoringAdminView.php

示例2: view

 /**
  * Support tab
  *
  * @return void
  */
 function view()
 {
     w3_require_once(W3TC_LIB_W3_DIR . '/Request.php');
     $request_type = W3_Request::get_string('request_type');
     $payment = W3_Request::get_boolean('payment');
     include W3TC_INC_DIR . '/options/support.php';
 }
开发者ID:novichkovv,项目名称:candoweightloss,代码行数:12,代码来源:SupportAdminView.php

示例3: w3tc_cancel_button

function w3tc_cancel_button($note, $classes = '', $custom_method = 'w3tc_default_hide_note')
{
    w3_require_once(W3TC_LIB_W3_DIR . '/Request.php');
    $page = W3_Request::get_string('page', 'w3tc_dashboard');
    $url = sprintf('admin.php?page=%s&%s&note=%s', $page, $custom_method, $note);
    $url = wp_nonce_url($url, 'w3tc');
    return w3_button_link(__('Cancel'), $url, false, $classes);
}
开发者ID:easinewe,项目名称:Avec2016,代码行数:8,代码来源:admin_ui.php

示例4: action_extensions_activate

 /**
  * @throws Exception
  */
 function action_extensions_activate()
 {
     w3_require_once(W3TC_LIB_W3_DIR . '/Request.php');
     $extension = W3_Request::get_string('w3tc_extensions_activate');
     if ($extension) {
         w3tc_activate_extension($extension, $this->_config);
     }
     w3_admin_redirect(array('w3tc_note' => 'extension_activated'));
 }
开发者ID:easinewe,项目名称:Avec2016,代码行数:12,代码来源:ExtensionsActionsAdmin.php

示例5: widget_pagespeed_control

 /**
  * Latest widget control
  *
  * @param integer $widget_id
  * @param array $form_inputs
  * @return void
  */
 function widget_pagespeed_control($widget_id, $form_inputs = array())
 {
     if ($_SERVER['REQUEST_METHOD'] == 'POST') {
         w3_require_once(W3TC_LIB_W3_DIR . '/Request.php');
         $this->_config->set('widget.pagespeed.key', W3_Request::get_string('w3tc_widget_pagespeed_key'));
         $this->_config->save();
     }
     include W3TC_INC_DIR . '/widget/pagespeed_control.php';
 }
开发者ID:rongandat,项目名称:sallumeh,代码行数:16,代码来源:PageSpeed.php

示例6: 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;
 }
开发者ID:rongandat,项目名称:sallumeh,代码行数:13,代码来源:NewRelicActionsAdmin.php

示例7: get_array

 /**
  * Returns array value
  *
  * @param string $key
  * @param array $default
  * @return array
  */
 function get_array($key, $default = array())
 {
     $value = W3_Request::get($key);
     if (is_array($value)) {
         return $value;
     } elseif ($value != '') {
         return preg_split("/[\r\n,;]+/", trim($value));
     }
     return $default;
 }
开发者ID:nxtclass,项目名称:NXTClass,代码行数:17,代码来源:Request.php

示例8: 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

示例9: action_widget_link_support

 function action_widget_link_support()
 {
     w3_require_once(W3TC_LIB_W3_DIR . '/Request.php');
     $value = W3_Request::get_string('w3tc_common_support_us');
     $this->_config->set('common.support', $value);
     $this->_config->save();
     if ($value) {
         _e('Thank you for linking to us!', 'w3-total-cache');
     } else {
         _e('You are no longer linking to us. Please support us in other ways instead.', 'w3-total-cache');
     }
     die;
 }
开发者ID:easinewe,项目名称:Avec2016,代码行数:13,代码来源:SpreadTheWord.php

示例10: notifications

 /**
  * @param W3_Config $config
  * @param W3_ConfigAdmin|null $config_admin
  * @return array
  */
 function notifications($config, $config_admin)
 {
     w3_require_once(W3TC_LIB_W3_DIR . '/Request.php');
     $page = W3_Request::get_string('page');
     $notes = array();
     if (!w3_is_cdn_mirror($config->get_string('cdn.engine'))) {
         /**
          * Show notification after theme change
          */
         if ($config->get_boolean('notes.theme_changed')) {
             $notes[] = sprintf(__('The active theme has changed, please %s now to ensure proper operation. %s', 'w3-total-cache'), w3_button_popup(__('upload active theme files', 'w3-total-cache'), 'cdn_export', 'cdn_export_type=theme'), w3_button_hide_note(__('Hide this message', 'w3-total-cache'), 'theme_changed'));
         }
         /**
          * Show notification after WP upgrade
          */
         if ($config->get_boolean('notes.wp_upgraded')) {
             $notes[] = sprintf(__('Upgraded WordPress? Please %s files now to ensure proper operation. %s', 'w3-total-cache'), w3_button_popup('upload wp-includes', 'cdn_export', 'cdn_export_type=includes'), w3_button_hide_note(__('Hide this message', 'w3-total-cache'), 'wp_upgraded'));
         }
         /**
          * Show notification after CDN enable
          */
         if ($config->get_boolean('notes.cdn_upload') || $config->get_boolean('notes.cdn_reupload')) {
             $cdn_upload_buttons = array();
             if ($config->get_boolean('cdn.includes.enable')) {
                 $cdn_upload_buttons[] = w3_button_popup('wp-includes', 'cdn_export', 'cdn_export_type=includes');
             }
             if ($config->get_boolean('cdn.theme.enable')) {
                 $cdn_upload_buttons[] = w3_button_popup('theme files', 'cdn_export', 'cdn_export_type=theme');
             }
             if ($config->get_boolean('minify.enabled') && $config->get_boolean('cdn.minify.enable') && !$config->get_boolean('minify.auto')) {
                 $cdn_upload_buttons[] = w3_button_popup('minify files', 'cdn_export', 'cdn_export_type=minify');
             }
             if ($config->get_boolean('cdn.custom.enable')) {
                 $cdn_upload_buttons[] = w3_button_popup('custom files', 'cdn_export', 'cdn_export_type=custom');
             }
             if ($config->get_boolean('notes.cdn_upload')) {
                 $notes[] = sprintf(__('Make sure to %s and upload the %s, files to the <acronym title="Content Delivery Network">CDN</acronym> to ensure proper operation. %s', 'w3-total-cache'), w3_button_popup('export the media library', 'cdn_export_library'), implode(', ', $cdn_upload_buttons), w3_button_hide_note('Hide this message', 'cdn_upload'));
             }
             if ($config->get_boolean('notes.cdn_reupload')) {
                 $notes[] = sprintf(__('Settings that affect Browser Cache settings for files hosted by the CDN have been changed. To apply the new settings %s and %s. %s', 'w3-total-cache'), w3_button_popup(__('export the media library', 'w3-total-cache'), 'cdn_export_library'), implode(', ', $cdn_upload_buttons), w3_button_hide_note(__('Hide this message', 'w3-total-cache'), 'cdn_reupload'));
             }
         }
     }
     if (in_array($config->get_string('cdn.engine'), array('netdna', 'maxcdn')) && $config_admin->get_boolean('notes.maxcdn_whitelist_ip') && $config_admin->get_integer('track.maxcdn_authorize') == 0 && $config->get_string('cdn.' . $config->get_string('cdn.engine') . '.authorization_key')) {
         $notes[] = sprintf(__('Make sure to whitelist your servers IPs. Follow the instructions on %s. The IP for this server is %s. %s', 'w3-total-cache'), '<a href="http://support.maxcdn.com/tutorials/how-to-whitelist-your-server-ip-to-use-the-api/">MaxCDN</a>', $_SERVER['SERVER_ADDR'], w3_button_hide_note('Hide this message', 'maxcdn_whitelist_ip', '', true));
     }
     return $notes;
 }
开发者ID:easinewe,项目名称:Avec2016,代码行数:53,代码来源:CdnNotes.php

示例11: w3_button_hide_note

/**
 * Returns hide note button html
 *
 * @param string $text
 * @param string $note
 * @param string $redirect
 * @param boolean $admin if to use config admin
 * @param string $page
 * @return string
 */
function w3_button_hide_note($text, $note, $redirect = '', $admin = false, $page = '')
{
    if ($page == '') {
        w3_require_once(W3TC_LIB_W3_DIR . '/Request.php');
        $page = W3_Request::get_string('page', 'w3tc_dashboard');
    }
    $url = sprintf('admin.php?page=%s&w3tc_default_hide_note&note=%s', $page, $note);
    if ($admin) {
        $url .= '&admin=1';
    }
    if ($redirect != '') {
        $url .= '&redirect=' . urlencode($redirect);
    }
    $url = wp_nonce_url($url, 'w3tc');
    return w3_button_link($text, $url);
}
开发者ID:rongandat,项目名称:sallumeh,代码行数:26,代码来源:admin_ui.php

示例12: recommendations

 function recommendations()
 {
     $themes = w3_get_themes();
     $current_theme = w3tc_get_current_theme_name();
     $current_theme_key = array_search($current_theme, $themes);
     w3_require_once(W3TC_LIB_W3_DIR . '/Request.php');
     $theme_key = W3_Request::get_string('theme_key', $current_theme_key);
     $theme_name = isset($themes[$theme_key]) ? $themes[$theme_key] : $current_theme;
     $templates = w3_get_theme_templates($theme_name);
     $recommendations = $this->get_theme_recommendations($theme_name);
     list($js_groups, $css_groups) = $recommendations;
     $minify_js_groups = $this->_config->get_array('minify.js.groups');
     $minify_css_groups = $this->_config->get_array('minify.css.groups');
     $checked_js = array();
     $checked_css = array();
     $locations_js = array();
     if (isset($minify_js_groups[$theme_key])) {
         foreach ((array) $minify_js_groups[$theme_key] as $template => $locations) {
             foreach ((array) $locations as $location => $config) {
                 if (isset($config['files'])) {
                     foreach ((array) $config['files'] as $file) {
                         if (!isset($js_groups[$template]) || !in_array($file, $js_groups[$template])) {
                             $js_groups[$template][] = $file;
                         }
                         $checked_js[$template][$file] = true;
                         $locations_js[$template][$file] = $location;
                     }
                 }
             }
         }
     }
     if (isset($minify_css_groups[$theme_key])) {
         foreach ((array) $minify_css_groups[$theme_key] as $template => $locations) {
             foreach ((array) $locations as $location => $config) {
                 if (isset($config['files'])) {
                     foreach ((array) $config['files'] as $file) {
                         if (!isset($css_groups[$template]) || !in_array($file, $css_groups[$template])) {
                             $css_groups[$template][] = $file;
                         }
                         $checked_css[$template][$file] = true;
                     }
                 }
             }
         }
     }
     include W3TC_INC_DIR . '/lightbox/minify_recommendations.php';
 }
开发者ID:jfbelisle,项目名称:magexpress,代码行数:47,代码来源:MinifyAdminView.php

示例13: action_cloudflare_api_request

 /**
  * Send CloudFlare API request
  *
  * @return void
  */
 function action_cloudflare_api_request()
 {
     $result = false;
     $response = null;
     $actions = array('devmode', 'sec_lvl', 'fpurge_ts');
     w3_require_once(W3TC_LIB_W3_DIR . '/Request.php');
     $email = W3_Request::get_string('email');
     $key = W3_Request::get_string('key');
     $zone = W3_Request::get_string('zone');
     $action = W3_Request::get_string('command');
     $value = W3_Request::get_string('value');
     $nonce = W3_Request::get_string('_wpnonce');
     if (!wp_verify_nonce($nonce, 'w3tc')) {
         $error = 'Access denied.';
     } elseif (!$email) {
         $error = 'Empty email.';
     } elseif (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
         $error = 'Invalid email.';
     } elseif (!$key) {
         $error = 'Empty key.';
     } elseif (!$zone) {
         $error = 'Empty zone.';
     } elseif (strpos($zone, '.') === false) {
         $error = 'Invalid domain.';
     } elseif (!in_array($action, $actions)) {
         $error = 'Invalid action.';
     } else {
         $config = array('email' => $email, 'key' => $key, 'zone' => $zone);
         w3_require_once(W3TC_LIB_W3_DIR . '/CloudFlare.php');
         @($w3_cloudflare = new W3_CloudFlare($config));
         @set_time_limit($this->_config->get_integer('timelimit.cloudflare_api_request'));
         $response = $w3_cloudflare->api_request($action, $value);
         if ($response) {
             if ($response->result == 'success') {
                 $result = true;
                 $error = 'OK';
             } else {
                 $error = $response->msg;
             }
         } else {
             $error = 'Unable to make CloudFlare API request.';
         }
     }
     $return = array('result' => $result, 'error' => $error, 'response' => $response);
     echo json_encode($return);
     exit;
 }
开发者ID:rongandat,项目名称:sallumeh,代码行数:52,代码来源:CloudFlareAdmin.php

示例14: action_aws_sns_subscribe

 /**
  * @throws Exception
  */
 function action_aws_sns_subscribe()
 {
     w3_require_once(W3TC_LIB_W3_DIR . '/Request.php');
     $topic_arn = W3_Request::get_string('cluster_messagebus_sns_topic_arn_subscribe');
     /**
      * @var W3_Enterprise_SnsClient $sns_client
      */
     $sns_client = w3_instance('W3_Enterprise_SnsClient');
     $sns_client->subscribe(plugins_url('pub/sns.php', W3TC_FILE), $topic_arn);
     try {
         $this->_config->set('cluster.messagebus.sns.topic_arn', $topic_arn);
         $this->_config->save();
     } catch (Exception $ex) {
         throw new Exception('<strong>Can\'t change configuration</strong>: ' . $ex->getMessage());
     }
     w3_admin_redirect(array('w3tc_note' => 'sns_subscribed'));
 }
开发者ID:easinewe,项目名称:Avec2016,代码行数:20,代码来源:AwsActionsAdmin.php

示例15: 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;
 }
开发者ID:rongandat,项目名称:sallumeh,代码行数:17,代码来源:MinifyAdmin.php


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