Skip to content

Commit

Permalink
Merge pull request #42 from stevewithington/master
Browse files Browse the repository at this point in the history
update Application.cfc for 7.1
  • Loading branch information
stevewithington authored Dec 12, 2017
2 parents 7b9ac90 + 5f643d9 commit 286bf46
Showing 1 changed file with 18 additions and 12 deletions.
30 changes: 18 additions & 12 deletions Application.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,25 @@
limitations under the License.
*/
component {
this.pluginPath=getDirectoryFromPath(getCurrentTemplatePath());
this.depth = ListFind(this.pluginPath, 'plugins', '\/');
this.webRoot = RepeatString('../', this.depth);
this.appSettingsFile = this.webRoot & 'config/applicationSettings.cfm';

try {
include this.appSettingsFile;
} catch(MissingInclude e) {
include this.webRoot & 'core/appcfc/applicationSettings.cfm';
this.pluginPath = GetDirectoryFromPath(GetCurrentTemplatePath());
this.muraroot = Left(this.pluginPath, Find('plugins', this.pluginPath) - 1);
this.depth = ListLen(RemoveChars(this.pluginPath,1, Len(this.muraroot)), '\/');
this.includeroot = RepeatString('../', this.depth);

if ( DirectoryExists(this.muraroot & 'core') ) {
// Using 7.1
this.muraAppConfigPath = this.includeroot & 'core/';
include this.muraAppConfigPath & 'appcfc/applicationSettings.cfm';
} else {
// Pre 7.1
this.muraAppConfigPath = this.includeroot & 'config';
include this.includeroot & 'config/applicationSettings.cfm';

try {
include this.includeroot & 'config/mappings.cfm';
include this.includeroot & 'plugins/mappings.cfm';
} catch(any e) {}
}

try {
include this.webRoot & 'config/mappings.cfm';
include this.webRoot & 'plugins/mappings.cfm';
} catch(any e) {}
}

0 comments on commit 286bf46

Please sign in to comment.