jDownloadsownloads.com
Advertisement
 

Author Topic: root_dir parameter obsolete?  (Read 409 times)

0 Members and 1 Guest are viewing this topic.

Offline Tazzios

  • Jr. Member
  • **
  • Posts: 71
    • Jdownloads pdfviewer
root_dir parameter obsolete?
« on: 19.08.2021 16:30:34 »

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" ?


Offline ColinM

  • Moderator
  • *
  • Posts: 4.122
Re: root_dir parameter obsolete?
« Reply #1 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.
So yes you should be using "files_uploaddir" when locating the start of the categories and so on.

Best wishesColin

Offline Tazzios

  • Jr. Member
  • **
  • Posts: 71
    • Jdownloads pdfviewer
Re: root_dir parameter obsolete?
« Reply #2 on: 20.08.2021 14:03:52 »
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.     
Quote
So 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
« Last Edit: 20.08.2021 14:19:51 by Tazzios »

Offline ColinM

  • Moderator
  • *
  • Posts: 4.122
Re: root_dir parameter obsolete?
« Reply #3 on: 20.08.2021 17:52:52 »
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