Sessions are, in many bits of web software, used to store the details of the currently logged in user, and to provide the concept of a user being logged in and logged out. Known is no exception in this.

These sessions need to be stored, in some way, on the server. Usually this is either stored in files, or in a database.

Known currently has the ability to store sessions in the currently enabled database engine (Mysql, mongo etc), or in files. However, for various reasons (e.g. you want to use a different database engine to store sessions, or you want to implement a fancy session store), it would be useful to decouple the sessions from the database.

This pull request adds the ability to specify, in your config.ini, a handler class implementing the Idno\Common\SessionStorageInterface interface.

This new class can then implement a session handler which uses a different storage engine, other than just files and the current database.

Before migrating over to MySQL as the officially “blessed” database engine, Known previously used MongoDB.

The support for this was provided by the PECL extension ‘mongo’, which while supported in PHP5.4, was later deprecated and completely removed in PHP 7. This left early adopters, like myself, no upgrade path to PHP 7.

The end goal I believe, is to build a bullet proof import/export function into Known and get everyone over onto MySql, however in order to give us a little more runway, I took the opportunity to rewrite the mongo database driver to use the newer (and supported) MongoDB driver.

This pull request completely replaces the existing mongo code with a backwards compatible version built on the newer MongoDB driver, handling both database and GridFS.

Of course, while it does pass unit tests, this is a big change, so I encourage existing mongo users to kick it about for a bit, and also be sure to take a full backup of your existing stuff before rolling out this change.

Let me know your thoughts!

I use Ubuntu as my main desktop operating system, together with Gnome Fallback/failsafe, because I dislike Unity and want to keep my Gnome 2 desktop.

This might not be relevant to the problem, but when I upgraded from 14.4 to 16.4, I lost my sound card. When the computer booted, I would get the Ubuntu drums, but once I logged in, the only sound I had came out of my USB headphones. I no longer saw my Intel HDA soundcard listed in the gnome sounds settings.

After a lot of digging I eventually worked out the cause of the problem, and a temporary fix. Long story short, pulseaudio couldn’t detect the sound card, because Ubuntu have changed the way it’s loaded.

You need to therefore reload the detection libraries and restart pulseaudio, run the following command:

Now, I have a startup script that I run as part of my user login to set up my desktop environment and kick of my development environment, so it was enough for me to put this command in that script.

You will probably want to make sure you load this module in your pulseaudio init scripts. Anyway, hope this helps.