Skip to content

Instantly share code, notes, and snippets.

@wagstaffj
Created April 24, 2017 11:20
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wagstaffj/24862d6c29e4c449257760cb8074ab9b to your computer and use it in GitHub Desktop.
Save wagstaffj/24862d6c29e4c449257760cb8074ab9b to your computer and use it in GitHub Desktop.
Application.cfc
component extends=framework.one {
this.ormenabled = true;
this.datasource = "store";
this.ormSettings.dbCreate = "dropcreate";
this.ormSettings.logsql = true;
this.ormSettings.dialect = "Oracle10g";
variables.framework.reloadApplicationOnEveryRequest = true;
variables.framework.diEngine = "aop1";
//variables.framework.diConfig = { interceptors = [ { beanName = "storeService", interceptorName = "StoreInterceptor", methods = "*" } ] };
//variables.framework.diConfig.interceptors = [ { beanName = "storeService", interceptorName = "StoreInterceptor" } ];
variables.framework.usingSubsystems = true;
variables.framework.defaultSubsystem = "public";
variables.framework.generateSES = true;
this.sessionManagement = true;
this.invokeImplicitAccessor = true;
public void function setupApplication(){
getbeanfactory().intercept("store","StoreInterceptor","*");
if ( StructKeyExists(url, "reload")){
ormReload();
applicationstop();
}
}
public void function setupRequest(){
request.jslib = [];
request.jsscript = [];
}
public void function setupSession(){
if ( !StructKeyExists(session,"cart"))
session.cart = variables.getbeanfactory().getBean('cartBean');
}
}
models/interceptors/StoreInterceptor.cfc
component accessors="true"
{
property framework;
function before(target, methodname, args){
getFramework().frameworkTrace("xxxxxxxxxxxx inside interceptor before xxxxxxxxxxxx", arguments);
writedump(arguments);
abort;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment