/**
  * Activate plugin action (called by W3_Plugins)
  */
 function activate()
 {
     w3_require_once(W3TC_INC_DIR . '/functions/activation.php');
     try {
         w3_copy_if_not_equal(W3TC_INSTALL_FILE_OBJECT_CACHE, W3TC_ADDIN_FILE_OBJECT_CACHE);
     } catch (Exception $ex) {
     }
     $this->schedule();
 }
 /**
  * Creates addin files
  * 
  * @param $force_overwrite boolean
  */
 function create_required_files($force_overwrite = false)
 {
     w3_require_once(W3TC_INC_DIR . '/functions/activation.php');
     if (!file_exists(W3TC_ADDIN_FILE_DB) || $force_overwrite) {
         try {
             w3_copy_if_not_equal(W3TC_INSTALL_FILE_DB, W3TC_ADDIN_FILE_DB);
         } catch (Exception $ex) {
         }
     }
 }
 /**
  * Activate plugin action
  */
 function activate()
 {
     w3_require_once(W3TC_INC_DIR . '/functions/activation.php');
     if ($this->_config->get_boolean('pgcache.enabled') && $this->_config->get_string('pgcache.engine') == 'file_generic') {
         /**
          * Disable enhanced mode if permalink structure is disabled
          */
         $permalink_structure = get_option('permalink_structure');
         if ($permalink_structure == '') {
             $this->_config->set('pgcache.engine', 'file');
             $this->_config->save();
         } else {
             if (w3_can_modify_rules(w3_get_pgcache_rules_core_path())) {
                 try {
                     $this->write_rules_core();
                 } catch (Exception $e) {
                 }
             }
             if (w3_can_modify_rules(w3_get_pgcache_rules_cache_path())) {
                 try {
                     $this->write_rules_cache();
                 } catch (Exception $e) {
                 }
             }
         }
     }
     try {
         w3_copy_if_not_equal(W3TC_INSTALL_FILE_ADVANCED_CACHE, W3TC_ADDIN_FILE_ADVANCED_CACHE);
     } catch (Exception $ex) {
     }
     if (file_exists(W3TC_ADDIN_FILE_ADVANCED_CACHE)) {
         if (!defined('WP_CACHE') || !WP_CACHE) {
             try {
                 $this->enable_wp_cache();
             } catch (Exception $ex) {
             }
         }
     }
     $this->schedule();
     $this->schedule_prime();
 }