Update adapter.php

Modified insertIfNotExist() to support NULL values
add unit test
Also update sqliteadapter
improve logo flexibility to fix wide custom logo alignment, fix #9339
Libreoffice config folder needs to be set

In order to avoid conflicts between multiple instances installed on one server, it's required to define a LibreOffice configuration folder per instance.

Just like with my PR for the documents app (https://github.com/owncloud/documents/pull/353), I propose to use /tmp/owncloud-instanceid
Initialize an event source when we start using it, not in the constructor
Add event source to the public api
Use the public api to get event sources
env:UserInstallation was already there in master

My changes were made against stable7 and I merged them to the file in master, so this version is now the properly merged file for master.
I'm just adding `owncloud-<instanceid>` to the path where temp files are stored.
Use correct language package so the subject is correctly translated

Fix #10847
Fix broken new lines in plain text mail template
Explicitly cast id and validate type
Better phpdoc and method naming
Initial work on shorter links
Use a route instead of s.php and convert tokens asap
Adapt token size to new generation and add an option for free length specification

Minimum size is 3 = 46656 tokens, maximum size is 64, which is what our DB allows.
Change config.sample entry and use MediumSecurity
Use base62 and remove configuration options for link length
Readd TOKEN_LENGTH
Match \OC_Helper::linkToPublic() to new links and fit unittests