@@ -22,65 +22,65 @@ |
||
22 | 22 | * You should have received a copy of the GNU General Public License |
23 | 23 | * along with this program; if not, write to the Free Software |
24 | 24 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
25 | - */ |
|
25 | + */ |
|
26 | 26 | |
27 | 27 | /** |
28 | - * This file contains the configuration of your routes that is to say that links to your URLs. |
|
29 | - * The index of the $route array contains the url address to capture and the value contains |
|
30 | - * the name of the module, controller and the method to call. |
|
31 | - * For example : |
|
32 | - * |
|
33 | - * $route['/users/login'] = 'moduleUsers#UsersController@login_action'; |
|
34 | - * |
|
35 | - * it means, if the user type in the address bar an URL like http://yoursite.com/users/login, |
|
36 | - * that will call the module "moduleUsers", the controller "UsersController" and the method "login_action". |
|
37 | - * Note 1: it is recommended that each index in the $route array start with a slash "/" |
|
38 | - * otherwise on some system this will not work. |
|
39 | - * Note 2: to define the default controller route (homepage) of your application you use only the index "/" |
|
40 | - * for example the following route represents the homepage: |
|
41 | - * |
|
42 | - * $route['/'] = 'Home'; //only the controller or module name |
|
43 | - * |
|
44 | - * $route['/'] = 'Home@index'; //only the controller or module name with the method |
|
45 | - * |
|
46 | - * $route['/'] = 'module#Home@index'; //with module name, controller and method |
|
47 | - * |
|
48 | - * Note 3: If the method is not specified then the "index" method will be used as |
|
49 | - * default method. For example in the case of our homepage, this will be able to make: |
|
50 | - * |
|
51 | - * $route['/'] = 'Home'; |
|
52 | - * |
|
53 | - * Note 4: All methods called must have "public" visibility if you know the principle of |
|
54 | - * Object Oriented Programming, you know what visibility means (public, protected, private). |
|
55 | - * |
|
56 | - * In the index of your route, you can use the markers (:num), (:alpha), (:alnum) and (:any) which correspond |
|
57 | - * respectively to the regular expression [0-9], [a-zA-Z], [a-zA-Z0-9] and. *. |
|
58 | - * For example : |
|
59 | - * |
|
60 | - * - $route['/profile/(:num)'] = 'UsersController@profile'; => http://yoursite.com/profile/4 will be captured but |
|
61 | - * http://yoursite.com/profile/a will not captured. |
|
62 | - * |
|
63 | - * - $route['/profile/(:alpha)'] = 'UsersController@profile'; => http://yoursite.com/profile/a will be captured |
|
64 | - * but http://yoursite.com/profile/1457 will not captured. |
|
65 | - * |
|
66 | - * - $route['/profile/(:alnum)'] = 'UsersController@profile'; => http://yoursite.com/profile/4a, |
|
67 | - * http://yoursite.com/profile/7 will be captured but http://yoursite.com/profile/7-dangerous will not captured. |
|
68 | - * |
|
69 | - * - $route['/(:any)'] = 'ArticleController@read'; => http://yoursite.com/1-my-super-article, |
|
70 | - * http://yoursite.com/7, will be captured. |
|
71 | - * |
|
72 | - * Note 5: The order of definition of each route is important. |
|
73 | - * For example, the following definitions work: |
|
74 | - * |
|
75 | - * $route['/article/add'] = 'Article@add'; |
|
76 | - * $route['article/(:any)'] = 'Article@read'; |
|
77 | - * |
|
78 | - * however, the following definitions does not work as intended |
|
79 | - * |
|
80 | - * $route['article/(:any)'] = 'Article@read'; |
|
81 | - * $route['/article/add'] = 'Article@add'; |
|
82 | - * |
|
83 | - */ |
|
28 | + * This file contains the configuration of your routes that is to say that links to your URLs. |
|
29 | + * The index of the $route array contains the url address to capture and the value contains |
|
30 | + * the name of the module, controller and the method to call. |
|
31 | + * For example : |
|
32 | + * |
|
33 | + * $route['/users/login'] = 'moduleUsers#UsersController@login_action'; |
|
34 | + * |
|
35 | + * it means, if the user type in the address bar an URL like http://yoursite.com/users/login, |
|
36 | + * that will call the module "moduleUsers", the controller "UsersController" and the method "login_action". |
|
37 | + * Note 1: it is recommended that each index in the $route array start with a slash "/" |
|
38 | + * otherwise on some system this will not work. |
|
39 | + * Note 2: to define the default controller route (homepage) of your application you use only the index "/" |
|
40 | + * for example the following route represents the homepage: |
|
41 | + * |
|
42 | + * $route['/'] = 'Home'; //only the controller or module name |
|
43 | + * |
|
44 | + * $route['/'] = 'Home@index'; //only the controller or module name with the method |
|
45 | + * |
|
46 | + * $route['/'] = 'module#Home@index'; //with module name, controller and method |
|
47 | + * |
|
48 | + * Note 3: If the method is not specified then the "index" method will be used as |
|
49 | + * default method. For example in the case of our homepage, this will be able to make: |
|
50 | + * |
|
51 | + * $route['/'] = 'Home'; |
|
52 | + * |
|
53 | + * Note 4: All methods called must have "public" visibility if you know the principle of |
|
54 | + * Object Oriented Programming, you know what visibility means (public, protected, private). |
|
55 | + * |
|
56 | + * In the index of your route, you can use the markers (:num), (:alpha), (:alnum) and (:any) which correspond |
|
57 | + * respectively to the regular expression [0-9], [a-zA-Z], [a-zA-Z0-9] and. *. |
|
58 | + * For example : |
|
59 | + * |
|
60 | + * - $route['/profile/(:num)'] = 'UsersController@profile'; => http://yoursite.com/profile/4 will be captured but |
|
61 | + * http://yoursite.com/profile/a will not captured. |
|
62 | + * |
|
63 | + * - $route['/profile/(:alpha)'] = 'UsersController@profile'; => http://yoursite.com/profile/a will be captured |
|
64 | + * but http://yoursite.com/profile/1457 will not captured. |
|
65 | + * |
|
66 | + * - $route['/profile/(:alnum)'] = 'UsersController@profile'; => http://yoursite.com/profile/4a, |
|
67 | + * http://yoursite.com/profile/7 will be captured but http://yoursite.com/profile/7-dangerous will not captured. |
|
68 | + * |
|
69 | + * - $route['/(:any)'] = 'ArticleController@read'; => http://yoursite.com/1-my-super-article, |
|
70 | + * http://yoursite.com/7, will be captured. |
|
71 | + * |
|
72 | + * Note 5: The order of definition of each route is important. |
|
73 | + * For example, the following definitions work: |
|
74 | + * |
|
75 | + * $route['/article/add'] = 'Article@add'; |
|
76 | + * $route['article/(:any)'] = 'Article@read'; |
|
77 | + * |
|
78 | + * however, the following definitions does not work as intended |
|
79 | + * |
|
80 | + * $route['article/(:any)'] = 'Article@read'; |
|
81 | + * $route['/article/add'] = 'Article@add'; |
|
82 | + * |
|
83 | + */ |
|
84 | 84 | |
85 | 85 | /** |
86 | 86 | * The default route like your home page |
@@ -22,11 +22,11 @@ discard block |
||
22 | 22 | * You should have received a copy of the GNU General Public License |
23 | 23 | * along with this program; if not, write to the Free Software |
24 | 24 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
25 | - */ |
|
25 | + */ |
|
26 | 26 | |
27 | 27 | /** |
28 | - * This file contains the pagination library configuration of your application |
|
29 | - */ |
|
28 | + * This file contains the pagination library configuration of your application |
|
29 | + */ |
|
30 | 30 | |
31 | 31 | /** |
32 | 32 | * Number of pagination digit |
@@ -34,11 +34,11 @@ discard block |
||
34 | 34 | $config['nb_link'] = 10; |
35 | 35 | |
36 | 36 | /** |
37 | - * The pagination. |
|
38 | - * |
|
39 | - * Represents the number of data to display per page. |
|
40 | - * Note: this value must be strictly greater than zero (0) |
|
41 | - */ |
|
37 | + * The pagination. |
|
38 | + * |
|
39 | + * Represents the number of data to display per page. |
|
40 | + * Note: this value must be strictly greater than zero (0) |
|
41 | + */ |
|
42 | 42 | $config['pagination_per_page'] = 10; |
43 | 43 | |
44 | 44 |
@@ -22,13 +22,13 @@ discard block |
||
22 | 22 | * You should have received a copy of the GNU General Public License |
23 | 23 | * along with this program; if not, write to the Free Software |
24 | 24 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
25 | - */ |
|
25 | + */ |
|
26 | 26 | |
27 | 27 | /** |
28 | - * This file contains the main configuration of your application |
|
29 | - * web address, front controller, error logging, session parameters, CSRF, Cache, |
|
30 | - * Whitelist IP access, etc. |
|
31 | - */ |
|
28 | + * This file contains the main configuration of your application |
|
29 | + * web address, front controller, error logging, session parameters, CSRF, Cache, |
|
30 | + * Whitelist IP access, etc. |
|
31 | + */ |
|
32 | 32 | |
33 | 33 | /*+---------------------------------------------------------------+ |
34 | 34 | * Basic configuration section |
@@ -36,39 +36,39 @@ discard block |
||
36 | 36 | */ |
37 | 37 | |
38 | 38 | /** |
39 | - * The web address of your application. |
|
40 | - * |
|
41 | - * The address of your application or website terminated by a slash. |
|
42 | - * You can use a domain name or IP address, for example: |
|
43 | - * |
|
44 | - * $config['base_url'] = 'http://www.mysite.com'; |
|
45 | - * or |
|
46 | - * $config['base_url'] = 'http://198.15.25.12'; |
|
47 | - * |
|
48 | - * If this value is empty, we try to determine it automatically by using |
|
49 | - * the server variables "SERVER_ADDR" or "SCRIPT_NAME", |
|
50 | - * we recommend that you specify this value for a server in production this may reduce the performance of your application. |
|
51 | - */ |
|
39 | + * The web address of your application. |
|
40 | + * |
|
41 | + * The address of your application or website terminated by a slash. |
|
42 | + * You can use a domain name or IP address, for example: |
|
43 | + * |
|
44 | + * $config['base_url'] = 'http://www.mysite.com'; |
|
45 | + * or |
|
46 | + * $config['base_url'] = 'http://198.15.25.12'; |
|
47 | + * |
|
48 | + * If this value is empty, we try to determine it automatically by using |
|
49 | + * the server variables "SERVER_ADDR" or "SCRIPT_NAME", |
|
50 | + * we recommend that you specify this value for a server in production this may reduce the performance of your application. |
|
51 | + */ |
|
52 | 52 | $config['base_url'] = ''; |
53 | 53 | |
54 | 54 | /** |
55 | - * The front controller |
|
56 | - * |
|
57 | - * This represents the name of the file called by the application during the loading |
|
58 | - * process generally the file "index.php". |
|
59 | - * If your webserver supports the url rewrite module, then you can leave this value empty. |
|
60 | - * You will find a sample file to hide this file in the url inside the root folder of your |
|
61 | - * application "htaccess.txt" for the apache web server just rename it to ".htaccess" |
|
62 | - * |
|
63 | - * Without the rewrite module url enabled, leave this value to "index.php", in this case your urls look like: |
|
64 | - * |
|
65 | - * http://www.yoursite.com/index.php/controller/method |
|
66 | - * |
|
67 | - * otherwise if the module is available and activated you can put this value empty and your urls look like: |
|
68 | - * |
|
69 | - * http://www.yoursite.com/controller/method |
|
70 | - * |
|
71 | - */ |
|
55 | + * The front controller |
|
56 | + * |
|
57 | + * This represents the name of the file called by the application during the loading |
|
58 | + * process generally the file "index.php". |
|
59 | + * If your webserver supports the url rewrite module, then you can leave this value empty. |
|
60 | + * You will find a sample file to hide this file in the url inside the root folder of your |
|
61 | + * application "htaccess.txt" for the apache web server just rename it to ".htaccess" |
|
62 | + * |
|
63 | + * Without the rewrite module url enabled, leave this value to "index.php", in this case your urls look like: |
|
64 | + * |
|
65 | + * http://www.yoursite.com/index.php/controller/method |
|
66 | + * |
|
67 | + * otherwise if the module is available and activated you can put this value empty and your urls look like: |
|
68 | + * |
|
69 | + * http://www.yoursite.com/controller/method |
|
70 | + * |
|
71 | + */ |
|
72 | 72 | $config['front_controller'] = 'index.php'; |
73 | 73 | |
74 | 74 | /** |
@@ -82,22 +82,22 @@ discard block |
||
82 | 82 | $config['charset'] = 'UTF-8'; |
83 | 83 | |
84 | 84 | /** |
85 | - * Compress the output before send to browser |
|
86 | - * |
|
87 | - * Enables Gzip output compression for faster page loads. When enabled, |
|
88 | - * the Response class will test whether your server supports Gzip. |
|
89 | - * Even if it does, however, not all browsers support compression |
|
90 | - * so enable only if you are reasonably sure your visitors can handle it. |
|
91 | - * |
|
92 | - * This is only used if "zlib.output_compression" is turned off in your php configuration. |
|
93 | - * Please do not use it together with httpd-level output compression. |
|
94 | - * |
|
95 | - * IMPORTANT NOTE: If you are getting a blank page when compression is enabled it |
|
96 | - * means you are prematurely outputting something to your browser. It could |
|
97 | - * even be a line of whitespace at the end of one of your scripts. For |
|
98 | - * compression to work, nothing can be sent before the output buffer is called |
|
99 | - * by the Response class. Do not 'echo' any values with compression enabled. |
|
100 | - */ |
|
85 | + * Compress the output before send to browser |
|
86 | + * |
|
87 | + * Enables Gzip output compression for faster page loads. When enabled, |
|
88 | + * the Response class will test whether your server supports Gzip. |
|
89 | + * Even if it does, however, not all browsers support compression |
|
90 | + * so enable only if you are reasonably sure your visitors can handle it. |
|
91 | + * |
|
92 | + * This is only used if "zlib.output_compression" is turned off in your php configuration. |
|
93 | + * Please do not use it together with httpd-level output compression. |
|
94 | + * |
|
95 | + * IMPORTANT NOTE: If you are getting a blank page when compression is enabled it |
|
96 | + * means you are prematurely outputting something to your browser. It could |
|
97 | + * even be a line of whitespace at the end of one of your scripts. For |
|
98 | + * compression to work, nothing can be sent before the output buffer is called |
|
99 | + * by the Response class. Do not 'echo' any values with compression enabled. |
|
100 | + */ |
|
101 | 101 | $config['compress_output'] = false; |
102 | 102 | |
103 | 103 | /*+---------------------------------------------------------------+ |
@@ -130,51 +130,51 @@ discard block |
||
130 | 130 | */ |
131 | 131 | |
132 | 132 | /** |
133 | - * The log level |
|
134 | - * |
|
135 | - * The valid level are: OFF, NONE, FATAL, ERROR, WARNING, WARN, INFO, DEBUG, ALL |
|
136 | - * |
|
137 | - * 'OFF' or 'NONE' = do not save log |
|
138 | - * 'FATAL' = enable log for fatal level and above (FATAL) |
|
139 | - * 'ERROR' = enable log for error level and above (ERROR, FATAL) |
|
140 | - * 'WARNING' or WARN = enable log for warning level and above (WARNING, ERROR, FATAL) |
|
141 | - * 'INFO' = enable log for info level and above (INFO, WARNING, ERROR, FATAL) |
|
142 | - * 'DEBUG' = enable log for debug level and above (DEBUG, INFO, WARNING, ERROR, FATAL) |
|
143 | - * 'ALL' = enable log for all level |
|
144 | - * |
|
145 | - * The default value is NONE if the config value is: null, '', 0, false |
|
146 | - * |
|
147 | - * Note: in production environment it's recommand to set the log level to 'WARNING' if not in small |
|
148 | - * of time the log file size will increase very fast and will cost the application performance |
|
149 | - * and also the filesystem usage of your server. |
|
150 | - */ |
|
133 | + * The log level |
|
134 | + * |
|
135 | + * The valid level are: OFF, NONE, FATAL, ERROR, WARNING, WARN, INFO, DEBUG, ALL |
|
136 | + * |
|
137 | + * 'OFF' or 'NONE' = do not save log |
|
138 | + * 'FATAL' = enable log for fatal level and above (FATAL) |
|
139 | + * 'ERROR' = enable log for error level and above (ERROR, FATAL) |
|
140 | + * 'WARNING' or WARN = enable log for warning level and above (WARNING, ERROR, FATAL) |
|
141 | + * 'INFO' = enable log for info level and above (INFO, WARNING, ERROR, FATAL) |
|
142 | + * 'DEBUG' = enable log for debug level and above (DEBUG, INFO, WARNING, ERROR, FATAL) |
|
143 | + * 'ALL' = enable log for all level |
|
144 | + * |
|
145 | + * The default value is NONE if the config value is: null, '', 0, false |
|
146 | + * |
|
147 | + * Note: in production environment it's recommand to set the log level to 'WARNING' if not in small |
|
148 | + * of time the log file size will increase very fast and will cost the application performance |
|
149 | + * and also the filesystem usage of your server. |
|
150 | + */ |
|
151 | 151 | $config['log_level'] = 'NONE'; |
152 | 152 | |
153 | 153 | |
154 | 154 | /** |
155 | - * The path to log directory |
|
156 | - * |
|
157 | - * The path that the log data will be saved ending with de "/" or "\", leave empty if you |
|
158 | - * want use the default configuration |
|
159 | - * warning : if set, this directory must exist and will be writable and owned by the web server |
|
160 | - * else the default value will be used i.e the constant LOG_PATH |
|
161 | - * for security raison this directory must be outside of the document root of your |
|
162 | - * website. |
|
163 | - */ |
|
155 | + * The path to log directory |
|
156 | + * |
|
157 | + * The path that the log data will be saved ending with de "/" or "\", leave empty if you |
|
158 | + * want use the default configuration |
|
159 | + * warning : if set, this directory must exist and will be writable and owned by the web server |
|
160 | + * else the default value will be used i.e the constant LOG_PATH |
|
161 | + * for security raison this directory must be outside of the document root of your |
|
162 | + * website. |
|
163 | + */ |
|
164 | 164 | $config['log_save_path'] = ''; |
165 | 165 | |
166 | 166 | /** |
167 | - * The logger name to use for the log |
|
168 | - * |
|
169 | - * You can use an string or array of logger. If this config is set so means only log message with this or these logger(s) will be accepted |
|
170 | - * |
|
171 | - * Example: |
|
172 | - * //using string for only one logger name |
|
173 | - * $config['log_logger_name'] = 'MY_LOGGER'; //only log message with MY_LOGGER will be saved in file. |
|
174 | - * |
|
175 | - * //using array for muliple logger names |
|
176 | - * $config['log_logger_name'] = array('MY_LOGGER1', 'MY_LOGGER2'); //only log message with MY_LOGGER1 or MY_LOGGER2 will be saved in file. |
|
177 | - */ |
|
167 | + * The logger name to use for the log |
|
168 | + * |
|
169 | + * You can use an string or array of logger. If this config is set so means only log message with this or these logger(s) will be accepted |
|
170 | + * |
|
171 | + * Example: |
|
172 | + * //using string for only one logger name |
|
173 | + * $config['log_logger_name'] = 'MY_LOGGER'; //only log message with MY_LOGGER will be saved in file. |
|
174 | + * |
|
175 | + * //using array for muliple logger names |
|
176 | + * $config['log_logger_name'] = array('MY_LOGGER1', 'MY_LOGGER2'); //only log message with MY_LOGGER1 or MY_LOGGER2 will be saved in file. |
|
177 | + */ |
|
178 | 178 | $config['log_logger_name'] = ''; |
179 | 179 | |
180 | 180 | |
@@ -184,41 +184,41 @@ discard block |
||
184 | 184 | */ |
185 | 185 | |
186 | 186 | /** |
187 | - * The session name |
|
188 | - * |
|
189 | - * By default is PHPSESSID. this must be alpha-numerical characters |
|
190 | - */ |
|
187 | + * The session name |
|
188 | + * |
|
189 | + * By default is PHPSESSID. this must be alpha-numerical characters |
|
190 | + */ |
|
191 | 191 | $config['session_name'] = 'PHPSESSID'; |
192 | 192 | |
193 | 193 | /** |
194 | - * Session save path |
|
195 | - * |
|
196 | - * The path that the session data will be saved, leave empty if you |
|
197 | - * want use the default configuration in the php.ini |
|
198 | - * warning : if set, this directory must exist and will be writable and owned by the web server |
|
199 | - * for security raison this directory must be outside of the document root of your |
|
200 | - * website. |
|
201 | - * Note: if the session handler is "database" the session_save_path is the model name to use |
|
202 | - */ |
|
194 | + * Session save path |
|
195 | + * |
|
196 | + * The path that the session data will be saved, leave empty if you |
|
197 | + * want use the default configuration in the php.ini |
|
198 | + * warning : if set, this directory must exist and will be writable and owned by the web server |
|
199 | + * for security raison this directory must be outside of the document root of your |
|
200 | + * website. |
|
201 | + * Note: if the session handler is "database" the session_save_path is the model name to use |
|
202 | + */ |
|
203 | 203 | $config['session_save_path'] = ''; |
204 | 204 | |
205 | 205 | /** |
206 | - * Session handler |
|
207 | - * |
|
208 | - * The session handler that we will use to manage the session. |
|
209 | - * currently the possible values are "files", "database". |
|
210 | - */ |
|
206 | + * Session handler |
|
207 | + * |
|
208 | + * The session handler that we will use to manage the session. |
|
209 | + * currently the possible values are "files", "database". |
|
210 | + */ |
|
211 | 211 | $config['session_handler'] = 'files'; |
212 | 212 | |
213 | 213 | /** |
214 | - * Session secret |
|
215 | - * |
|
216 | - * This is used to hash the session data if the config "session_handler" is set to "database" |
|
217 | - * warning : do not change this value until you already set |
|
218 | - * for security raison use the very complicated value include $%)@^&^\''\'\' |
|
219 | - * NOTE: this value is an base64 so you need use the tool that generate it, like |
|
220 | - * PHP function base64_encode() |
|
221 | - */ |
|
214 | + * Session secret |
|
215 | + * |
|
216 | + * This is used to hash the session data if the config "session_handler" is set to "database" |
|
217 | + * warning : do not change this value until you already set |
|
218 | + * for security raison use the very complicated value include $%)@^&^\''\'\' |
|
219 | + * NOTE: this value is an base64 so you need use the tool that generate it, like |
|
220 | + * PHP function base64_encode() |
|
221 | + */ |
|
222 | 222 | $config['session_secret'] = ''; |
223 | 223 | |
224 | 224 | /** |
@@ -227,36 +227,36 @@ discard block |
||
227 | 227 | $config['session_inactivity_time'] = 600; //in second |
228 | 228 | |
229 | 229 | /** |
230 | - * Session cookie lifetime |
|
231 | - * |
|
232 | - * The cookie lifetime that the session will be dropped in seconds, leave 0 if you want |
|
233 | - * the cookie expire after the browser is closed |
|
234 | - */ |
|
230 | + * Session cookie lifetime |
|
231 | + * |
|
232 | + * The cookie lifetime that the session will be dropped in seconds, leave 0 if you want |
|
233 | + * the cookie expire after the browser is closed |
|
234 | + */ |
|
235 | 235 | $config['session_cookie_lifetime'] = 0; |
236 | 236 | |
237 | 237 | /** |
238 | - * Session cookie path |
|
239 | - * |
|
240 | - * The path to your website that the cookie is available "/" means all path is available |
|
241 | - * example : /mysubdirectory => available in http://www.mysite.com/mysubdirectory |
|
242 | - */ |
|
238 | + * Session cookie path |
|
239 | + * |
|
240 | + * The path to your website that the cookie is available "/" means all path is available |
|
241 | + * example : /mysubdirectory => available in http://www.mysite.com/mysubdirectory |
|
242 | + */ |
|
243 | 243 | $config['session_cookie_path'] = '/'; |
244 | 244 | |
245 | 245 | /** |
246 | - * Session cookie domain |
|
247 | - * |
|
248 | - * The domain of your website that the cookie is available if you want the cookie is available |
|
249 | - * in all your subdomain use this dot before the domain name for example ".mysite.com". |
|
250 | - * leave empty if you want use the default configuration |
|
251 | - */ |
|
246 | + * Session cookie domain |
|
247 | + * |
|
248 | + * The domain of your website that the cookie is available if you want the cookie is available |
|
249 | + * in all your subdomain use this dot before the domain name for example ".mysite.com". |
|
250 | + * leave empty if you want use the default configuration |
|
251 | + */ |
|
252 | 252 | $config['session_cookie_domain'] = ''; |
253 | 253 | |
254 | 254 | /** |
255 | - * Session cookie secure |
|
256 | - * |
|
257 | - * If your website use SSL i.e https, you set "true" for this configuration, so the cookie |
|
258 | - * is available only if the website use the secure connection else set this value to "false" |
|
259 | - */ |
|
255 | + * Session cookie secure |
|
256 | + * |
|
257 | + * If your website use SSL i.e https, you set "true" for this configuration, so the cookie |
|
258 | + * is available only if the website use the secure connection else set this value to "false" |
|
259 | + */ |
|
260 | 260 | $config['session_cookie_secure'] = false; |
261 | 261 | |
262 | 262 | |
@@ -307,12 +307,12 @@ discard block |
||
307 | 307 | $config['cache_ttl'] = 120; //in second |
308 | 308 | |
309 | 309 | /** |
310 | - * Cache handler class |
|
311 | - * |
|
312 | - * The cache handler class inside (CORE_CLASSES_CACHE_PATH, LIBRARY_PATH) directories that implements |
|
313 | - * the interface "CacheInterface" that we will use to manage the cache. |
|
314 | - * currently the possible values are "FileCache", "ApcCache". |
|
315 | - */ |
|
310 | + * Cache handler class |
|
311 | + * |
|
312 | + * The cache handler class inside (CORE_CLASSES_CACHE_PATH, LIBRARY_PATH) directories that implements |
|
313 | + * the interface "CacheInterface" that we will use to manage the cache. |
|
314 | + * currently the possible values are "FileCache", "ApcCache". |
|
315 | + */ |
|
316 | 316 | $config['cache_handler'] = 'FileCache'; |
317 | 317 | |
318 | 318 |
@@ -22,29 +22,29 @@ discard block |
||
22 | 22 | * You should have received a copy of the GNU General Public License |
23 | 23 | * along with this program; if not, write to the Free Software |
24 | 24 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
25 | - */ |
|
25 | + */ |
|
26 | 26 | |
27 | 27 | /** |
28 | - * This file contains the connection information to your database, this file is read when you load the "Database" library. |
|
29 | - * You will find all its configuration parameters at your web hosting. |
|
30 | - */ |
|
28 | + * This file contains the connection information to your database, this file is read when you load the "Database" library. |
|
29 | + * You will find all its configuration parameters at your web hosting. |
|
30 | + */ |
|
31 | 31 | |
32 | 32 | /** |
33 | - * The type or driver of your database. |
|
34 | - * |
|
35 | - * Note: the "Database" library uses the PHP PDO extension to interact with your database, |
|
36 | - * so most of the PDO supported drivers namely: mysql, pgsql, sqlite, oracle are accepted. |
|
37 | - * For example : |
|
38 | - * |
|
39 | - * $db['driver'] = 'mysql'; // for MySQL Database |
|
40 | - * or |
|
41 | - * $db['driver'] = 'pgsql'; // for PostgreSQL Database |
|
42 | - * or |
|
43 | - * $db['driver'] = 'sqlite'; // for SQLite Database |
|
44 | - * or |
|
45 | - * $db['driver'] = 'oracle'; // for Oracle Database |
|
46 | - * |
|
47 | - */ |
|
33 | + * The type or driver of your database. |
|
34 | + * |
|
35 | + * Note: the "Database" library uses the PHP PDO extension to interact with your database, |
|
36 | + * so most of the PDO supported drivers namely: mysql, pgsql, sqlite, oracle are accepted. |
|
37 | + * For example : |
|
38 | + * |
|
39 | + * $db['driver'] = 'mysql'; // for MySQL Database |
|
40 | + * or |
|
41 | + * $db['driver'] = 'pgsql'; // for PostgreSQL Database |
|
42 | + * or |
|
43 | + * $db['driver'] = 'sqlite'; // for SQLite Database |
|
44 | + * or |
|
45 | + * $db['driver'] = 'oracle'; // for Oracle Database |
|
46 | + * |
|
47 | + */ |
|
48 | 48 | $db['driver'] = 'mysql'; |
49 | 49 | |
50 | 50 | /** |
@@ -62,66 +62,66 @@ discard block |
||
62 | 62 | $db['hostname'] = 'localhost'; |
63 | 63 | |
64 | 64 | /** |
65 | - * The username of your database server |
|
66 | - * for example : |
|
67 | - * |
|
68 | - * $db['username'] = 'root'; |
|
69 | - * or |
|
70 | - * $db['username'] = 'myusername'; |
|
71 | - */ |
|
65 | + * The username of your database server |
|
66 | + * for example : |
|
67 | + * |
|
68 | + * $db['username'] = 'root'; |
|
69 | + * or |
|
70 | + * $db['username'] = 'myusername'; |
|
71 | + */ |
|
72 | 72 | $db['username'] = 'root'; |
73 | 73 | |
74 | 74 | |
75 | 75 | /** |
76 | - * The password of your database server. |
|
77 | - * |
|
78 | - * Note: Some configuration settings on some database management systems do not allow |
|
79 | - * connection with a user without password, so it is recommended to set a password for this user for a security measure. |
|
80 | - * for example : |
|
81 | - * |
|
82 | - * $db['password'] = ''; //for an empty password, this is the case most often, if you are in local, ie for the user "root". |
|
83 | - * or |
|
84 | - * $db['password'] = 'M@5CUR3P@$$W0rd'; |
|
85 | - */ |
|
76 | + * The password of your database server. |
|
77 | + * |
|
78 | + * Note: Some configuration settings on some database management systems do not allow |
|
79 | + * connection with a user without password, so it is recommended to set a password for this user for a security measure. |
|
80 | + * for example : |
|
81 | + * |
|
82 | + * $db['password'] = ''; //for an empty password, this is the case most often, if you are in local, ie for the user "root". |
|
83 | + * or |
|
84 | + * $db['password'] = 'M@5CUR3P@$$W0rd'; |
|
85 | + */ |
|
86 | 86 | $db['password'] = ''; |
87 | 87 | |
88 | 88 | /** |
89 | - * The name of your database |
|
90 | - * |
|
91 | - * for example : |
|
92 | - * |
|
93 | - * $db['database'] = 'database_name'; |
|
94 | - */ |
|
89 | + * The name of your database |
|
90 | + * |
|
91 | + * for example : |
|
92 | + * |
|
93 | + * $db['database'] = 'database_name'; |
|
94 | + */ |
|
95 | 95 | $db['database'] = ''; |
96 | 96 | |
97 | 97 | |
98 | 98 | /** |
99 | - * The character set that will be used by the database server. |
|
100 | - * for example : |
|
101 | - * |
|
102 | - * $db['charset'] = 'utf8'; |
|
103 | - */ |
|
99 | + * The character set that will be used by the database server. |
|
100 | + * for example : |
|
101 | + * |
|
102 | + * $db['charset'] = 'utf8'; |
|
103 | + */ |
|
104 | 104 | $db['charset'] = 'utf8'; |
105 | 105 | |
106 | 106 | /** |
107 | - * In addition to the character set, a certain database management system allows you to |
|
108 | - * choose how the data will be classified (ORDER BY) by what is called a "COLLATE". |
|
109 | - * This makes it possible, for example, to answer the classic problem of case sensitivity. |
|
110 | - * for example : |
|
111 | - * $db['collation'] = 'utf8_general_ci'; |
|
112 | - */ |
|
107 | + * In addition to the character set, a certain database management system allows you to |
|
108 | + * choose how the data will be classified (ORDER BY) by what is called a "COLLATE". |
|
109 | + * This makes it possible, for example, to answer the classic problem of case sensitivity. |
|
110 | + * for example : |
|
111 | + * $db['collation'] = 'utf8_general_ci'; |
|
112 | + */ |
|
113 | 113 | $db['collation'] = 'utf8_general_ci'; |
114 | 114 | |
115 | 115 | |
116 | 116 | /** |
117 | - * If your tables in your database contain prefixes, this is the case most on some application, |
|
118 | - * to avoid the conflict of name of the tables between different database, |
|
119 | - * it is possible to define prefixes for the tables. |
|
120 | - * for example : |
|
121 | - * |
|
122 | - * $db['prefix'] = 'pf_'; |
|
123 | - * or |
|
124 | - * |
|
125 | - * $db['prefix'] = 'my_db_'; |
|
126 | - */ |
|
117 | + * If your tables in your database contain prefixes, this is the case most on some application, |
|
118 | + * to avoid the conflict of name of the tables between different database, |
|
119 | + * it is possible to define prefixes for the tables. |
|
120 | + * for example : |
|
121 | + * |
|
122 | + * $db['prefix'] = 'pf_'; |
|
123 | + * or |
|
124 | + * |
|
125 | + * $db['prefix'] = 'my_db_'; |
|
126 | + */ |
|
127 | 127 | $db['prefix'] = ''; |
128 | 128 | \ No newline at end of file |
@@ -22,73 +22,73 @@ |
||
22 | 22 | * You should have received a copy of the GNU General Public License |
23 | 23 | * along with this program; if not, write to the Free Software |
24 | 24 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
25 | - */ |
|
25 | + */ |
|
26 | 26 | |
27 | 27 | /** |
28 | - * This file contains the configuration of resources that you want to load automatically: |
|
29 | - * personal or system libraries, configuration files, models, |
|
30 | - * personal functions or systems that are used most often in your application |
|
31 | - * instead of loading them every time you want to use it. |
|
32 | - * Note: loading a lot of resources can decrease the performance of your application. |
|
33 | - */ |
|
28 | + * This file contains the configuration of resources that you want to load automatically: |
|
29 | + * personal or system libraries, configuration files, models, |
|
30 | + * personal functions or systems that are used most often in your application |
|
31 | + * instead of loading them every time you want to use it. |
|
32 | + * Note: loading a lot of resources can decrease the performance of your application. |
|
33 | + */ |
|
34 | 34 | |
35 | 35 | |
36 | 36 | /** |
37 | - * If you have personal libraries or systems to load automatically, then list them in the following array. |
|
38 | - * For example : |
|
39 | - * |
|
40 | - * $autoload['libraries'] = array('library1', 'library1'); |
|
41 | - * |
|
42 | - * Note: Personal libraries have priority over system libraries, |
|
43 | - * ie the loading order is as follows: it looks in the folder of the personal libraries, |
|
44 | - * if it is found, it is loaded, if not , we search in the system libraries folder, |
|
45 | - * before returning an error in case it does not find it. |
|
46 | - */ |
|
37 | + * If you have personal libraries or systems to load automatically, then list them in the following array. |
|
38 | + * For example : |
|
39 | + * |
|
40 | + * $autoload['libraries'] = array('library1', 'library1'); |
|
41 | + * |
|
42 | + * Note: Personal libraries have priority over system libraries, |
|
43 | + * ie the loading order is as follows: it looks in the folder of the personal libraries, |
|
44 | + * if it is found, it is loaded, if not , we search in the system libraries folder, |
|
45 | + * before returning an error in case it does not find it. |
|
46 | + */ |
|
47 | 47 | $autoload['libraries'] = array(); |
48 | 48 | |
49 | 49 | /** |
50 | - * If you have configuration files to load automatically, then list them in the following array. |
|
51 | - * For example : |
|
52 | - * |
|
53 | - * $autoload['config'] = array('config1', 'config2'); |
|
54 | - * |
|
55 | - * Note 1: the file name must have as prefix "config_" |
|
56 | - * for example "config_name_of_the_file_config.php" and contains as configuration variable the array $config, |
|
57 | - * otherwise the system can not find this configuration file. |
|
58 | - * For example : |
|
59 | - * |
|
60 | - * $config['key1'] = value1; |
|
61 | - * $config['key2'] = value2; |
|
62 | - * |
|
63 | - * Note 2: the files to be loaded must be in the folder defined by the constant "CONFIG_PATH" in "index.php". |
|
64 | - */ |
|
50 | + * If you have configuration files to load automatically, then list them in the following array. |
|
51 | + * For example : |
|
52 | + * |
|
53 | + * $autoload['config'] = array('config1', 'config2'); |
|
54 | + * |
|
55 | + * Note 1: the file name must have as prefix "config_" |
|
56 | + * for example "config_name_of_the_file_config.php" and contains as configuration variable the array $config, |
|
57 | + * otherwise the system can not find this configuration file. |
|
58 | + * For example : |
|
59 | + * |
|
60 | + * $config['key1'] = value1; |
|
61 | + * $config['key2'] = value2; |
|
62 | + * |
|
63 | + * Note 2: the files to be loaded must be in the folder defined by the constant "CONFIG_PATH" in "index.php". |
|
64 | + */ |
|
65 | 65 | $autoload['config'] = array(); |
66 | 66 | |
67 | 67 | /** |
68 | - * If you have models to load automatically, then list them in the following table. |
|
69 | - * For example : |
|
70 | - * |
|
71 | - * $autoload['models'] = array('model1', 'model2'); |
|
72 | - */ |
|
68 | + * If you have models to load automatically, then list them in the following table. |
|
69 | + * For example : |
|
70 | + * |
|
71 | + * $autoload['models'] = array('model1', 'model2'); |
|
72 | + */ |
|
73 | 73 | $autoload['models'] = array(); |
74 | 74 | |
75 | 75 | /** |
76 | - * If you have system or personal functions to load automatically, specify them in the following array. |
|
77 | - * For example : |
|
78 | - * |
|
79 | - * $autoload['functions'] = array('function1', 'function2'); |
|
80 | - * |
|
81 | - * Note: Personal functions have priority over system functions, |
|
82 | - * that is to say that the order of loading is the following : it looks in the directory of the personal functions, |
|
83 | - * if it is found, it is loaded, otherwise, it looks in the directory of the system functions, |
|
84 | - * before returning an error in case he does not find it. |
|
85 | - */ |
|
76 | + * If you have system or personal functions to load automatically, specify them in the following array. |
|
77 | + * For example : |
|
78 | + * |
|
79 | + * $autoload['functions'] = array('function1', 'function2'); |
|
80 | + * |
|
81 | + * Note: Personal functions have priority over system functions, |
|
82 | + * that is to say that the order of loading is the following : it looks in the directory of the personal functions, |
|
83 | + * if it is found, it is loaded, otherwise, it looks in the directory of the system functions, |
|
84 | + * before returning an error in case he does not find it. |
|
85 | + */ |
|
86 | 86 | $autoload['functions'] = array(); |
87 | 87 | |
88 | 88 | /** |
89 | - * If you have system or personal language to load automatically, specify them in the following array. |
|
90 | - * For example : |
|
91 | - * |
|
92 | - * $autoload['languages'] = array('lang1', 'lang2'); |
|
93 | - */ |
|
89 | + * If you have system or personal language to load automatically, specify them in the following array. |
|
90 | + * For example : |
|
91 | + * |
|
92 | + * $autoload['languages'] = array('lang1', 'lang2'); |
|
93 | + */ |
|
94 | 94 | $autoload['languages'] = array(); |
@@ -21,194 +21,194 @@ discard block |
||
21 | 21 | * You should have received a copy of the GNU General Public License |
22 | 22 | * along with this program; if not, write to the Free Software |
23 | 23 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
24 | - */ |
|
24 | + */ |
|
25 | 25 | |
26 | 26 | /** |
27 | - * the directory separator, under windows it is \ and unix, linux / |
|
28 | - */ |
|
27 | + * the directory separator, under windows it is \ and unix, linux / |
|
28 | + */ |
|
29 | 29 | define('DS', DIRECTORY_SEPARATOR); |
30 | 30 | |
31 | 31 | /** |
32 | - * The root directory of the application. |
|
33 | - * |
|
34 | - * you can place this directory outside of your web directory, for example "/home/your_app", etc. |
|
35 | - */ |
|
32 | + * The root directory of the application. |
|
33 | + * |
|
34 | + * you can place this directory outside of your web directory, for example "/home/your_app", etc. |
|
35 | + */ |
|
36 | 36 | define('ROOT_PATH', dirname(realpath(__FILE__)) . DS); |
37 | 37 | |
38 | 38 | /** |
39 | - * The path to the directory. |
|
40 | - * |
|
41 | - * That contains your static files (javascript, css, images, etc.) |
|
42 | - * Note: the path must be relative to the file index.php (the front-end controller). |
|
43 | - */ |
|
39 | + * The path to the directory. |
|
40 | + * |
|
41 | + * That contains your static files (javascript, css, images, etc.) |
|
42 | + * Note: the path must be relative to the file index.php (the front-end controller). |
|
43 | + */ |
|
44 | 44 | define('ASSETS_PATH', 'assets/'); |
45 | 45 | |
46 | 46 | /** |
47 | - * The path to the directory of your cache files. |
|
48 | - * |
|
49 | - * This feature is available currently for database and views. |
|
50 | - */ |
|
47 | + * The path to the directory of your cache files. |
|
48 | + * |
|
49 | + * This feature is available currently for database and views. |
|
50 | + */ |
|
51 | 51 | define('CACHE_PATH', ROOT_PATH . 'cache' . DS); |
52 | 52 | |
53 | 53 | /** |
54 | - * The path to the application directory. |
|
55 | - * |
|
56 | - * It contains your most often used files that is to say which contains your files of the application, |
|
57 | - * in MVC architecture (controllers, models, views). |
|
58 | - */ |
|
54 | + * The path to the application directory. |
|
55 | + * |
|
56 | + * It contains your most often used files that is to say which contains your files of the application, |
|
57 | + * in MVC architecture (controllers, models, views). |
|
58 | + */ |
|
59 | 59 | define('APPS_PATH', ROOT_PATH . 'classes' . DS); |
60 | 60 | |
61 | 61 | /** |
62 | - * The path to the controller directory of your application. |
|
63 | - * |
|
64 | - * If you already know the MVC architecture you know what a controller means; |
|
65 | - * it is he who makes the business logic of your application in general. |
|
66 | - */ |
|
62 | + * The path to the controller directory of your application. |
|
63 | + * |
|
64 | + * If you already know the MVC architecture you know what a controller means; |
|
65 | + * it is he who makes the business logic of your application in general. |
|
66 | + */ |
|
67 | 67 | define('APPS_CONTROLLER_PATH', APPS_PATH . 'controllers' . DS); |
68 | 68 | |
69 | 69 | /** |
70 | - * The path to the directory of your model classes of your application. |
|
71 | - * |
|
72 | - * If you already know the MVC architecture you know what a model means; |
|
73 | - * it's the one who interacts with the database, in one word persistent data from your application. |
|
74 | - */ |
|
70 | + * The path to the directory of your model classes of your application. |
|
71 | + * |
|
72 | + * If you already know the MVC architecture you know what a model means; |
|
73 | + * it's the one who interacts with the database, in one word persistent data from your application. |
|
74 | + */ |
|
75 | 75 | define('APPS_MODEL_PATH', APPS_PATH . 'models' . DS); |
76 | 76 | |
77 | 77 | /** |
78 | - * The path to the directory of your views. |
|
79 | - * |
|
80 | - * If you already know the MVC architecture you know what a view means, |
|
81 | - * a view is just a user interface (html page, form, etc.) that is to say |
|
82 | - * everything displayed in the browser interface, etc. |
|
83 | - */ |
|
78 | + * The path to the directory of your views. |
|
79 | + * |
|
80 | + * If you already know the MVC architecture you know what a view means, |
|
81 | + * a view is just a user interface (html page, form, etc.) that is to say |
|
82 | + * everything displayed in the browser interface, etc. |
|
83 | + */ |
|
84 | 84 | define('APPS_VIEWS_PATH', APPS_PATH . 'views' . DS); |
85 | 85 | |
86 | 86 | /** |
87 | - * The path to the configuration directory. |
|
88 | - * |
|
89 | - * That contains most of the configuration files for your |
|
90 | - * application (database, class loading file, functions, etc.) |
|
91 | - */ |
|
87 | + * The path to the configuration directory. |
|
88 | + * |
|
89 | + * That contains most of the configuration files for your |
|
90 | + * application (database, class loading file, functions, etc.) |
|
91 | + */ |
|
92 | 92 | define('CONFIG_PATH', ROOT_PATH . 'config' . DS); |
93 | 93 | |
94 | 94 | /** |
95 | - * The core directory |
|
96 | - * |
|
97 | - * It is recommended to put this folder out of the web directory of your server and |
|
98 | - * you should not change its content because in case of update you could lose the modified files. |
|
99 | - */ |
|
95 | + * The core directory |
|
96 | + * |
|
97 | + * It is recommended to put this folder out of the web directory of your server and |
|
98 | + * you should not change its content because in case of update you could lose the modified files. |
|
99 | + */ |
|
100 | 100 | define('CORE_PATH', ROOT_PATH . 'core' . DS); |
101 | 101 | |
102 | 102 | /** |
103 | - * The path to the directory of core classes that used by the system. |
|
104 | - * |
|
105 | - * It contains PHP classes that are used by the framework internally. |
|
106 | - */ |
|
103 | + * The path to the directory of core classes that used by the system. |
|
104 | + * |
|
105 | + * It contains PHP classes that are used by the framework internally. |
|
106 | + */ |
|
107 | 107 | define('CORE_CLASSES_PATH', CORE_PATH . 'classes' . DS); |
108 | 108 | |
109 | 109 | /** |
110 | - * The path to the directory of core classes for the cache used by the system. |
|
111 | - * |
|
112 | - * It contains PHP classes for the cache drivers. |
|
113 | - */ |
|
110 | + * The path to the directory of core classes for the cache used by the system. |
|
111 | + * |
|
112 | + * It contains PHP classes for the cache drivers. |
|
113 | + */ |
|
114 | 114 | define('CORE_CLASSES_CACHE_PATH', CORE_CLASSES_PATH . 'cache' . DS); |
115 | 115 | |
116 | 116 | /** |
117 | - * The path to the directory of core classes for the model used by the system. |
|
118 | - * |
|
119 | - * It contains PHP classes for the models. |
|
120 | - */ |
|
117 | + * The path to the directory of core classes for the model used by the system. |
|
118 | + * |
|
119 | + * It contains PHP classes for the models. |
|
120 | + */ |
|
121 | 121 | define('CORE_CLASSES_MODEL_PATH', CORE_CLASSES_PATH . 'model' . DS); |
122 | 122 | |
123 | 123 | /** |
124 | - * The path to the directory of functions or helper systems. |
|
125 | - * |
|
126 | - * It contains PHP functions that perform a particular task: character string processing, URL, etc. |
|
127 | - */ |
|
124 | + * The path to the directory of functions or helper systems. |
|
125 | + * |
|
126 | + * It contains PHP functions that perform a particular task: character string processing, URL, etc. |
|
127 | + */ |
|
128 | 128 | define('CORE_FUNCTIONS_PATH', CORE_PATH . 'functions' . DS); |
129 | 129 | |
130 | 130 | /** |
131 | - * The path to the core directory of languages files. |
|
132 | - * |
|
133 | - */ |
|
131 | + * The path to the core directory of languages files. |
|
132 | + * |
|
133 | + */ |
|
134 | 134 | define('CORE_LANG_PATH', CORE_PATH . 'lang' . DS); |
135 | 135 | |
136 | 136 | /** |
137 | - * The path to the system library directory. |
|
138 | - * |
|
139 | - * Which contains the libraries most often used in your web application, as for the |
|
140 | - * core directory it is advisable to put it out of the root directory of your application. |
|
141 | - */ |
|
137 | + * The path to the system library directory. |
|
138 | + * |
|
139 | + * Which contains the libraries most often used in your web application, as for the |
|
140 | + * core directory it is advisable to put it out of the root directory of your application. |
|
141 | + */ |
|
142 | 142 | define('CORE_LIBRARY_PATH', CORE_PATH . 'libraries' . DS); |
143 | 143 | |
144 | 144 | /** |
145 | - * The path to the system view directory. |
|
146 | - * |
|
147 | - * That contains the views used for the system, such as error messages, and so on. |
|
148 | - */ |
|
145 | + * The path to the system view directory. |
|
146 | + * |
|
147 | + * That contains the views used for the system, such as error messages, and so on. |
|
148 | + */ |
|
149 | 149 | define('CORE_VIEWS_PATH', CORE_PATH . 'views' . DS); |
150 | 150 | |
151 | 151 | /** |
152 | - * The path to the directory of your PHP personal functions or helper. |
|
153 | - * |
|
154 | - * It contains your PHP functions that perform a particular task: utilities, etc. |
|
155 | - * Note: Do not put your personal functions or helpers in the system functions directory, |
|
156 | - * because if you update the system you may lose them. |
|
157 | - */ |
|
152 | + * The path to the directory of your PHP personal functions or helper. |
|
153 | + * |
|
154 | + * It contains your PHP functions that perform a particular task: utilities, etc. |
|
155 | + * Note: Do not put your personal functions or helpers in the system functions directory, |
|
156 | + * because if you update the system you may lose them. |
|
157 | + */ |
|
158 | 158 | define('FUNCTIONS_PATH', ROOT_PATH . 'functions' . DS); |
159 | 159 | |
160 | 160 | /** |
161 | - * The path to the app directory of personal language. |
|
162 | - * |
|
163 | - * This feature is not yet available. |
|
164 | - * You can help us do this if you are nice or wish to see the developed framework. |
|
165 | - */ |
|
161 | + * The path to the app directory of personal language. |
|
162 | + * |
|
163 | + * This feature is not yet available. |
|
164 | + * You can help us do this if you are nice or wish to see the developed framework. |
|
165 | + */ |
|
166 | 166 | define('APP_LANG_PATH', ROOT_PATH . 'lang' . DS); |
167 | 167 | |
168 | 168 | /** |
169 | - * The path to the directory of your personal libraries |
|
170 | - * |
|
171 | - * It contains your PHP classes, package, etc. |
|
172 | - * Note: you should not put your personal libraries in the system library directory, |
|
173 | - * because it is recalled in case of updating the system you might have surprises. |
|
174 | - */ |
|
169 | + * The path to the directory of your personal libraries |
|
170 | + * |
|
171 | + * It contains your PHP classes, package, etc. |
|
172 | + * Note: you should not put your personal libraries in the system library directory, |
|
173 | + * because it is recalled in case of updating the system you might have surprises. |
|
174 | + */ |
|
175 | 175 | define('LIBRARY_PATH', ROOT_PATH . 'libraries' . DS); |
176 | 176 | |
177 | 177 | /** |
178 | - * The path to the directory that contains the log files. |
|
179 | - * |
|
180 | - * Note: This directory must be available in writing and if possible must have as owner the user who launches your web server, |
|
181 | - * under unix or linux most often with the apache web server it is "www-data" or "httpd" even "nobody" for more |
|
182 | - * details see the documentation of your web server. |
|
183 | - * Example for Unix or linux with apache web server: |
|
184 | - * # chmod -R 700 /path/to/your/logs/directory/ |
|
185 | - * # chown -R www-data:www-data /path/to/your/logs/directory/ |
|
186 | - */ |
|
178 | + * The path to the directory that contains the log files. |
|
179 | + * |
|
180 | + * Note: This directory must be available in writing and if possible must have as owner the user who launches your web server, |
|
181 | + * under unix or linux most often with the apache web server it is "www-data" or "httpd" even "nobody" for more |
|
182 | + * details see the documentation of your web server. |
|
183 | + * Example for Unix or linux with apache web server: |
|
184 | + * # chmod -R 700 /path/to/your/logs/directory/ |
|
185 | + * # chown -R www-data:www-data /path/to/your/logs/directory/ |
|
186 | + */ |
|
187 | 187 | define('LOGS_PATH', ROOT_PATH . 'logs' . DS); |
188 | 188 | |
189 | 189 | /** |
190 | - * The path to the modules directory. |
|
191 | - * |
|
192 | - * It contains your modules used files (config, controllers, libraries, etc.) that is to say which contains your files of the modules, |
|
193 | - * in HMVC architecture (hierichical, controllers, models, views). |
|
194 | - */ |
|
190 | + * The path to the modules directory. |
|
191 | + * |
|
192 | + * It contains your modules used files (config, controllers, libraries, etc.) that is to say which contains your files of the modules, |
|
193 | + * in HMVC architecture (hierichical, controllers, models, views). |
|
194 | + */ |
|
195 | 195 | define('MODULE_PATH', ROOT_PATH . 'modules' . DS); |
196 | 196 | |
197 | 197 | /** |
198 | - * The path to the directory of sources external to your application. |
|
199 | - * |
|
200 | - * If you have already used "composer" you know what that means. |
|
201 | - */ |
|
198 | + * The path to the directory of sources external to your application. |
|
199 | + * |
|
200 | + * If you have already used "composer" you know what that means. |
|
201 | + */ |
|
202 | 202 | define('VENDOR_PATH', ROOT_PATH . 'vendor' . DS); |
203 | 203 | |
204 | 204 | /** |
205 | - * The front controller of your application. |
|
206 | - * |
|
207 | - * "index.php" it is through this file that all the requests come, there is a possibility to hidden it in the url of |
|
208 | - * your application by using the rewrite module URL of your web server . |
|
209 | - * For example, under apache web server, there is a configuration example file that is located at the root |
|
210 | - * of your framework folder : "htaccess.txt" rename it to ".htaccess". |
|
211 | - */ |
|
205 | + * The front controller of your application. |
|
206 | + * |
|
207 | + * "index.php" it is through this file that all the requests come, there is a possibility to hidden it in the url of |
|
208 | + * your application by using the rewrite module URL of your web server . |
|
209 | + * For example, under apache web server, there is a configuration example file that is located at the root |
|
210 | + * of your framework folder : "htaccess.txt" rename it to ".htaccess". |
|
211 | + */ |
|
212 | 212 | define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME)); |
213 | 213 | |
214 | 214 | /** |
@@ -217,14 +217,14 @@ discard block |
||
217 | 217 | define('IS_CLI', stripos('cli', php_sapi_name()) !== false); |
218 | 218 | |
219 | 219 | /** |
220 | - * The environment of your application (production, test, development). |
|
221 | - * |
|
222 | - * if your application is still in development you use the value "development" |
|
223 | - * so you will have the display of the error messages, etc. |
|
224 | - * Once you finish the development of your application that is to put it online |
|
225 | - * you change this value to "production" or "testing", in this case there will be deactivation of error messages, |
|
226 | - * the loading of the system, will be fast. |
|
227 | - */ |
|
220 | + * The environment of your application (production, test, development). |
|
221 | + * |
|
222 | + * if your application is still in development you use the value "development" |
|
223 | + * so you will have the display of the error messages, etc. |
|
224 | + * Once you finish the development of your application that is to put it online |
|
225 | + * you change this value to "production" or "testing", in this case there will be deactivation of error messages, |
|
226 | + * the loading of the system, will be fast. |
|
227 | + */ |
|
228 | 228 | define('ENVIRONMENT', 'development'); |
229 | 229 | |
230 | 230 | /* ---------------------------------------------------------------------------------- */ |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | } |
255 | 255 | |
256 | 256 | /** |
257 | - * let's go. |
|
258 | - * Everything is OK now we launch our application. |
|
259 | - */ |
|
257 | + * let's go. |
|
258 | + * Everything is OK now we launch our application. |
|
259 | + */ |
|
260 | 260 | require_once CORE_PATH . 'bootstrap.php'; |
261 | 261 | \ No newline at end of file |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | * You should have received a copy of the GNU General Public License |
23 | 23 | * along with this program; if not, write to the Free Software |
24 | 24 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
25 | - */ |
|
25 | + */ |
|
26 | 26 | |
27 | 27 | /** |
28 | 28 | * @file bootstrap.php |
@@ -46,9 +46,9 @@ discard block |
||
46 | 46 | } |
47 | 47 | |
48 | 48 | /** |
49 | - * inclusion of global constants of the environment that contain : name of the framework, |
|
50 | - * version, release date, version of PHP required, etc. |
|
51 | - */ |
|
49 | + * inclusion of global constants of the environment that contain : name of the framework, |
|
50 | + * version, release date, version of PHP required, etc. |
|
51 | + */ |
|
52 | 52 | require_once CORE_PATH . 'constants.php'; |
53 | 53 | |
54 | 54 | /** |
@@ -65,17 +65,17 @@ discard block |
||
65 | 65 | $BENCHMARK->mark('APP_EXECUTION_START'); |
66 | 66 | |
67 | 67 | /** |
68 | - * instance of the Log class |
|
69 | - */ |
|
70 | - $LOGGER =& class_loader('Log', 'classes'); |
|
68 | + * instance of the Log class |
|
69 | + */ |
|
70 | + $LOGGER =& class_loader('Log', 'classes'); |
|
71 | 71 | |
72 | - $LOGGER->setLogger('ApplicationBootstrap'); |
|
72 | + $LOGGER->setLogger('ApplicationBootstrap'); |
|
73 | 73 | |
74 | - $LOGGER->debug('Checking PHP version ...'); |
|
74 | + $LOGGER->debug('Checking PHP version ...'); |
|
75 | 75 | |
76 | 76 | /** |
77 | - * Verification of the PHP environment: minimum and maximum version |
|
78 | - */ |
|
77 | + * Verification of the PHP environment: minimum and maximum version |
|
78 | + */ |
|
79 | 79 | if (version_compare(phpversion(), TNH_REQUIRED_PHP_MIN_VERSION, '<')){ |
80 | 80 | show_error('Your PHP Version [' . phpversion() . '] is less than [' . TNH_REQUIRED_PHP_MIN_VERSION . '], please install a new version or update your PHP to the latest.', 'PHP Error environment'); |
81 | 81 | } |
@@ -85,13 +85,13 @@ discard block |
||
85 | 85 | $LOGGER->info('PHP version [' . phpversion() . '] is OK [REQUIRED MINIMUM: ' . TNH_REQUIRED_PHP_MIN_VERSION . ', REQUIRED MAXIMUM: ' . TNH_REQUIRED_PHP_MAX_VERSION . '], application can work without any issue'); |
86 | 86 | |
87 | 87 | /** |
88 | - * Setting of the PHP error message handling function |
|
89 | - */ |
|
88 | + * Setting of the PHP error message handling function |
|
89 | + */ |
|
90 | 90 | set_error_handler('php_error_handler'); |
91 | 91 | |
92 | 92 | /** |
93 | - * Setting of the PHP error exception handling function |
|
94 | - */ |
|
93 | + * Setting of the PHP error exception handling function |
|
94 | + */ |
|
95 | 95 | set_exception_handler('php_exception_handler'); |
96 | 96 | |
97 | 97 | /** |
@@ -124,18 +124,18 @@ discard block |
||
124 | 124 | |
125 | 125 | $BENCHMARK->mark('CONFIG_INIT_START'); |
126 | 126 | /** |
127 | - * Load configurations and using the |
|
128 | - * static method "init()" to initialize the Config class . |
|
129 | - */ |
|
127 | + * Load configurations and using the |
|
128 | + * static method "init()" to initialize the Config class . |
|
129 | + */ |
|
130 | 130 | $CONFIG =& class_loader('Config', 'classes'); |
131 | 131 | $CONFIG->init(); |
132 | 132 | $BENCHMARK->mark('CONFIG_INIT_END'); |
133 | 133 | |
134 | 134 | $BENCHMARK->mark('MODULE_INIT_START'); |
135 | 135 | /** |
136 | - * Load modules and using the |
|
137 | - * static method "init()" to initialize the Module class. |
|
138 | - */ |
|
136 | + * Load modules and using the |
|
137 | + * static method "init()" to initialize the Module class. |
|
138 | + */ |
|
139 | 139 | $MODULE =& class_loader('Module', 'classes'); |
140 | 140 | $MODULE->init(); |
141 | 141 | $BENCHMARK->mark('MODULE_INIT_END'); |
@@ -148,19 +148,19 @@ discard block |
||
148 | 148 | $LOGGER->info('Base Controller loaded successfully'); |
149 | 149 | |
150 | 150 | /** |
151 | - * Register controllers autoload function |
|
152 | - */ |
|
151 | + * Register controllers autoload function |
|
152 | + */ |
|
153 | 153 | spl_autoload_register('autoload_controller'); |
154 | 154 | |
155 | 155 | /** |
156 | - * Loading Security class |
|
157 | - */ |
|
156 | + * Loading Security class |
|
157 | + */ |
|
158 | 158 | $SECURITY =& class_loader('Security', 'classes'); |
159 | 159 | $SECURITY->checkWhiteListIpAccess(); |
160 | 160 | |
161 | 161 | /** |
162 | - * Loading Url class |
|
163 | - */ |
|
162 | + * Loading Url class |
|
163 | + */ |
|
164 | 164 | $URL =& class_loader('Url', 'classes'); |
165 | 165 | |
166 | 166 | if(get_config('cache_enable', false)){ |
@@ -190,8 +190,8 @@ discard block |
||
190 | 190 | |
191 | 191 | $LOGGER->info('Everything is OK load Router library and dispatch the request to the corresponding controller'); |
192 | 192 | /** |
193 | - * Routing |
|
194 | - * instantiation of the "Router" class and user request routing processing. |
|
195 | - */ |
|
193 | + * Routing |
|
194 | + * instantiation of the "Router" class and user request routing processing. |
|
195 | + */ |
|
196 | 196 | $ROUTER = & class_loader('Router', 'classes'); |
197 | 197 | $ROUTER->run(); |
@@ -22,7 +22,7 @@ |
||
22 | 22 | * You should have received a copy of the GNU General Public License |
23 | 23 | * along with this program; if not, write to the Free Software |
24 | 24 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
25 | - */ |
|
25 | + */ |
|
26 | 26 | |
27 | 27 | class Config{ |
28 | 28 |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | * You should have received a copy of the GNU General Public License |
23 | 23 | * along with this program; if not, write to the Free Software |
24 | 24 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
25 | - */ |
|
25 | + */ |
|
26 | 26 | |
27 | 27 | class FileCache implements CacheInterface{ |
28 | 28 | |
@@ -83,26 +83,26 @@ discard block |
||
83 | 83 | return false; |
84 | 84 | } |
85 | 85 | // Getting a shared lock |
86 | - flock($handle, LOCK_SH); |
|
87 | - $data = file_get_contents($filePath); |
|
88 | - fclose($handle); |
|
89 | - $data = @unserialize($this->compressCacheData ? gzinflate($data) : $data); |
|
90 | - if (! $data) { |
|
91 | - $logger->error('Can not unserialize the cache data for the key ['. $key .'], return false'); |
|
92 | - // If unserializing somehow didn't work out, we'll delete the file |
|
93 | - unlink($filePath); |
|
94 | - return false; |
|
95 | - } |
|
96 | - if (time() > $data['expire']) { |
|
97 | - $logger->info('The cache data for the key ['. $key .'] already expired delete the cache file [' .$filePath. ']'); |
|
98 | - // Unlinking when the file was expired |
|
99 | - unlink($filePath); |
|
100 | - return false; |
|
101 | - } |
|
102 | - else{ |
|
103 | - $logger->info('The cache not yet expire, now return the cache data for key ['. $key .'], the cache will expire at [' . date('Y-m-d H:i:s', $data['expire']) . ']'); |
|
104 | - return $data['data']; |
|
105 | - } |
|
86 | + flock($handle, LOCK_SH); |
|
87 | + $data = file_get_contents($filePath); |
|
88 | + fclose($handle); |
|
89 | + $data = @unserialize($this->compressCacheData ? gzinflate($data) : $data); |
|
90 | + if (! $data) { |
|
91 | + $logger->error('Can not unserialize the cache data for the key ['. $key .'], return false'); |
|
92 | + // If unserializing somehow didn't work out, we'll delete the file |
|
93 | + unlink($filePath); |
|
94 | + return false; |
|
95 | + } |
|
96 | + if (time() > $data['expire']) { |
|
97 | + $logger->info('The cache data for the key ['. $key .'] already expired delete the cache file [' .$filePath. ']'); |
|
98 | + // Unlinking when the file was expired |
|
99 | + unlink($filePath); |
|
100 | + return false; |
|
101 | + } |
|
102 | + else{ |
|
103 | + $logger->info('The cache not yet expire, now return the cache data for key ['. $key .'], the cache will expire at [' . date('Y-m-d H:i:s', $data['expire']) . ']'); |
|
104 | + return $data['data']; |
|
105 | + } |
|
106 | 106 | return false; |
107 | 107 | } |
108 | 108 | |
@@ -126,25 +126,25 @@ discard block |
||
126 | 126 | } |
127 | 127 | flock($handle, LOCK_EX); // exclusive lock, will get released when the file is closed |
128 | 128 | //Serializing along with the TTL |
129 | - $cacheData = serialize(array( |
|
129 | + $cacheData = serialize(array( |
|
130 | 130 | 'mtime' => time(), |
131 | 131 | 'expire' => $expire, |
132 | 132 | 'data' => $data, |
133 | 133 | 'ttl' => $ttl |
134 | 134 | ) |
135 | 135 | ); |
136 | - $result = fwrite($handle, $this->compressCacheData ? gzdeflate($cacheData, 9) : $cacheData); |
|
137 | - if(! $result){ |
|
138 | - $logger->error('Can not write cache data into file [' .$filePath. '] for the key ['. $key .'], return false'); |
|
139 | - fclose($handle); |
|
140 | - return false; |
|
141 | - } |
|
142 | - else{ |
|
143 | - $logger->info('Cache data saved into file [' .$filePath. '] for the key ['. $key .']'); |
|
144 | - fclose($handle); |
|
136 | + $result = fwrite($handle, $this->compressCacheData ? gzdeflate($cacheData, 9) : $cacheData); |
|
137 | + if(! $result){ |
|
138 | + $logger->error('Can not write cache data into file [' .$filePath. '] for the key ['. $key .'], return false'); |
|
139 | + fclose($handle); |
|
140 | + return false; |
|
141 | + } |
|
142 | + else{ |
|
143 | + $logger->info('Cache data saved into file [' .$filePath. '] for the key ['. $key .']'); |
|
144 | + fclose($handle); |
|
145 | 145 | chmod($filePath, 0640); |
146 | 146 | return true; |
147 | - } |
|
147 | + } |
|
148 | 148 | } |
149 | 149 | |
150 | 150 | |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | } |
166 | 166 | else{ |
167 | 167 | $logger->info('Found cache file [' .$filePath. '] remove it'); |
168 | - @unlink($filePath); |
|
168 | + @unlink($filePath); |
|
169 | 169 | return true; |
170 | 170 | } |
171 | 171 | } |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | } |
190 | 190 | else{ |
191 | 191 | $logger->info('Found cache file [' .$filePath. '] check the validity'); |
192 | - $data = file_get_contents($filePath); |
|
192 | + $data = file_get_contents($filePath); |
|
193 | 193 | $data = @unserialize($this->compressCacheData ? gzinflate($data) : $data); |
194 | 194 | if(! $data){ |
195 | 195 | $logger->warning('Can not unserialize the cache data for file [' . $filePath . ']'); |
@@ -230,17 +230,17 @@ discard block |
||
230 | 230 | foreach ($list as $file) { |
231 | 231 | $logger->debug('Processing the cache file [' . $file . ']'); |
232 | 232 | $data = file_get_contents($file); |
233 | - $data = @unserialize($this->compressCacheData ? gzinflate($data) : $data); |
|
234 | - if(! $data){ |
|
235 | - $logger->warning('Can not unserialize the cache data for file [' . $file . ']'); |
|
236 | - } |
|
237 | - else if(time() > $data['expire']){ |
|
238 | - $logger->info('The cache data for file [' . $file . '] already expired remove it'); |
|
239 | - @unlink($file); |
|
240 | - } |
|
241 | - else{ |
|
242 | - $logger->info('The cache data for file [' . $file . '] not yet expired skip it'); |
|
243 | - } |
|
233 | + $data = @unserialize($this->compressCacheData ? gzinflate($data) : $data); |
|
234 | + if(! $data){ |
|
235 | + $logger->warning('Can not unserialize the cache data for file [' . $file . ']'); |
|
236 | + } |
|
237 | + else if(time() > $data['expire']){ |
|
238 | + $logger->info('The cache data for file [' . $file . '] already expired remove it'); |
|
239 | + @unlink($file); |
|
240 | + } |
|
241 | + else{ |
|
242 | + $logger->info('The cache data for file [' . $file . '] not yet expired skip it'); |
|
243 | + } |
|
244 | 244 | } |
245 | 245 | } |
246 | 246 | } |
@@ -264,19 +264,19 @@ discard block |
||
264 | 264 | } |
265 | 265 | } |
266 | 266 | |
267 | - /** |
|
268 | - * @return boolean |
|
269 | - */ |
|
270 | - public function isCompressCacheData(){ |
|
271 | - return $this->compressCacheData; |
|
272 | - } |
|
267 | + /** |
|
268 | + * @return boolean |
|
269 | + */ |
|
270 | + public function isCompressCacheData(){ |
|
271 | + return $this->compressCacheData; |
|
272 | + } |
|
273 | 273 | |
274 | - /** |
|
275 | - * @param boolean $compressCacheData |
|
276 | - * |
|
277 | - * @return self |
|
278 | - */ |
|
279 | - public function setCompressCacheData($status = true){ |
|
274 | + /** |
|
275 | + * @param boolean $compressCacheData |
|
276 | + * |
|
277 | + * @return self |
|
278 | + */ |
|
279 | + public function setCompressCacheData($status = true){ |
|
280 | 280 | //if Zlib extension is not loaded set compressCacheData to false |
281 | 281 | if($status === true && ! extension_loaded('zlib')){ |
282 | 282 | $logger = static::getLogger(); |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | $this->compressCacheData = $status; |
288 | 288 | } |
289 | 289 | return $this; |
290 | - } |
|
290 | + } |
|
291 | 291 | |
292 | 292 | /** |
293 | 293 | * Check whether the cache feature for the handle is supported |
@@ -299,11 +299,11 @@ discard block |
||
299 | 299 | } |
300 | 300 | |
301 | 301 | /** |
302 | - * Get the cache file full path for the given key |
|
303 | - * |
|
304 | - * @param $key the cache item key |
|
305 | - * @return string the full cache file path for this key |
|
306 | - */ |
|
302 | + * Get the cache file full path for the given key |
|
303 | + * |
|
304 | + * @param $key the cache item key |
|
305 | + * @return string the full cache file path for this key |
|
306 | + */ |
|
307 | 307 | private function getFilePath($key){ |
308 | 308 | return CACHE_PATH . md5($key) . '.cache'; |
309 | 309 | } |