Patching Tiny Tiny RSS to work with PHP 5.2 and open_basedir restriction active

Update 2013-05-31: I updated the patch to be compatible with Tiny Tiny RSS 1.7.9. See this posting for further info.

Last time I mentioned that I installed Tiny Tiny RSS on my server but had to make some changes so that it would run without error on this particular system. I wished I didn't have to patch it myself but I couldn't convince the hoster to update the server environment (which would also affect all other users on that system, yep the downside of shared hosting) and cause all sorts of follow-up trouble.

Luckily that's not a security issue as the installation is pretty locked down on all sides but it also adds additional issues for TT RSS which requires a bit more relaxed security settings.

Tiny Tiny RSS 1.7.8 has following issues with my environment:

  1. it requires PHP 5.3 but my environment only offers PHP 5.2
  2. it requires that the security restriction open_basedir is not active

TLDR: Download and apply this patch to your Tiny Tiny RSS 1.7.8 installation to enable PHP 5.2 and open_basedir compatibility.

Long explaination: To create compatibility with my environment I had to patch Tiny Tiny RSS in the following ways:

  • replace all instance-accesses to constants with static references (e.g. $pluginhost::HOOK_RENDER_ARTICLE_API -> PluginHost::HOOK_RENDER_ARTICLE_API)
  • remove uses of namespaces (e.g. JShrink\Minifier -> Minifier)
  • implement manual follow of a feed-redirection (HTTP/301,302), as curl can't auto-follow under restricted open_basedir environments
  • fix all checks on the environment versions and restrictions to the lower PHP version and stricter security

It took a few hours and some debugging but now I'm happy so far with a Tiny Tiny RSS installation which runs aparently without any issues. At least I haven't found any problems/issues since I finished that work.

Problems still may exist in following areas, which I could not or have not tested:

  • Multi-user/account support (I don't know if the constants are accessed through variable instances for a specific reason)
  • automatic feed-update (my server doesn't allow jobs), I'm using update-on-access

That's about it. In the meantime I found out that Tiny Tiny RSS released the next version 1.7.9. I'm trying to set up a github fork where I can follow the development better and support my compatibility patch for a longer time but I'm not that experienced with that process yet so it could take some time. I'll update this post when I'm finished with that.

Patchfile: TinyTinyRSS-1.7.8_PHP-5.2_compatibility.patch

|

Similar entries

These entries are similar to this posting (as of 2017-02-10):