mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-01-16 21:58:21 +01:00
3
RSS Bridge on PHP 5.4
Joe Digilio edited this page 2018-06-13 12:36:41 -05:00
RSS-Bridge no longer supports PHP 5.4 (see 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 4c5013bc82ea9385beb8c6354d367401a15bdf97 (release version 2018-06-10).
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; s/INI_SCANNER_TYPED/INI_SCANNER_RAW/g; s/if(!is_bool(\($config.*\)))/\1 = (\1 === "true");\n&/' ./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