May 31, 2013

Updated Tiny Tiny RSS to PHP 5.2 compatibility patch

In my previous post I offered a patch to Tiny Tiny RSS which made it possible to install and use Tiny Tiny RSS also on web servers which did not exactly meet the minimum requirements.

Today I managed to update and test the patch for the latest version of Tiny Tiny RSS, 1.7.9. This time the creation of the patch was much easier as large portions of the code have been changed in the meantime in a way which is compatible again with PHP 5.2, namely the usage of constants through instance variables has been removed in large parts of the code. But not everywhere.

Again, following things have been changed to make TT-RSS compatible to the older PHP version:

  • replace remaining constant-accesses via instances with static accesses
  • remove usages of namespaces (JShrink/MInify)
  • deactivate whole OTP (One Time Password) functionality, as this makes heavy usage of namespaces and I haven't been able to convert that completely

Like last time I offer a single patchfile which can be applied to Tiny Tiny RSS 1.7.9 or you can fetch the already patched installation files directly from the respective Github repository.

For installation just use the patched files instead of the original 1.7.9 files and follow the Tiny Tiny RSS installation guide as usual.

May 13, 2013

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

May 12, 2013

Short recap of the last month

I don't exactly know why but in the past month I somehow did not find the time and motivation to create a proper post but several things have happened and this is just a quick summary over them all.

This may or may not be followed by individual posts on each single subject. I hope that I get around to that but no guarantees. So lets get it on.

On the LED Cube front I hinted on a "recent technical acquisition" in my last post on that subject. Well, this acquisition is nothing less than a full blown digital oscilloscope. YAY. It took a few weeks to decide and also a few days to find a suitable distributor but now I'm a proud owner of an Owon SDS7102V 100MHz digital scope.

The next notable gadget I (finally) received is the long-awaited Pebble watch. Within two days this little gem became the most notable thing which I didn't know I have been missing as companion for my phone for a long time. Despite some bad reviews on other places, I've been expecting an "extension" to my phone's display and that's exactly what I got. No need to long for the phone in my pocket anymore when there's something up. Within a second I know what's up and can still decide if I should take out the phone or just ignore a received spam mail until later. Furthermore much less distraction for other participants in case of meetings. Currently I'm mainly using this Star Trek inspired watchface for displaying the time and I also have installed Pebble Notifier on my phone to forward notifications of some selected applications to the watch, even if these aren't natively supported by the Pebble app itself. Great tool. And it's quite exceeding the expected runtime, my current record is set at 10 days without recharge (and that's before I discovered the option to not turn on the backlight when there's enough ambient light).

I also attended several events. The first one was the Grazer Linuxtage which is a mixture of project exhibition and series of lectures all centered around Linux. Like two years ago, where I also attended, the lectures were quite interesting and I hope that I find some time to try out or have a deeper look at some things I noted down during the lectures. The only negative point of the event is that the place is getting much too small for this event. Many of the lectures I attended that day were so crowded that late-comers could not even enter the lecture hall anymore. I hope that this changes in the future.

One followup-event which I got notice of on the Linuxtage was a (Linux) Show and Tell at the realraum Graz. At this event people showcased their favourite or special Linux tools, i.e. special use cases and capabilities of SSH. Before that event I thought that I'm not that bad with the Linux console, but I've been pretty much floored by the experts there. Which is not necessarily as bad as it sounds because at least I understood everything the guys were talking about :)

The barcamp Graz was the next event which I visited. That time this was a three-day long event and luckily I could be there all days. A barcamp is like a conference just with the difference that every attendand is a participant and presenter. The detail topics of the sessions are not planned before but are decided on and ordered by all participants at the start of each day by themselves. It was a very interesting experience and made it possible to have a look at many different topics from many different points of view.

One special thing I took away from the barcamp was the idea of a Repair Cafe. This is a privately organized meetup of people to just repair broken everyday stuff and get some more lifetime out of it. It is some sort of counteraction against the creeping planned obsolescence of things. We were several people who were interested in that idea and it seems that Brigitte and I are currently the ones who are further driving the idea. Maybe there is the chance of a permanent recurring event where everyone helps everybody :)

Since Google Reader is discontinued by July 1st I've been looking for alternatives for some time now. I had a long look at Feedly but in the end didn't decide on it because it does not have a clean web interface but only works through native apps or browser plugins. So I chose to install Tiny Tiny RSS on my own. During installation I just hit a roadblock or two. In fact, my problems were that the minimum requirements for TT-RSS were PHP 5.3 and special server modes (e.g. no php_basedir/open_basedir restriction) while my hosting provider only offered PHP 5.2 with active open_basedir restriction. After trying to find an alternative to that (which wasn't successful) I decided to go the hard way and back-port and refactor Tiny Tiny RSS to work with my hosters restrictions. It took a few hours but finally I had a flawlessly running TT-RSS despite the settings of my hosting. I will post the changes here as soon as I come around to create a proper patchfile (maybe that will happen in the nearer future).

And finally last weekend I had the honor to be invited to my cousins wedding. It was a very nice and private wedding with (almost) only the closest relatives invited. Thanks for that and best wishes!