News:

Dear forum visitors, if the support forum is not available, please try again a few minutes later. Thanks!

Main Menu
Support-Forum

root_dir parameter obsolete?

Started by Tazzios, 19.08.2021 16:30:34

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Tazzios


In the params in the database I find:
"files_uploaddir" and "root_dir".
the first one you can change from the backend the second one cannot be changed.
I used the second one for getting the filepath in my pdfviewer plugin, which gives some problems when cloning sites because root_dir does not change.

Is "root_dir" something obsolete and should i use "files_uploaddir" ?


ColinM

Tazzios,
"files_uploaddir" has the address of where the 'categories' start, that is basically the location of the jdownloads directory.  It could be described as the "data root".
"root_dir" is definitely not obselete!! It is used in various places and has variable contents. In some places it is the same as the "files_uploaddir" and in others it is formed from the Joomla 'root'.  It is more like a working variable.
So yes you should be using "files_uploaddir" when locating the start of the categories and so on.

Best wishesColin
Colin M
  •  

Tazzios

#2
Quote from: ColinM on 20.08.2021 10:12:35
Tazzios,
"files_uploaddir" has the address of where the 'categories' start, that is basically the location of the jdownloads directory.  It could be described as the "data root".
"root_dir" is definitely not obselete!! It is used in various places and has variable contents. In some places it is the same as the "files_uploaddir" and in others it is formed from the Joomla 'root'.  It is more like a working variable.
In the database they both  contain the same value. If root_dir has sometimes an other value in the code the value probably extracted from somewhere else instead of the database. ;)

If root_dir is neccesary it would benice if there is an edit field in options to that it can bechanged when i site is copied to an other location. Else testenviroments,cloning and staging which, are very handy to use for building testing and updating, won`t work with jdownloads because root_dir will always contains the absolutete from the original installation. Altough in a quick test where i change the value from root_dir in the database  to 'xxx' all basic functions still seems to work. I noticed teh value is updated if i click save at the jdownload options but where it gets the info from is unclear.     
QuoteSo yes you should be using "files_uploaddir" when locating the start of the categories and so on.

Best wishesColin
I will change my code to use the "files_uploaddir" parameter

ColinM

Tazzios
$root_directory is one of those strictly internal items.  It is not meant to be a user accessible item.  I often clone with XAMPP and it gives no problem
Colin
Colin M
  •