summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathaniel Catchpole2014-02-28 10:52:24 (GMT)
committerNathaniel Catchpole2014-02-28 10:52:24 (GMT)
commit6aab2901e1a430c334db4782cd7c019128d2dfb5 (patch)
treeafefaca53480a2f53131c59e74524523f21fe2e3
parentd077f162378393614cb838f34a584aa15b90c52a (diff)
Issue #2195585 by Les Lim: Add a dedicated @Archiver annotation class.
-rw-r--r--core/lib/Drupal/Core/Archiver/Annotation/Archiver.php54
-rw-r--r--core/lib/Drupal/Core/Archiver/ArchiverManager.php2
-rw-r--r--core/modules/system/lib/Drupal/system/Plugin/Archiver/Tar.php6
-rw-r--r--core/modules/system/lib/Drupal/system/Plugin/Archiver/Zip.php6
4 files changed, 61 insertions, 7 deletions
diff --git a/core/lib/Drupal/Core/Archiver/Annotation/Archiver.php b/core/lib/Drupal/Core/Archiver/Annotation/Archiver.php
new file mode 100644
index 0000000..553e507
--- /dev/null
+++ b/core/lib/Drupal/Core/Archiver/Annotation/Archiver.php
@@ -0,0 +1,54 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\Core\Archiver\Annotation\Archiver.
+ */
+
+namespace Drupal\Core\Archiver\Annotation;
+
+use Drupal\Component\Annotation\Plugin;
+
+/**
+ * Defines an archiver annotation object.
+ *
+ * @see \Drupal\Core\Archiver\ArchiverManager
+ * @see hook_archiver_info_alter()
+ *
+ * @Annotation
+ */
+class Archiver extends Plugin {
+
+ /**
+ * The archiver plugin ID.
+ *
+ * @var string
+ */
+ public $id;
+
+ /**
+ * The human-readable name of the archiver plugin.
+ *
+ * @ingroup plugin_translatable
+ *
+ * @var \Drupal\Core\Annotation\Translation
+ */
+ public $title;
+
+ /**
+ * The description of the archiver plugin.
+ *
+ * @ingroup plugin_translatable
+ *
+ * @var \Drupal\Core\Annotation\Translation
+ */
+ public $description;
+
+ /**
+ * An array of valid extensions for this archiver.
+ *
+ * @var array
+ */
+ public $extensions;
+
+}
diff --git a/core/lib/Drupal/Core/Archiver/ArchiverManager.php b/core/lib/Drupal/Core/Archiver/ArchiverManager.php
index b56d240..f446f37 100644
--- a/core/lib/Drupal/Core/Archiver/ArchiverManager.php
+++ b/core/lib/Drupal/Core/Archiver/ArchiverManager.php
@@ -31,7 +31,7 @@ class ArchiverManager extends DefaultPluginManager {
* The module handler to invoke the alter hook with.
*/
public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, LanguageManager $language_manager, ModuleHandlerInterface $module_handler) {
- parent::__construct('Plugin/Archiver', $namespaces);
+ parent::__construct('Plugin/Archiver', $namespaces, 'Drupal\Core\Archiver\Annotation\Archiver');
$this->alterInfo($module_handler, 'archiver_info');
$this->setCacheBackend($cache_backend, $language_manager, 'archiver_info_plugins');
}
diff --git a/core/modules/system/lib/Drupal/system/Plugin/Archiver/Tar.php b/core/modules/system/lib/Drupal/system/Plugin/Archiver/Tar.php
index 0453f16..faf1fd3 100644
--- a/core/modules/system/lib/Drupal/system/Plugin/Archiver/Tar.php
+++ b/core/modules/system/lib/Drupal/system/Plugin/Archiver/Tar.php
@@ -2,7 +2,7 @@
/**
* @file
- * Contains \Drupal\system\Plugin\Core\Archiver\Tar.
+ * Contains \Drupal\system\Plugin\Archiver\Tar.
*/
namespace Drupal\system\Plugin\Archiver;
@@ -10,9 +10,9 @@ namespace Drupal\system\Plugin\Archiver;
use Drupal\Component\Archiver\Tar as BaseTar;
/**
- * Defines a archiver implementation for .tar files.
+ * Defines an archiver implementation for .tar files.
*
- * @Plugin(
+ * @Archiver(
* id = "Tar",
* title = @Translation("Tar"),
* description = @Translation("Handles .tar files."),
diff --git a/core/modules/system/lib/Drupal/system/Plugin/Archiver/Zip.php b/core/modules/system/lib/Drupal/system/Plugin/Archiver/Zip.php
index 5865653..2e908b4 100644
--- a/core/modules/system/lib/Drupal/system/Plugin/Archiver/Zip.php
+++ b/core/modules/system/lib/Drupal/system/Plugin/Archiver/Zip.php
@@ -2,7 +2,7 @@
/**
* @file
- * Contains \Drupal\system\Plugin\Core\Archiver\Zip.
+ * Contains \Drupal\system\Plugin\Archiver\Zip.
*/
namespace Drupal\system\Plugin\Archiver;
@@ -10,11 +10,11 @@ namespace Drupal\system\Plugin\Archiver;
use Drupal\Component\Archiver\Zip as BaseZip;
/**
- * Defines a archiver implementation for .zip files.
+ * Defines an archiver implementation for .zip files.
*
* @link http://php.net/zip
*
- * @Plugin(
+ * @Archiver(
* id = "Zip",
* title = @Translation("Zip"),
* description = @Translation("Handles zip files."),