Subversion Repositories SmartDukaan

Rev

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

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