How is the pearFile parameter changed?
chanskw opened this issue · 7 comments
I noticed that work has been done to make relative paths relative to the root of the application directory.
But when trying out the latest build, I specified etc/mypear.pear as the pearFile parameter, and it still seems to be relative to the etc directory.
Can you describe what has been changed? How should people migrate?
No need to migrate. Both options are supported.
- relative from applicationDir
- relative from etc dir (compatibility mode with older apps)
sorry.. not sure I understand.
If I specify etc/mypear.pear file... it should be relative to the applicationDir? I did not turn on compatibility mode. How is compatibility mode done? I don't think I am getting the behavior that I am expecting in the latest build...
You can specify either
etc/mypear.pear
or
mypear.pear
If file is located in etc dir
how does that work...
If I specify etc/mypear.pear - then the root is app path?
If I specify mypear.pear.. then the root is etc?
But.. what if I really want to just specify appPath/mypear.pear?
btw.... I specify etc/myPear.pear... and it's still going to etc/etc/myPear.pear
it is open source you could have a look at the source code.
It is checked if file is present with etc dir as base otherwise base is either applDir
baseDir = context.getPE().getApplicationDirectory();
if (true == new File(baseDir + File.separator + "etc" + File.separator + pearFileParam).isFile()) {
// compatibility:
// in earlier versions it was sufficient to apply the filename only,
// if the PEAR file is located in applications etc dir.
trace.debug("pearFile base is ApplicationDirectory/etc");
baseDir = new File(baseDir + File.separator + "etc");
}