Skip to content

Commit

Permalink
[BUGFIX] Add SimplePie library bundle to fix execution in non-compose…
Browse files Browse the repository at this point in the history
…r installations
  • Loading branch information
ErHaWeb committed Jan 29, 2024
1 parent 8d01428 commit 568fb4b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
Binary file added Libraries/simplepie-simplepie.phar
Binary file not shown.
11 changes: 11 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,16 @@
"typo3/class-alias-loader": true,
"typo3/cms-composer-installers": true
}
},
"scripts": {
"create-libs": [
"mkdir -p Libraries",
"@composer global require clue/phar-composer",
"[ -f Libraries/simplepie-simplepie.phar ] || $HOME/.composer/vendor/bin/phar-composer build 'simplepie/simplepie=^1.8' Libraries/simplepie-simplepie.phar",
"chmod -x Libraries/*"
],
"build-extension": [
"@create-libs"
]
}
}
8 changes: 8 additions & 0 deletions ext_localconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

declare(strict_types=1);

use TYPO3\CMS\Core\Core\Environment;
use TYPO3\CMS\Core\Information\Typo3Version;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
Expand Down Expand Up @@ -51,4 +52,11 @@
* Cache Registration
*/
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['feeddisplay'] ??= [];

/*
* Load SimplePie library from phar file if not in composer mode
*/
if (!class_exists(\SimplePie\SimplePie::class) && !Environment::isComposerMode()) {
require_once 'phar://' . ExtensionManagementUtility::extPath('feed_display') . 'Libraries/simplepie-simplepie.phar/vendor/autoload.php';
}
})();

0 comments on commit 568fb4b

Please sign in to comment.