diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Annotation/AggregatorFetcher.php b/core/modules/aggregator/lib/Drupal/aggregator/Annotation/AggregatorFetcher.php new file mode 100644 index 0000000..5d22909 --- /dev/null +++ b/core/modules/aggregator/lib/Drupal/aggregator/Annotation/AggregatorFetcher.php @@ -0,0 +1,43 @@ +discovery = new AnnotatedClassDiscovery('aggregator', $type, $namespaces); + + $type_annotations = array( + 'fetcher' => 'Drupal\aggregator\Plugin\Annotation\AggregatorFetcher', + 'parser' => 'Drupal\aggregator\Plugin\Annotation\AggregatorParser', + 'processor' => 'Drupal\aggregator\Plugin\Annotation\AggregatorProcessor', + ); + + $annotation_namespaces = array( + 'Drupal\aggregator\Plugin\Annotation' => DRUPAL_ROOT . '/core/modules/aggregator/lib', + ); + + $this->discovery = new AnnotatedClassDiscovery('aggregator', $type, $namespaces, $annotation_namespaces, $type_annotations[$type]); $this->discovery = new CacheDecorator($this->discovery, "aggregator_$type:" . language(LANGUAGE_TYPE_INTERFACE)->langcode); $this->factory = new DefaultFactory($this->discovery); } diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Plugin/aggregator/fetcher/DefaultFetcher.php b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/aggregator/fetcher/DefaultFetcher.php index e71412b..e98411e 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Plugin/aggregator/fetcher/DefaultFetcher.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/aggregator/fetcher/DefaultFetcher.php @@ -9,7 +9,7 @@ use Drupal\aggregator\Plugin\FetcherInterface; use Drupal\aggregator\Plugin\Core\Entity\Feed; -use Drupal\Component\Annotation\Plugin; +use Drupal\aggregator\Annotation\AggregatorFetcher; use Drupal\Core\Annotation\Translation; use Guzzle\Http\Exception\BadResponseException; use Guzzle\Http\Exception\RequestException; @@ -19,7 +19,7 @@ * * Uses the http_default_client service to download the feed. * - * @Plugin( + * @AggregatorFetcher( * id = "aggregator", * title = @Translation("Default fetcher"), * description = @Translation("Downloads data from a URL using Drupal's HTTP request handler.") diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Plugin/aggregator/parser/DefaultParser.php b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/aggregator/parser/DefaultParser.php index 0086bac..eab6e9b 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Plugin/aggregator/parser/DefaultParser.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/aggregator/parser/DefaultParser.php @@ -9,7 +9,7 @@ use Drupal\aggregator\Plugin\ParserInterface; use Drupal\aggregator\Plugin\Core\Entity\Feed; -use Drupal\Component\Annotation\Plugin; +use Drupal\aggregator\Annotation\AggregatorParser; use Drupal\Core\Annotation\Translation; /** @@ -17,7 +17,7 @@ * * Parses RSS, Atom and RDF feeds. * - * @Plugin( + * @AggregatorParser( * id = "aggregator", * title = @Translation("Default parser"), * description = @Translation("Default parser for RSS, Atom and RDF feeds.") diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Plugin/aggregator/processor/DefaultProcessor.php b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/aggregator/processor/DefaultProcessor.php index 08777d1..6b160ff 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Plugin/aggregator/processor/DefaultProcessor.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/aggregator/processor/DefaultProcessor.php @@ -10,7 +10,7 @@ use Drupal\Component\Plugin\PluginBase; use Drupal\aggregator\Plugin\ProcessorInterface; use Drupal\aggregator\Plugin\Core\Entity\Feed; -use Drupal\Component\Annotation\Plugin; +use Drupal\aggregator\Annotation\AggregatorProcessor; use Drupal\Core\Annotation\Translation; use Drupal\Core\Database\Database; @@ -19,7 +19,7 @@ * * Creates lightweight records from feed items. * - * @Plugin( + * @AggregatorProcessor( * id = "aggregator", * title = @Translation("Default processor"), * description = @Translation("Creates lightweight records from feed items.") diff --git a/core/modules/aggregator/tests/lib/Drupal/aggregator_test/Plugin/aggregator/fetcher/TestFetcher.php b/core/modules/aggregator/tests/lib/Drupal/aggregator_test/Plugin/aggregator/fetcher/TestFetcher.php index 87975b5..8e69f8d 100644 --- a/core/modules/aggregator/tests/lib/Drupal/aggregator_test/Plugin/aggregator/fetcher/TestFetcher.php +++ b/core/modules/aggregator/tests/lib/Drupal/aggregator_test/Plugin/aggregator/fetcher/TestFetcher.php @@ -10,7 +10,7 @@ use Drupal\aggregator\Plugin\FetcherInterface; use Drupal\aggregator\Plugin\aggregator\fetcher\DefaultFetcher; use Drupal\aggregator\Plugin\Core\Entity\Feed; -use Drupal\Component\Annotation\Plugin; +use Drupal\aggregator\Annotation\AggregatorFetcher; use Drupal\Core\Annotation\Translation; use Guzzle\Http\Exception\BadResponseException; @@ -19,7 +19,7 @@ * * Uses http_default_client class to download the feed. * - * @Plugin( + * @AggregatorFetcher( * id = "aggregator_test_fetcher", * title = @Translation("Test fetcher"), * description = @Translation("Dummy fetcher for testing purposes.") diff --git a/core/modules/aggregator/tests/lib/Drupal/aggregator_test/Plugin/aggregator/parser/TestParser.php b/core/modules/aggregator/tests/lib/Drupal/aggregator_test/Plugin/aggregator/parser/TestParser.php index f698763..a9ab57c 100644 --- a/core/modules/aggregator/tests/lib/Drupal/aggregator_test/Plugin/aggregator/parser/TestParser.php +++ b/core/modules/aggregator/tests/lib/Drupal/aggregator_test/Plugin/aggregator/parser/TestParser.php @@ -10,7 +10,7 @@ use Drupal\aggregator\Plugin\ParserInterface; use Drupal\aggregator\Plugin\Core\Entity\Feed; use Drupal\aggregator\Plugin\aggregator\parser\DefaultParser; -use Drupal\Component\Annotation\Plugin; +use Drupal\aggregator\Annotation\AggregatorParser; use Drupal\Core\Annotation\Translation; /** @@ -18,7 +18,7 @@ * * Parses RSS, Atom and RDF feeds. * - * @Plugin( + * @AggregatorParser( * id = "aggregator_test_parser", * title = @Translation("Test parser"), * description = @Translation("Dummy parser for testing purposes.") diff --git a/core/modules/aggregator/tests/lib/Drupal/aggregator_test/Plugin/aggregator/processor/TestProcessor.php b/core/modules/aggregator/tests/lib/Drupal/aggregator_test/Plugin/aggregator/processor/TestProcessor.php index 3ffe213..e218b8a 100644 --- a/core/modules/aggregator/tests/lib/Drupal/aggregator_test/Plugin/aggregator/processor/TestProcessor.php +++ b/core/modules/aggregator/tests/lib/Drupal/aggregator_test/Plugin/aggregator/processor/TestProcessor.php @@ -10,7 +10,7 @@ use Drupal\Component\Plugin\PluginBase; use Drupal\aggregator\Plugin\ProcessorInterface; use Drupal\aggregator\Plugin\Core\Entity\Feed; -use Drupal\Component\Annotation\Plugin; +use Drupal\aggregator\Annotation\AggregatorProcessor; use Drupal\Core\Annotation\Translation; /** @@ -18,7 +18,7 @@ * * Creates lightweight records from feed items. * - * @Plugin( + * @AggregatorProcessor( * id = "aggregator_test_processor", * title = @Translation("Test processor"), * description = @Translation("Test generic processor functionality.")