/**
  *
  */
 function action_default_remove_add_in()
 {
     w3_require_once(W3TC_INC_FUNCTIONS_DIR . '/activation.php');
     $module = W3_Request::get_string('w3tc_default_remove_add_in');
     switch ($module) {
         case 'pgcache':
             w3_wp_delete_file(W3TC_ADDIN_FILE_ADVANCED_CACHE);
             break;
         case 'dbcache':
             w3_wp_delete_file(W3TC_ADDIN_FILE_DB);
             break;
         case 'objectcache':
             w3_wp_delete_file(W3TC_ADDIN_FILE_OBJECT_CACHE);
             break;
     }
     w3_admin_redirect(array('w3tc_note' => 'add_in_removed'), true);
 }
 /**
  *
  */
 function action_default_remove_add_in()
 {
     w3_require_once(W3TC_INC_FUNCTIONS_DIR . '/activation.php');
     $module = W3_Request::get_string('w3tc_default_remove_add_in');
     switch ($module) {
         case 'pgcache':
             w3_wp_delete_file(W3TC_ADDIN_FILE_ADVANCED_CACHE);
             $src = W3TC_INSTALL_FILE_ADVANCED_CACHE;
             $dst = W3TC_ADDIN_FILE_ADVANCED_CACHE;
             try {
                 w3_wp_copy_file($src, $dst);
             } catch (FilesystemOperationException $ex) {
             }
             break;
         case 'dbcache':
             w3_wp_delete_file(W3TC_ADDIN_FILE_DB);
             break;
         case 'objectcache':
             w3_wp_delete_file(W3TC_ADDIN_FILE_OBJECT_CACHE);
             break;
     }
     w3_admin_redirect(array('w3tc_note' => 'add_in_removed'), true);
 }
 /**
  * Deletes add-in
  * @throws FilesystemOperationException
  */
 private function delete_addin()
 {
     if ($this->is_dbcache_add_in()) {
         w3_wp_delete_file(W3TC_ADDIN_FILE_DB);
     }
 }
 /**
  * Deletes add-in
  * @throws FilesystemOperationException
  */
 private function delete_addin()
 {
     w3_wp_delete_file(W3TC_ADDIN_FILE_OBJECT_CACHE);
 }
Esempio n. 5
0
 private function delete_files_and_folders()
 {
     $ftp_form = null;
     $errors = array();
     $dirs = array(W3TC_CACHE_DIR);
     $files = array(W3TC_ADDIN_FILE_DB, W3TC_ADDIN_FILE_OBJECT_CACHE, W3TC_ADDIN_FILE_ADVANCED_CACHE);
     if (file_exists(W3TC_WP_LOADER)) {
         $files[] = W3TC_WP_LOADER;
     }
     foreach ($files as $file) {
         try {
             w3_wp_delete_file($file);
         } catch (Exception $e) {
             if ($e instanceof FilesystemCredentialException) {
                 $ftp_form = $e->ftp_form();
             }
         }
         if (file_exists($file)) {
             $errors[] = sprintf('Delete file: <strong>%s</strong>', $file);
         }
     }
     try {
         @set_time_limit(60);
         w3_wp_delete_folders($dirs);
     } catch (Exception $e) {
         if ($e instanceof FilesystemCredentialException) {
             $ftp_form = $e->ftp_form();
         }
     }
     foreach ($dirs as $folder) {
         if (@is_dir($folder)) {
             $errors[] = sprintf('Delete folder: <strong>%s</strong>', $folder);
         }
     }
     return array('errors' => $errors, 'ftp_form' => $ftp_form);
 }
 /**
  * Checks if addins in wp-content are available and deletes them.
  * @throws SelfTestExceptions
  */
 private function delete_required_files($exs)
 {
     try {
         if ($this->is_advanced_cache_add_in()) {
             w3_wp_delete_file(W3TC_ADDIN_FILE_ADVANCED_CACHE);
         }
     } catch (FilesystemOperationException $ex) {
         $exs->push($ex);
     }
 }
 /**
  * Checks if addins in wp-content are available and deletes them.
  * @throws SelfTestExceptions
  */
 private function delete_required_files($exs)
 {
     try {
         w3_wp_delete_file(W3TC_ADDIN_FILE_ADVANCED_CACHE);
     } catch (FilesystemOperationException $ex) {
         $exs->push($ex);
     }
 }
 /**
  * Deletes add-in
  * @throws FilesystemOperationException
  */
 private function delete_addin()
 {
     w3_wp_delete_file(W3TC_ADDIN_FILE_DB);
 }
 /**
  * Deletes add-in
  * @throws FilesystemOperationException
  */
 private function delete_addin()
 {
     if ($this->is_objectcache_add_in()) {
         w3_wp_delete_file(W3TC_ADDIN_FILE_OBJECT_CACHE);
     }
 }
Esempio n. 10
0
/**
 * Deletes maintenance mode file
 */
function w3_disable_maintenance_mode()
{
    w3_wp_delete_file(w3_get_site_root() . '/.maintenance');
}