예제 #1
0
 public function w3tc_settings_general_boxarea_cdn()
 {
     $config = Dispatcher::config();
     $engine_optgroups = array();
     $engine_values = array();
     $is_fsd = Util_Environment::is_w3tc_pro($config);
     if ($is_fsd) {
         $engine_optgroups[] = __('Full Site Delivery:', 'w3-total-cache');
         $engine_values['cloudfront_fsd'] = array('label' => __('Amazon CloudFront', 'w3-total-cache'), 'optgroup' => 0);
         $engine_values['maxcdn_fsd'] = array('label' => __('MaxCDN (recommended)', 'w3-total-cache'), 'optgroup' => 0);
         $optgroup_pull = count($engine_optgroups);
         $engine_optgroups[] = __('Origin Pull / Mirror:', 'w3-total-cache');
     } else {
         $optgroup_pull = count($engine_optgroups);
         $engine_optgroups[] = __('Origin Pull / Mirror:', 'w3-total-cache');
     }
     $optgroup_push = count($engine_optgroups);
     $engine_optgroups[] = __('Origin Push:', 'w3-total-cache');
     $engine_values['akamai'] = array('label' => __('Akamai', 'w3-total-cache'), 'optgroup' => $optgroup_pull);
     $engine_values['cf2'] = array('label' => __('Amazon CloudFront', 'w3-total-cache'), 'disabled' => !Util_Installed::curl() ? true : null, 'optgroup' => $optgroup_pull);
     $engine_values['att'] = array('label' => __('AT&T', 'w3-total-cache'), 'optgroup' => $optgroup_pull);
     $engine_values['cotendo'] = array('label' => __('Cotendo (Akamai)', 'w3-total-cache'), 'optgroup' => $optgroup_pull);
     $engine_values['mirror'] = array('label' => __('Generic Mirror', 'w3-total-cache'), 'optgroup' => $optgroup_pull);
     $engine_values['highwinds'] = array('label' => __('Highwinds', 'w3-total-cache'), 'optgroup' => $optgroup_pull);
     $engine_values['maxcdn'] = array('label' => __('MaxCDN', 'w3-total-cache'), 'optgroup' => $optgroup_pull);
     $engine_values['netdna'] = array('label' => __('MaxCDN Enterprise (NetDNA)', 'w3-total-cache'), 'optgroup' => $optgroup_pull);
     $engine_values['rackspace_cdn'] = array('label' => __('RackSpace CDN', 'w3-total-cache'), 'optgroup' => $optgroup_pull);
     $engine_values['edgecast'] = array('label' => __('Verizon Digital Media Services (EdgeCast) / Media Temple ProCDN', 'w3-total-cache'), 'optgroup' => $optgroup_pull);
     $engine_values['cf'] = array('disabled' => !Util_Installed::curl() ? true : null, 'label' => __('Amazon CloudFront', 'w3-total-cache'), 'optgroup' => $optgroup_push);
     $engine_values['s3'] = array('disabled' => !Util_Installed::curl() ? true : null, 'label' => __('Amazon Simple Storage Service (S3)', 'w3-total-cache'), 'optgroup' => $optgroup_push);
     $engine_values['s3_compatible'] = array('disabled' => !Util_Installed::curl() ? true : null, 'label' => __('Amazon Simple Storage Service (S3) Compatible', 'w3-total-cache'), 'optgroup' => $optgroup_push);
     $engine_values['google_drive'] = array('label' => __('Google Drive', 'w3-total-cache'), 'optgroup' => $optgroup_push);
     $engine_values['azure'] = array('label' => __('Microsoft Azure Storage', 'w3-total-cache'), 'optgroup' => $optgroup_push);
     $engine_values['rscf'] = array('disabled' => !Util_Installed::curl() ? true : null, 'label' => __('Rackspace Cloud Files', 'w3-total-cache'), 'optgroup' => $optgroup_push);
     $engine_values['ftp'] = array('disabled' => !Util_Installed::ftp() ? true : null, 'label' => __('Self-hosted / File Transfer Protocol Upload', 'w3-total-cache'), 'optgroup' => $optgroup_push);
     $cdn_enabled = $config->get_boolean('cdn.enabled');
     $cdn_engine = $config->get_string('cdn.engine');
     $tag = '';
     if ($cdn_engine == 'cloudfront_fsd') {
         $tag = '#cdn-fsd-cloudfront';
     } elseif ($cdn_engine == 'maxcdn_fsd') {
         $tag = '#cdn-fsd-maxcdn';
     }
     if (empty($tag)) {
         $cdn_engine_extra_description = '';
     } else {
         $cdn_engine_extra_description = ' See <a href="admin.php?page=w3tc_faq' . $tag . '">setup instructions</a>';
     }
     include W3TC_DIR . '/Cdn_GeneralPage_View.php';
 }