Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

Application.cfc 4.0 KB

You have to be logged in to leave a comment. Sign In
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
  1. /**
  2. * Copyright 2005-2007 ColdBox Framework by Luis Majano and Ortus Solutions, Corp
  3. * www.ortussolutions.com
  4. * ---
  5. * Application Bootstrap
  6. */
  7. component {
  8. /**
  9. * --------------------------------------------------------------------------
  10. * Application Properties: Modify as you see fit!
  11. * --------------------------------------------------------------------------
  12. */
  13. this.name = "My ColdBox Application";
  14. this.sessionManagement = true;
  15. this.sessionTimeout = createTimespan( 0, 1, 0, 0 );
  16. this.setClientCookies = true;
  17. this.setDomainCookies = true;
  18. this.scriptProtect = false;
  19. this.secureJSON = false;
  20. this.timezone = "UTC";
  21. this.whiteSpaceManagement = "smart";
  22. /**
  23. * --------------------------------------------------------------------------
  24. * Java Integration
  25. * --------------------------------------------------------------------------
  26. * Modify only if you need to, else default them: https://cfdocs.org/application-cfc
  27. */
  28. this.javaSettings = {
  29. loadPaths : [ expandPath( "./lib/java" ) ],
  30. loadColdFusionClassPath : true,
  31. reloadOnChange : false
  32. };
  33. /**
  34. * --------------------------------------------------------------------------
  35. * ColdBox Bootstrap Settings
  36. * --------------------------------------------------------------------------
  37. * Modify only if you need to, else default them.
  38. * https://coldbox.ortusbooks.com/getting-started/configuration/bootstrapper-application.cfc
  39. */
  40. // COLDBOX STATIC PROPERTY, DO NOT CHANGE UNLESS THIS IS NOT THE ROOT OF YOUR COLDBOX APP
  41. COLDBOX_APP_ROOT_PATH = getDirectoryFromPath( getCurrentTemplatePath() );
  42. // The web server mapping to this application. Used for remote purposes or static purposes
  43. COLDBOX_APP_MAPPING = "";
  44. // COLDBOX PROPERTIES
  45. COLDBOX_CONFIG_FILE = "";
  46. // COLDBOX APPLICATION KEY OVERRIDE
  47. COLDBOX_APP_KEY = "";
  48. // By default if a reinit is issued, other requests fail and wait.
  49. COLDBOX_FAIL_FAST = true;
  50. /**
  51. * --------------------------------------------------------------------------
  52. * Location Mappings
  53. * --------------------------------------------------------------------------
  54. * - cbApp : Quick reference to root application
  55. * - coldbox : Where ColdBox library is installed
  56. */
  57. this.mappings[ "/cbapp" ] = COLDBOX_APP_ROOT_PATH;
  58. this.mappings[ "/coldbox" ] = COLDBOX_APP_ROOT_PATH & "coldbox";
  59. /**
  60. * --------------------------------------------------------------------------
  61. * ORM + Datasource Settings
  62. * --------------------------------------------------------------------------
  63. */
  64. this.datasource = "coldbox";
  65. /**
  66. * Fires when the application starts
  67. */
  68. public boolean function onApplicationStart(){
  69. setting requestTimeout ="300";
  70. application.cbBootstrap= new coldbox.system.Bootstrap(
  71. COLDBOX_CONFIG_FILE,
  72. COLDBOX_APP_ROOT_PATH,
  73. COLDBOX_APP_KEY,
  74. COLDBOX_APP_MAPPING
  75. );
  76. application.cbBootstrap.loadColdbox();
  77. return true;
  78. }
  79. /**
  80. * Fires when the application ends
  81. *
  82. * @appScope The app scope
  83. */
  84. public void function onApplicationEnd( struct appScope ){
  85. arguments.appScope.cbBootstrap.onApplicationEnd( arguments.appScope );
  86. }
  87. /**
  88. * Fires on every request
  89. *
  90. * @targetPage The requested page
  91. */
  92. public boolean function onRequestStart( string targetPage ){
  93. // Process ColdBox Request
  94. application.cbBootstrap.onRequestStart( arguments.targetPage );
  95. return true;
  96. }
  97. /**
  98. * Fires on every session start
  99. */
  100. public void function onSessionStart(){
  101. if ( !isNull( application.cbBootstrap ) ) {
  102. application.cbBootStrap.onSessionStart();
  103. }
  104. }
  105. /**
  106. * Fires on session end
  107. *
  108. * @sessionScope The session scope
  109. * @appScope The app scope
  110. */
  111. public void function onSessionEnd( struct sessionScope, struct appScope ){
  112. arguments.appScope.cbBootStrap.onSessionEnd( argumentCollection = arguments );
  113. }
  114. /**
  115. * On missing template handler
  116. *
  117. * @template
  118. */
  119. public boolean function onMissingTemplate( template ){
  120. return application.cbBootstrap.onMissingTemplate( argumentCollection = arguments );
  121. }
  122. }
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...