mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-07-31 13:50:23 +02:00
bridge: Refactor bridge factory to non-static class
The bridge factory can be based on the abstract factory class if it wasn't static. This allows for higher abstraction and makes future extensions possible. Also, not all parts of RSS-Bridge need to work on the same instance of the bridge factory. References #1001
This commit is contained in:
@@ -61,14 +61,17 @@ EOD;
|
||||
$totalActiveBridges = 0;
|
||||
$inactiveBridges = '';
|
||||
|
||||
$bridgeList = Bridge::getBridgeNames();
|
||||
$bridgeFac = new \BridgeFactory();
|
||||
$bridgeFac->setWorkingDir(PATH_LIB_BRIDGES);
|
||||
|
||||
$bridgeList = $bridgeFac->getBridgeNames();
|
||||
$formats = Format::getFormatNames();
|
||||
|
||||
$totalBridges = count($bridgeList);
|
||||
|
||||
foreach($bridgeList as $bridgeName) {
|
||||
|
||||
if(Bridge::isWhitelisted($bridgeName)) {
|
||||
if($bridgeFac->isWhitelisted($bridgeName)) {
|
||||
|
||||
$body .= BridgeCard::displayBridgeCard($bridgeName, $formats);
|
||||
$totalActiveBridges++;
|
||||
|
Reference in New Issue
Block a user