Commit 5c688d8f authored by Duro Arezina's avatar Duro Arezina Committed by Youri van Koppen
Browse files

Issue #3313864 by devad, MegaChriz, irinaz: Added integration with the Ludwig...

Issue #3313864 by devad, MegaChriz, irinaz: Added integration with the Ludwig module in order to be able to use Feeds on Drupal 10 without Composer.
parent 58bd2457
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -14,6 +14,12 @@ use Drupal\Core\Template\Attribute;
use Drupal\Core\Url;
use Drupal\feeds\Entity\Feed;

// Ludwig module integration.
if (\Drupal::hasService('ludwig.require_once')) {
  $ludwig_require_once = \Drupal::service('ludwig.require_once');
  $ludwig_require_once->requireOnce('laminas/laminas-servicemanager', 'src/autoload.php', dirname(__FILE__));
}

/**
 * Implements hook_help().
 */

ludwig.json

0 → 100644
+20 −0
Original line number Diff line number Diff line
{
  "require": {
    "laminas/laminas-escaper": {
      "version": "2.10.0",
      "url": "https://github.com/laminas/laminas-escaper/archive/2.10.0.zip"
    },
    "laminas/laminas-feed": {
      "version": "2.18.2",
      "url": "https://github.com/laminas/laminas-feed/archive/2.18.2.zip"
    },
    "laminas/laminas-servicemanager": {
      "version": "3.15.0",
      "url": "https://github.com/laminas/laminas-servicemanager/archive/3.15.0.zip"
    },
    "laminas/laminas-stdlib": {
      "version": "3.13.0",
      "url": "https://github.com/laminas/laminas-stdlib/archive/3.13.0.zip"
    }
  }
}
+6 −0
Original line number Diff line number Diff line
@@ -27,6 +27,12 @@ class SyndicationParser extends ParserBase implements ParserInterface {
   * {@inheritdoc}
   */
  public function parse(FeedInterface $feed, FetcherResultInterface $fetcher_result, StateInterface $state) {
    if (!class_exists('Laminas\Feed\Reader\Reader')) {
      throw new \RuntimeException($this->t('The library "@library" is not installed. You can install it with Composer or by using the Ludwig module.', [
        '@library' => 'laminas/laminas-feed',
      ]));
    }

    $result = new ParserResult();
    Reader::setExtensionManager(\Drupal::service('feeds.bridge.reader'));
    Reader::registerExtension('GeoRSS');