My First Friendica Contribution...and Getting Over Developing in PHP

I first joined the fediverse back in March of 2018 after being fed up (yet again) with some Facebook shenanigans and concern over hyper-consolidation, as this post detailed . It started with an account on the Diaspora network , which feels very Facebook like. It was soon followed by one on Mastodon , which is more Twitter like. It wasn’t long after settling in that I started doing development on the Diaspora platform. My first couple pull requests (1st Diaspora PR , 2nd Diaspora PR ) were accepted just about four years ago. That then blossomed into doing some major work on the API which is in the 0.8 version of the Diaspora software. As I documented here though , by early 2019 I was kind of done with having a bifurcated fediverse existence. Friendica bridges many federating protocols so gave me what I wanted. I had considered contributing to Friendica instead, as I wrote in the previous link, and again here earlier this year , but it wasn’t until last week that I finally made that contribution.

So what was it that finally caused the break in the camel’s back and leading me to contributing? What was it that let me overcome this aversion to PHP inertia? First was me self hosting my own production instance of Friendica starting back at the end of last year. The instance I had been on the whole time went away. I figured this was a perfect opportunity for me to start doing more self hosting. I already had been through a similar operation with my Matrix instance. Now with a generic domain for that and related apps, My Social Portal , I decided a Friendica instance hanging off it would be fine. Self hosting had me getting exposed more and more to the LAMP stack, although not anything on a daily basis.

Now that I was self hosting though I had to deal with some performance issues I wasn’t happy with. This caused me to delve more into doing some SQL metrics calculations and tracking. Even though there were only two users on the system it would feel incredibly sluggish. This was a problem on the old host I had but they had hundreds of users. Now that I had my own I could interrogate the system for what was going on and how to fix it. Since it turned out to be a simple fix, or at least making the query that was being run optional, I decided it was a perfect intro to developing on the project. So that is how I got here and my first Friendica PR .

Now that I’ve done one I have lots of other things I want to help with both coding wise and documentation wise. Ripping the bandage off was really what I needed. Why? Because it compelled me to get over some of my problems with the tech stack being used. The code itself has a lot of legacy but has been through many rounds of refactoring over the years. That makes the PHP code pretty good architecturally at this point. They use dependence injection and inversion of control to make things more modular. They do a lot of stuff with best practices on typing and structures. The code wasn’t the problem it was the stack. Namely, I am at this point very used to being able to run all my projects in isolated development runtimes on my development machine. For this project, and PHP projects like this in general by the looks of it, that is simply not how things are done. Instead you setup a runtime environment like you would on a “real” server and interact with the code directly there. It is just not how I’m used to operating. Since I do most projects in isolated VMs anyway it’s really not that much of an imposition, in terms of system pollution by multiple projects. It was more of a mental block.

There were some rough edges in terms of the documentation for getting started contributing. They have some good documents for getting started but there were gaps involved. For example, I had to make changes to the internationalization strings. I needed some forum/chat help to get that working correctly. I likewise still haven’t figured out how to get my local style checks passing following the documentation examples. These are small things that I’d like to help the project overcome as well. As a new contributor I’m in a position to do this better than long time contributors. So that along with some additional tweaks that I’m looking at will be my next potential contributors to the project.