Commit 6aab2901 authored by catch's avatar catch

Issue #2195585 by Les Lim: Add a dedicated @Archiver annotation class.

parent d077f162
<?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;
}
......@@ -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');
}
......
......@@ -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 @@
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."),
......
......@@ -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 @@
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."),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment