Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

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