diff --git a/RSS-Bridge-on-PHP-5.4.md b/RSS-Bridge-on-PHP-5.4.md new file mode 100644 index 0000000..ebd33d3 --- /dev/null +++ b/RSS-Bridge-on-PHP-5.4.md @@ -0,0 +1,41 @@ +RSS-Bridge does no longer support PHP 5.4 (see [Requirements](Requirements)), but can be made compatible to run on PHP 5.4 installations. The following script provides an automated way to downgrade the sources. + +Be aware that this script may stop working on any release without notice. This script may or may not be updated in the future. It is known to work on commit [2fd60c68b083f43068703cab87c5e72a8eacc1c4](https://github.com/RSS-Bridge/rss-bridge/commit/2fd60c68b083f43068703cab87c5e72a8eacc1c4). + +Place the following content in a file called **downgrade.sh** in the **root folder of your RSS-Bridge installation**: + +``` +#!/bin/bash +# downgrade.sh +echo "Downgrade RSS-Bridge to PHP 5.4.0" + +# index.php +sed -i 's/5.6.0/5.4.0/g' ./index.php + +# html.php +sed -i 's/$bridgeClass::PARAMETERS/$bridgeClass::$PARAMETERS/g' ./lib/html.php + +# BridgeAbstract.php +sed -i 's/const PARAMETERS/public static $PARAMETERS/g' ./lib/BridgeAbstract.php +sed -i 's/static::PARAMETERS/static::$PARAMETERS/g' ./lib/BridgeAbstract.php +sed -i 's/self::PARAMETERS/self::$PARAMETERS/g' ./lib/BridgeAbstract.php + +# Bridges +for f in ./bridges/*.php +do + sed -i 's/const PARAMETERS/public static $PARAMETERS/g' "$f" + sed -i 's/static::PARAMETERS/static::$PARAMETERS/g' "$f" + sed -i 's/self::PARAMETERS/self::$PARAMETERS/g' "$f" + sed -i 's/(empty($this/(!($this/g' "$f" + sed -i 's/(!empty($this/(($this/g' "$f" +done +``` + +run the following commands in your SSH terminal: + +``` +# chmod +x ./downgrade.sh +# ./downgrade.sh +``` + +Now RSS-Bridge will work on PHP 5.4