Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tim.plunkett’s picture

Status: Active » Needs review
FileSize
20.93 KB

The whole FileTransfer subsystem needs a good deal of refactoring. I'm just doing the discovery parts for now.

damiankloip’s picture

Status: Needs review » Needs work
+++ b/core/lib/Drupal/Core/Annotation/FileTransfer.phpundefined
@@ -0,0 +1,44 @@
+ * Defines an FileTransfer annotation object.

a

+++ b/core/lib/Drupal/Core/FileTransfer/FileTransferManager.phpundefined
@@ -0,0 +1,60 @@
+ * Register information about FileTransfer classes.

Registers?

+++ b/core/lib/Drupal/Core/FileTransfer/FileTransferManager.phpundefined
@@ -0,0 +1,60 @@
+    uasort($definitions, function ($a, $b) {
+      if ($a['weight'] == $b['weight']) {
+        return 0;
+      }
+      return ($a['weight'] < $b['weight']) ? -1 : 1;

Out of scope here, but this is pretty similar to drupal_sort_weight, so I think we could start reusing that. I would certainly not add a procedural function in here though, so it's good for now.

+++ b/core/lib/Drupal/Core/FileTransfer/Plugin/FileTransfer/FTPExtension.phpundefined
@@ -5,10 +5,21 @@
+ * @FileTransfer(
+ *   id = "ftp",
+ *   title = @Translation("FTP")
+ * )

Should we add the weight in here anyway?

+++ b/core/lib/Drupal/Core/FileTransfer/Plugin/FileTransfer/SSH.phpundefined
@@ -5,12 +5,24 @@
+class SSH extends FileTransferBase implements ChmodInterface {

Maybe we should use this opportunity to rename to 'Ssh', as I think that's the correct camel casing?

+++ b/core/modules/system/system.moduleundefined
@@ -2238,7 +2238,7 @@ function system_authorized_init($callback, $file, $arguments = array(), $page_ti
+  $_SESSION['authorize_filetransfer_info'] = Drupal::service('plugin.manager.filetransfer')->getDefinitions();

I guess this doesn't need to be user specific, wonder if this could be stored elsewhere? Probably not in scope of this conversion though.

+++ b/core/modules/update/tests/modules/update_test/lib/Drupal/update_test/Plugin/FileTransfer/MockFileTransfer.phpundefined
@@ -2,24 +2,33 @@
   public static function factory() {
-    return new FileTransfer;
+    return new static();

If we are changing this method a bit anyway, should we use create() instead? to bring it inline with all of our other 'things'.

damiankloip’s picture

#2028499: drupal_sort_weight should be converted to a class is the issue I was thinking of for drupal_sort_weight

tim.plunkett’s picture

Priority: Normal » Major
Issue tags: +Approved API change
tim.plunkett’s picture

Assigned: tim.plunkett » Unassigned
Issue tags: -Approved API change
dlu’s picture

Component: base system » file system

Moved to filesystem component per #2050763-16: Refine "base system" component (notes on refactoring of "base system" category here: https://docs.google.com/a/acquia.com/spreadsheet/ccc?key=0AusehVccVSq2dF...). Might also involve modules.

tim.plunkett’s picture

This actually has nothing to do with the file system as we define it (file.inc), it's actually used by authorize.php and update.php and is in common.inc, so I think it does belong here.

Les Lim’s picture

Issue summary: View changes
Status: Needs work » Needs review
Parent issue: » #2044203: [meta] Convert info hooks to plugins
FileSize
22.23 KB
7.6 KB

Rerolled #1 and incorporated the review from #2. Notes:

  • Renamed FTP.php to Ftp.php, SSH.php to Ssh.php, and FTPExtension.php to FtpExtension.php. This may be a problem for people on case-insensitive filesystems.
  • Changed the MockFileTransfer::factory() methods to create() methods. Not sure if this requires changes in any implementing code, since I couldn't figure out where either MockFileTransfer class is used.

Status: Needs review » Needs work

The last submitted patch, 8: core-2038271-8-filetransfer-to-plugins.patch, failed testing.

Les Lim’s picture

Status: Needs work » Needs review
FileSize
29.36 KB
10.09 KB

Changes since #8:

  • Changed factory() method to create() in FileTransferBase and its children
  • Fixed FileTransferManager::__construct() signature
  • @inheritdoc use

Status: Needs review » Needs work

The last submitted patch, 10: core-2038271-9-filetransfer-to-plugins.patch, failed testing.

Les Lim’s picture

The last submitted patch, 10: core-2038271-9-filetransfer-to-plugins.patch, failed testing.

Les Lim’s picture

Status: Needs work » Needs review
FileSize
30.23 KB
894 bytes

Missed a factory() method that should be create() now.

Les Lim’s picture

Shoot, missed another one. Should've grepped first.

sun’s picture

Status: Needs review » Needs work

The last submitted patch, 15: core-2038271-15-filetransfer-to-plugins.patch, failed testing.

msmithcti’s picture

Rerolled the patch from #15.

msmithcti’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 18: d8-convert-hook-filetransfer-info-plugin-2038271-18.patch, failed testing.

msmithcti’s picture

Status: Needs work » Needs review
FileSize
76.31 KB

Removes the addition of authorize.php which had been mistakenly added in the reroll. Fixed the installer issue.

Status: Needs review » Needs work

The last submitted patch, 21: d8-convert-hook-filetransfer-info-plugin-2038271-21.patch, failed testing.

tim.plunkett’s picture

Version: 8.0.x-dev » 8.1.x-dev

We could probably do this in a non-BC-breaking way in 8.1.x

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.0-beta1 was released on March 2, 2016, which means new developments and disruptive changes should now be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.