webERP Forum

Full Version: $RootPath & $PathPrefix
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
While digging through different code I noticed that $RootPath and $PathPrefix are being used for basically the same thing in different places. $RootPath seems a bit more robust... is there any reason for the difference?

weberp1

(03-20-2014, 05:40 PM)serakfalcon Wrote: [ -> ]While digging through different code I noticed that $RootPath and $PathPrefix are being used for basically the same thing in different places. $RootPath seems a bit more robust... is there any reason for the difference?

As I remember $RootPath was supposed to be the absolute path to the document root, and $PathPrefix is the prefix from the document root to the webERP instance.

Thanks
Tim
(03-20-2014, 07:45 PM)weberp1 Wrote: [ -> ]
(03-20-2014, 05:40 PM)serakfalcon Wrote: [ -> ]While digging through different code I noticed that $RootPath and $PathPrefix are being used for basically the same thing in different places. $RootPath seems a bit more robust... is there any reason for the difference?

As I remember $RootPath was supposed to be the absolute path to the document root, and $PathPrefix is the prefix from the document root to the webERP instance.

Thanks
Tim

OK well, basically the two function identically, since $RootPath is an absolute reference to the weberp folder, and $PathPrefix is relative to the same place (and is basically almost always an empty string?)... I would support phasing out $PathPrefix and just using $RootPath...
Well $PathPrefix is used in the report writer and other scripts which are below the top level normally with a ../.. syntax to get to the folder above or above the folder above etc. I think $RootPath could not be used because it is dependent on the called script and $PathPrefix gives the script the orientation of where the top level scripts are.