Subversion Repositories SmartDukaan

Rev

Rev 10632 | Rev 11379 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
10582 lgm 1
<?php
2
 
3
/*
4
 *---------------------------------------------------------------
5
 * APPLICATION ENVIRONMENT
6
 *---------------------------------------------------------------
7
 *
8
 * You can load different configurations depending on your
9
 * current environment. Setting the environment also influences
10
 * things like logging and error reporting.
11
 *
12
 * This can be set to anything, but default usage is:
13
 *
14
 *     development
15
 *     testing
16
 *     production
17
 *
18
 * NOTE: If you change these, also change the error_reporting() code below
19
 *
20
 */
11355 lgm 21
	// Change the session timeout value to 30 minutes  // 8*60*60 = 8 hours
22
		ini_set('session.gc_maxlifetime', 8*24*60*60);
23
	//————————————————————————————–
24
 
25
// php.ini setting required for session timeout.
26
 
27
		ini_set('session.gc_maxlifetime',8*24*60*60);
28
		ini_set('session.gc_probability',1);
29
		ini_set('session.gc_divisor',1);
30
 
31
//if you want to change the  session.cookie_lifetime.
32
//This required in some common file because to get the session values in whole application we need to        write session_start();  to each file then only will get $_SESSION global variable values.
33
 
34
		$sessionCookieExpireTime=8*24*60*60;
35
		session_set_cookie_params($sessionCookieExpireTime);
36
		define('ENVIRONMENT', 'production');
10582 lgm 37
/*
38
 *---------------------------------------------------------------
39
 * ERROR REPORTING
40
 *---------------------------------------------------------------
41
 *
42
 * Different environments will require different levels of error reporting.
43
 * By default development will show errors but testing and live will hide them.
44
 */
45
 
46
if (defined('ENVIRONMENT'))
47
{
48
	switch (ENVIRONMENT)
49
	{
50
		case 'development':
51
			error_reporting(E_ALL);
52
			ini_set('display_errors', 'on');
53
			define('_PS_DEBUG_SQL_', true);
54
		break;
55
 
56
		case 'testing':
57
		case 'production':
58
			error_reporting(0);
59
		break;
60
 
61
		default:
62
			exit('The application environment is not set correctly.');
63
	}
64
}
65
 
66
/*
67
 *---------------------------------------------------------------
68
 * SYSTEM FOLDER NAME
69
 *---------------------------------------------------------------
70
 *
71
 * This variable must contain the name of your "system" folder.
72
 * Include the path if the folder is not in the same  directory
73
 * as this file.
74
 *
75
 */
76
	$system_path = 'system';
77
 
78
/*
79
 *---------------------------------------------------------------
80
 * APPLICATION FOLDER NAME
81
 *---------------------------------------------------------------
82
 *
83
 * If you want this front controller to use a different "application"
84
 * folder then the default one you can set its name here. The folder
85
 * can also be renamed or relocated anywhere on your server.  If
86
 * you do, use a full server path. For more info please see the user guide:
87
 * http://codeigniter.com/user_guide/general/managing_apps.html
88
 *
89
 * NO TRAILING SLASH!
90
 *
91
 */
92
	$application_folder = 'application';
93
 
94
/*
95
 * --------------------------------------------------------------------
96
 * DEFAULT CONTROLLER
97
 * --------------------------------------------------------------------
98
 *
99
 * Normally you will set your default controller in the routes.php file.
100
 * You can, however, force a custom routing by hard-coding a
101
 * specific controller class/function here.  For most applications, you
102
 * WILL NOT set your routing here, but it's an option for those
103
 * special instances where you might want to override the standard
104
 * routing in a specific front controller that shares a common CI installation.
105
 *
106
 * IMPORTANT:  If you set the routing here, NO OTHER controller will be
107
 * callable. In essence, this preference limits your application to ONE
108
 * specific controller.  Leave the function name blank if you need
109
 * to call functions dynamically via the URI.
110
 *
111
 * Un-comment the $routing array below to use this feature
112
 *
113
 */
114
	// The directory name, relative to the "controllers" folder.  Leave blank
115
	// if your controller is not in a sub-folder within the "controllers" folder
116
	// $routing['directory'] = '';
117
 
118
	// The controller class file name.  Example:  Mycontroller
119
	// $routing['controller'] = '';
120
 
121
	// The controller function you wish to be called.
122
	// $routing['function']	= '';
123
 
124
 
125
/*
126
 * -------------------------------------------------------------------
127
 *  CUSTOM CONFIG VALUES
128
 * -------------------------------------------------------------------
129
 *
130
 * The $assign_to_config array below will be passed dynamically to the
131
 * config class when initialized. This allows you to set custom config
132
 * items or override any default config values found in the config.php file.
133
 * This can be handy as it permits you to share one application between
134
 * multiple front controller files, with each file containing different
135
 * config values.
136
 *
137
 * Un-comment the $assign_to_config array below to use this feature
138
 *
139
 */
140
	// $assign_to_config['name_of_config_item'] = 'value of config item';
141
 
142
 
143
 
144
// --------------------------------------------------------------------
145
// END OF USER CONFIGURABLE SETTINGS.  DO NOT EDIT BELOW THIS LINE
146
// --------------------------------------------------------------------
147
 
148
/*
149
 * ---------------------------------------------------------------
150
 *  Resolve the system path for increased reliability
151
 * ---------------------------------------------------------------
152
 */
153
 
154
	// Set the current directory correctly for CLI requests
155
	if (defined('STDIN'))
156
	{
157
		chdir(dirname(__FILE__));
158
	}
159
 
160
	if (realpath($system_path) !== FALSE)
161
	{
162
		$system_path = realpath($system_path).'/';
163
	}
164
 
165
	// ensure there's a trailing slash
166
	$system_path = rtrim($system_path, '/').'/';
167
 
168
	// Is the system path correct?
169
	if ( ! is_dir($system_path))
170
	{
171
		exit("Your system folder path does not appear to be set correctly. Please open the following file and correct this: ".pathinfo(__FILE__, PATHINFO_BASENAME));
172
	}
173
 
174
/*
175
 * -------------------------------------------------------------------
176
 *  Now that we know the path, set the main path constants
177
 * -------------------------------------------------------------------
178
 */
179
	// The name of THIS file
180
	define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME));
181
 
182
	// The PHP file extension
183
	// this global constant is deprecated.
184
	define('EXT', '.php');
185
 
186
	// Path to the system folder
187
	define('BASEPATH', str_replace("\\", "/", $system_path));
188
 
189
	// Path to the front controller (this file)
190
	define('FCPATH', str_replace(SELF, '', __FILE__));
191
 
192
	// Name of the "system folder"
193
	define('SYSDIR', trim(strrchr(trim(BASEPATH, '/'), '/'), '/'));
194
 
195
 
196
	// The path to the "application" folder
197
	if (is_dir($application_folder))
198
	{
199
		define('APPPATH', $application_folder.'/');
200
	}
201
	else
202
	{
203
		if ( ! is_dir(BASEPATH.$application_folder.'/'))
204
		{
205
			exit("Your application folder path does not appear to be set correctly. Please open the following file and correct this: ".SELF);
206
		}
207
 
208
		define('APPPATH', BASEPATH.$application_folder.'/');
209
	}
210
 
211
/*
212
 * --------------------------------------------------------------------
213
 * LOAD THE BOOTSTRAP FILE
214
 * --------------------------------------------------------------------
215
 *
216
 * And away we go...
217
 *
218
 */
219
require_once BASEPATH.'core/CodeIgniter.php';
220
 
221
/* End of file index.php */
222
/* Location: ./index.php */