[owncloud-devel] API function to get data directory

Jörn Friedrich Dreyer jfd at owncloud.com
Thu Apr 21 15:03:53 GMT 2016


$config = \OC::$server->getConfig();
$datadir = $config->getSystemValue('datadirectory', \OC::$SERVERROOT . 
'/data/');


Am 21.04.2016 um 15:01 schrieb Christoph Johannes Kleine:
>
> Am 21.04.2016 um 14:33 schrieb Mathieu Fourcroy:
>> Hi,
>>
>> I am developing some features for owncloud. And I need to get the path
>> of files for a given user.
>> Physically, for user "admin" files are in
>> "/var/www/owncloud/data/admin/files/".
>>
>> I am building the path with something like:
>>
>> $path = '/var/www/owncloud/data/' . $user->getDisplayName() .
>> '/files/' . $fileName;
>>
>> This is not very portable so my question is, how to get the string
>> '/var/www/owncloud/data/' using the existing API ?
> Just read 'datadirectory' variable from config/config.php it contains
> what you want.
> _______________________________________________
> Devel mailing list
> Devel at owncloud.org
> http://mailman.owncloud.org/mailman/listinfo/devel

-- 
Dr. Jörn Friedrich Dreyer
Solutions Architect
ownCloud GmbH

Your Data, Your Cloud, Your Way!

ownCloud GmbH, GF: Markus Rex, Holger Dyroff, Frank Karlitschek
Schloßäckerstrasse 26a, 90443 Nürnberg, HRB 28050 (AG Nürnberg)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.owncloud.org/pipermail/devel/attachments/20160421/c5b87b1d/attachment.html>


More information about the Devel mailing list