/
Application.cfc
58 lines (43 loc) · 1.78 KB
/
Application.cfc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<cfscript>
component
output = "false"
hint = "I define the application settings and event handlers."
{
// Define the application settings.
this.name = hash( getCurrentTemplatePath() );
this.applicationTimeout = createTimeSpan( 0, 0, 10, 0 );
this.sessionManagement = false;
// Get the current directory and the root directory so that we can
// set up the mappings to our components.
this.appDirectory = getDirectoryFromPath( getCurrentTemplatePath() );
this.projectDirectory = ( this.appDirectory & "../../" );
// Map to our Lib folder so we can access our project components.
this.mappings[ "/lib" ] = ( this.projectDirectory & "lib/" );
// Map to our Vendor folder so we can access 3rd-party components.
this.mappings[ "/vendor" ] = ( this.projectDirectory & "vendor/" );
// I initialize the request.
public boolean function onRequestStart(){
// Store the credentials for the Pusher App API.
// *********************************************************
// THESE ARE DEMO CREDENTIALS AND SHOULD NOT BE USED IN YOUR
// PRODUCTION APP; THEY ARE FOR SANDBOX USE AND HAVE HARD
// LIMITS ON CONNECTIONS AND MESSAGES. SWAP THESE OUT WHEN
// YOU IMPLEMENT THIS LIBRARY.
// *********************************************************
request.pusherAppID = "1577";
request.pusherKey = "967025141727846f5a79";
request.pusherSecret = "5a7fd901cdf3e73c18b5";
// *********************************************************
// Create an instance of our pusher component using our demo
// credentials and the Crypto library.
request.pusher = new lib.Pusher(
appID = request.pusherAppID,
appKey = request.pusherKey,
appSecret = request.pusherSecret,
crypto = new vendor.crypto.Crypto()
);
// Return true so the page can load.
return( true );
}
}
</cfscript>