diff --git a/drupal_fence.links.menu.yml b/drupal_fence.links.menu.yml index 17d27a9..d25944c 100644 --- a/drupal_fence.links.menu.yml +++ b/drupal_fence.links.menu.yml @@ -9,10 +9,4 @@ drupal_fence.import: description: 'Import URLs' parent: system.admin_config_system route_name: drupal_fence.import - weight: 10 -# drupal_fence.verify: -# title: 'Drupal Fence verify' -# description: 'Verify integrity of Drupal files.' -# parent: system.admin_config_system -# route_name: drupal_fence.verify -# weight: 10 \ No newline at end of file + weight: 11 \ No newline at end of file diff --git a/drupal_fence.routing.yml b/drupal_fence.routing.yml index c66e605..35f40a3 100644 --- a/drupal_fence.routing.yml +++ b/drupal_fence.routing.yml @@ -10,19 +10,5 @@ drupal_fence.import: defaults: _title: 'Drupal Fence Import' _form: 'Drupal\drupal_fence\Form\DrupalFenceImportForm' - requirements: - _permission: 'administer site configuration' -drupal_fence.verify: - path: /admin/config/development/drupal_fence_verify - defaults: - _title: 'Drupal Fence Verify' - _form: 'Drupal\drupal_fence\Form\DrupalFenceVerifySiteForm' - requirements: - _permission: 'administer site configuration' -drupal_fence.verify_confirm: - path: /admin/config/development/drupal_fence_verify_confirm - defaults: - _title: 'Drupal Fence Verify Confirmation' - _form: 'Drupal\drupal_fence\Form\DrupalFenceConfirmVerifySite' requirements: _permission: 'administer site configuration' \ No newline at end of file diff --git a/src/DrupalFenceVerifySiteBatchProcessor.php b/src/DrupalFenceVerifySiteBatchProcessor.php deleted file mode 100644 index 8c59ce5..0000000 --- a/src/DrupalFenceVerifySiteBatchProcessor.php +++ /dev/null @@ -1,49 +0,0 @@ -saveData($drupal, $dir . '/drupal_current.zip', EXISTS_REPLACE); - } - - public function unpackDrupal() { - $zip = new Zip(PublicStream::basePath() . '/drupal_current.zip'); - $zip->extract(PublicStream::basePath() . '/drupal_fence_data'); - } - - public function clean() { - \Drupal::service('file_system')->delete(PublicStream::basePath() . '/drupal_current.zip'); - \Drupal::service('file_system')->deleteRecursive(PublicStream::basePath() . '/drupal_fence_data'); - } -} \ No newline at end of file diff --git a/src/Form/DrupalFenceConfirmVerifySite.php b/src/Form/DrupalFenceConfirmVerifySite.php deleted file mode 100644 index b2cff7c..0000000 --- a/src/Form/DrupalFenceConfirmVerifySite.php +++ /dev/null @@ -1,72 +0,0 @@ - 'label', - '#title' => $this->t('WARNING! This process will flush the Drupal cache. This may cause performance issues if your site is currently under heavy load.'), - ]; - - $form['actions']['submit'] = array( - '#type' => 'submit', - '#value' => $this - ->t('NOT YET IMPLEMENTED - THIS DOES NOTHING USEFUL'), - ); - - return $form; - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $batch = array( - 'title' => $this->t('Processing'), - 'operations' => [ - [ - '\Drupal\drupal_fence\DrupalFenceVerifySiteBatchProcessor::drupalFenceBatchProcessorCallback', - ['flush_drupal_caches'], - ], - [ - '\Drupal\drupal_fence\DrupalFenceVerifySiteBatchProcessor::drupalFenceBatchProcessorCallback', - ['download_fresh_drupal'], - ], - [ - '\Drupal\drupal_fence\DrupalFenceVerifySiteBatchProcessor::drupalFenceBatchProcessorCallback', - ['unpack_drupal'], - ], - [ - '\Drupal\drupal_fence\DrupalFenceVerifySiteBatchProcessor::drupalFenceBatchProcessorCallback', - ['cleanup'], - ], - ], - 'init_message' => t('Initializing...'), - 'progress_message' => t('Stage @current of @total. Estimated time: @estimate.'), - 'error_message' => t('An error occurred when trying to verify your site.') - ); - - batch_set($batch); - } - - /** - * {@inheritdoc} - */ - public function getFormId() : string { - return "confirm_verify_site_form"; - } - - } \ No newline at end of file diff --git a/src/Form/DrupalFenceVerifySiteForm.php b/src/Form/DrupalFenceVerifySiteForm.php deleted file mode 100644 index e0b22d5..0000000 --- a/src/Form/DrupalFenceVerifySiteForm.php +++ /dev/null @@ -1,64 +0,0 @@ - 'label', - '#title' => $this->t('Drupal Fence will now start verifying the integrity of core Drupal files.'), - ]; - - $form['about2'] = [ - '#type' => 'label', - '#title' => $this->t('Please note, Drupal Fence will not attempt repairs. It is up to the site administrator to replace damaged files.'), - ]; - - - - $form['actions']['submit'] = array( - '#type' => 'submit', - '#value' => $this - ->t('NOT YET IMPLEMENTED - THIS DOES NOTHING USEFUL'), - ); - return $form; - } - - /** - * {@inheritdoc} - */ - public function validateForm(array &$form, FormStateInterface $form_state) { - - } - - /** - * {@inheritdoc} - */ - public function getEditableConfigNames() { - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $form_state->setRedirectUrl(Url::fromRoute('drupal_fence.verify_confirm')); - } -} \ No newline at end of file