| @@ -17,39 +17,11 @@ | ||
| 17 | 17 | } |
| 18 | 18 | self::migratePaypal(); |
| 19 | 19 | $config = (object) []; |
| 20 | 20 | $config->delete_table = true; |
| 21 | - $this->duplicateV1StyleFiles(); | |
| 22 | 21 | update_option('bitform_app_config', $config); |
| 22 | + set_transient('bitforms_v1_form_contents', $newFormContents); | |
| 23 | 23 | return $newFormContents; |
| 24 | - } | |
| 25 | - | |
| 26 | - public function rollbackToV1() | |
| 27 | - { | |
| 28 | - $this->dropTableAndRename('form', 'form_v1'); | |
| 29 | - $this->dropTableAndRename('workflows', 'workflows_v1'); | |
| 30 | - $this->dropTableAndRename('success_messages', 'success_messages_v1'); | |
| 31 | - $source = BITFORMS_CONTENT_DIR . DIRECTORY_SEPARATOR . 'form-styles'; | |
| 32 | - MigrationHelper::recursiveDeleteFiles($source); | |
| 33 | - $destination = BITFORMS_CONTENT_DIR . DIRECTORY_SEPARATOR . 'form-styles-v1'; | |
| 34 | - MigrationHelper::recursiveCopyFiles($destination, $source); | |
| 35 | - MigrationHelper::recursiveDeleteFiles($destination); | |
| 36 | - if (file_exists($destination)) { | |
| 37 | - rmdir($destination); | |
| 38 | - } | |
| 39 | - delete_option('bitforms_migrating_to_v2'); | |
| 40 | - delete_option('bitforms_migrated_to_v2'); | |
| 41 | - } | |
| 42 | - | |
| 43 | - private function duplicateV1StyleFiles() | |
| 44 | - { | |
| 45 | - $source = BITFORMS_CONTENT_DIR . DIRECTORY_SEPARATOR . 'form-styles'; | |
| 46 | - $destination = BITFORMS_CONTENT_DIR . DIRECTORY_SEPARATOR . 'form-styles-v1'; | |
| 47 | - if (!file_exists(BITFORMS_CONTENT_DIR . DIRECTORY_SEPARATOR . 'form-styles-v1')) { | |
| 48 | - wp_mkdir_p(BITFORMS_CONTENT_DIR . DIRECTORY_SEPARATOR . 'form-styles-v1'); | |
| 49 | - } | |
| 50 | - MigrationHelper::recursiveCopyFiles($source, $destination); | |
| 51 | - MigrationHelper::recursiveDeleteFiles($source); | |
| 52 | 24 | } |
| 53 | 25 | |
| 54 | 26 | private static function migratePaypal() |
| 55 | 27 | { |