5 * APPLICATION-WIDE CONFIGURATION SETTINGS
7 * This file contains application-wide configuration settings. The settings
8 * here will be the same regardless of the machine on which the app is running.
10 * This configuration should be added to version control.
12 * No settings should be added to this file that would need to be changed
13 * on a per-machine basic (ie local, staging or production). Any
14 * machine-specific settings should be added to _machine_config.php
16 * From phreeze package
17 * @license http://www.gnu.org/copyleft/lesser.html LGPL
22 * APPLICATION ROOT DIRECTORY
23 * If the application doesn't detect this correctly then it can be set explicitly
25 if (! GlobalConfig
::$APP_ROOT) {
26 GlobalConfig
::$APP_ROOT = realpath("./");
30 * check is needed to ensure asp_tags is not enabled
32 if (ini_get('asp_tags')) {
33 die('<h3>Server Configuration Problem: asp_tags is enabled, but is not compatible with Savant.</h3>' . '<p>You can disable asp_tags in .htaccess, php.ini or generate your app with another template engine such as Smarty.</p>');
38 * Adjust the include path as necessary so PHP can locate required libraries
40 set_include_path(GlobalConfig
::$APP_ROOT . '/libs/' . PATH_SEPARATOR
. GlobalConfig
::$APP_ROOT . '/fwk/libs' . PATH_SEPARATOR
. get_include_path());
44 * Uncomment if Composer is being used to manage dependencies
46 // $loader = require 'vendor/autoload.php';
47 // $loader->setUseIncludePath(true);
51 * Any classes that will be stored in the session can be added here
52 * and will be pre-loaded on every page
54 //require_once "App/SecureApp.php";
58 * You can use any template system that implements
59 * IRenderEngine for the view layer.
60 * Phreeze provides pre-built
61 * implementations for Smarty, Savant and plain PHP.
63 require_once 'verysimple/Phreeze/SavantRenderEngine.php';
64 GlobalConfig
::$TEMPLATE_ENGINE = 'SavantRenderEngine';
65 GlobalConfig
::$TEMPLATE_PATH = GlobalConfig
::$APP_ROOT . '/templates/';
69 * The route map connects URLs to Controller+Method and additionally maps the
70 * wildcards to a named parameter so that they are accessible inside the
71 * Controller without having to parse the URL for parameters such as IDs
73 GlobalConfig
::$ROUTE_MAP = array (
75 // default controller when no route specified
76 // 'GET:' => array('route' => 'Default.Home'),
78 'route' => 'Provider.Home'
80 'GET:provider' => array (
81 'route' => 'Provider.Home'
84 // authentication routes
85 'GET:loginform' => array (
86 'route' => 'SecureApp.LoginForm'
88 'POST:login' => array (
89 'route' => 'SecureApp.Login'
91 'GET:secureuser' => array (
92 'route' => 'SecureApp.UserPage'
94 'GET:secureadmin' => array (
95 'route' => 'SecureApp.AdminPage'
97 'GET:logout' => array (
98 'route' => 'SecureApp.Logout'
102 'GET:patientdata' => array (
103 'route' => 'Patient.ListView'
105 'GET:patient/(:num)' => array (
106 'route' => 'Patient.SingleView',
111 'GET:api/patientdata' => array (
112 'route' => 'Patient.Query'
114 'POST:api/patient' => array (
115 'route' => 'Patient.Create'
117 'GET:api/patient/(:num)' => array (
118 'route' => 'Patient.Read',
123 'PUT:api/patient/(:num)' => array (
124 'route' => 'Patient.Update',
129 'DELETE:api/patient/(:num)' => array (
130 'route' => 'Patient.Delete',
135 'PUT:api/portalpatient/(:num)' => array (
136 'route' => 'PortalPatient.Update',
141 'GET:api/portalpatient/(:num)' => array (
142 'route' => 'PortalPatient.Read',
149 'GET:onsitedocuments' => array (
150 'route' => 'OnsiteDocument.ListView'
152 'GET:onsitedocument/(:num)' => array (
153 'route' => 'OnsiteDocument.SingleView',
158 'GET:api/onsitedocuments' => array (
159 'route' => 'OnsiteDocument.Query'
161 'POST:api/onsitedocument' => array (
162 'route' => 'OnsiteDocument.Create'
164 'GET:api/onsitedocument/(:num)' => array (
165 'route' => 'OnsiteDocument.Read',
170 'PUT:api/onsitedocument/(:num)' => array (
171 'route' => 'OnsiteDocument.Update',
176 'DELETE:api/onsitedocument/(:num)' => array (
177 'route' => 'OnsiteDocument.Delete',
183 // OnsitePortalActivity
184 'GET:onsiteportalactivities' => array (
185 'route' => 'OnsitePortalActivity.ListView'
187 'GET:onsiteportalactivity/(:num)' => array (
188 'route' => 'OnsitePortalActivity.SingleView',
193 'GET:api/onsiteportalactivities' => array (
194 'route' => 'OnsitePortalActivity.Query'
196 'POST:api/onsiteportalactivity' => array (
197 'route' => 'OnsitePortalActivity.Create'
199 'GET:api/onsiteportalactivity/(:num)' => array (
200 'route' => 'OnsitePortalActivity.Read',
205 'PUT:api/onsiteportalactivity/(:num)' => array (
206 'route' => 'OnsitePortalActivity.Update',
211 'DELETE:api/onsiteportalactivity/(:num)' => array (
212 'route' => 'OnsitePortalActivity.Delete',
217 // OnsiteActivityView
218 'GET:onsiteactivityviews' => array (
219 'route' => 'OnsiteActivityView.ListView'
221 'GET:onsiteactivityview/(:any)' => array (
222 'route' => 'OnsiteActivityView.SingleView',
227 'GET:api/onsiteactivityviews' => array (
228 'route' => 'OnsiteActivityView.Query'
230 'POST:api/onsiteactivityview' => array (
231 'route' => 'OnsiteActivityView.Create'
233 'GET:api/onsiteactivityview/(:any)' => array (
234 'route' => 'OnsiteActivityView.Read',
239 'PUT:api/onsiteactivityview/(:any)' => array (
240 'route' => 'OnsiteActivityView.Update',
245 'DELETE:api/onsiteactivityview/(:any)' => array (
246 'route' => 'OnsiteActivityView.Delete',
253 'GET:users' => array (
254 'route' => 'User.ListView'
256 'GET:user/(:num)' => array (
257 'route' => 'User.SingleView',
262 'GET:api/users' => array (
263 'route' => 'User.Query'
265 'POST:api/user' => array (
266 'route' => 'User.Create'
268 'GET:api/user/(:num)' => array (
269 'route' => 'User.Read',
274 'PUT:api/user/(:num)' => array (
275 'route' => 'User.Update',
280 'DELETE:api/user/(:num)' => array (
281 'route' => 'User.Delete',
288 'GET:usersfacilities' => array (
289 'route' => 'UsersFacility.ListView'
291 'GET:usersfacility/(:any)' => array (
292 'route' => 'UsersFacility.SingleView',
297 'GET:api/usersfacilities' => array (
298 'route' => 'UsersFacility.Query'
300 'POST:api/usersfacility' => array (
301 'route' => 'UsersFacility.Create'
303 'GET:api/usersfacility/(:any)' => array (
304 'route' => 'UsersFacility.Read',
309 'PUT:api/usersfacility/(:any)' => array (
310 'route' => 'UsersFacility.Update',
315 'DELETE:api/usersfacility/(:any)' => array (
316 'route' => 'UsersFacility.Delete',
322 // catch any broken API urls
323 'GET:api/(:any)' => array (
324 'route' => 'Provider.ErrorApi404'
326 'PUT:api/(:any)' => array (
327 'route' => 'Provider.ErrorApi404'
329 'POST:api/(:any)' => array (
330 'route' => 'Provider.ErrorApi404'
332 'DELETE:api/(:any)' => array (
333 'route' => 'Provider.ErrorApi404'