How can I tell, if the instance is OC or NC

Maybe I am blind, but how can I determine the system’s version? I try to tell, if an app runs on an OC or NC instance and it’s version via PHP. Any hint or snippet?

Use the capabilities API:

It gives you the full version string.

The version is not the problem, I can get this from the class OC\Config. But the API-Call seems not to return the product name.

did you find a solution?

sudo -u <http user> php /path/to/occ config:app:get core vendor

My solution is here: API-call to determine Nextcloud/ownCloud?

I found the vendor in the version.php on root. An example of using this is available in the updater.php.

True for Nextcloud >= 10.0.1

another suggestion is to go via the version number in JS

if (OC.config.versionstring.split(’.’)[0] <= 10) //ownCloud

works if you assume that your app normally would not support current -2 NC versions (14,13,12) only anyway