加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
Application.cfc 1.95 KB
一键复制 编辑 原始数据 按行查看 历史
chinavane 提交于 2014-12-19 13:26 . member&logistics
component extends="org.corfield.framework" {
this.directory = getDirectoryFromPath( getCurrentTemplatePath() );
// Configure application mappgins. In this case, we'll be using the uploads and chunks
// mapping with the expandPath() function later on when saving files.
this.mappings[ "/uploads" ] = ( this.directory & "uploads/" );
this.mappings[ "/chunks" ] = ( this.directory & "chunks/" );
this.name = "b2c";
this.sessionManagement = true;
this.sessionTimeout = createTimeSpan(0,1,0,0);
this.dataSource = this.name;
this.ormEnabled = true;
this.ormsettings = {
cfclocation="./model/beans",
dbcreate="update", // update database tables only
dialect="MySQL", // assume MySql, other dialects available http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSED380324-6CBE-47cb-9E5E-26B66ACA9E81.html
eventhandling="true",
eventhandler="root.model.beans.eventhandler",
logsql="true"
};
this.mappings["/root"] = getDirectoryFromPath(getCurrentTemplatePath());
variables.framework = {
reloadApplicationOnEveryRequest = "true",
trace = "false"
};
public function setupSession() {
// 控制用户session,获取用户登陆信息内容
controller('security.session');
}
public function setupApplication() {
Application.DataMgr = CreateObject("component","DataMgr.DataMgr_MYSQL").init(this.dataSource);
var bf = new framework.ioc("./model/services"); // ColdFusion ORM handles Beans
setBeanFactory(bf);
//设置全局变量
request.rows = 10;
request.baiduAk= '1FRohQ2W2TH9XGvEHmuckB6G';
}
public function setupRequest() {
if(structKeyExists(url, "init")) { // use index.cfm?init to reload ORM
setupApplication();
ormReload();
location(url="index.cfm",addToken=false);
}
// 权限控制判断
controller("security.authorize");
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化