public static function getDataPath()
{
$app = self::create();
$app->services->config->loadSettingsFile();
if ($GLOBALS['_ELGG']->dataroot_in_settings) {
return $app->services->config->getVolatile('dataroot');
}
$dataroot = $app->services->configTable->get('dataroot');
if (!$dataroot) {
throw new \InstallationException('The config table lacks a value for "dataroot".');
}
$dataroot = rtrim($dataroot, '/\\') . DIRECTORY_SEPARATOR;
$app->services->config->set('dataroot', $dataroot);
return $dataroot;
}