Skip to content
This repository
  • 7 commits
  • 11 files changed
  • 0 comments
  • 1 contributor
8 .gitignore
@@ -30,8 +30,14 @@ nb-configuration.xml
30 30 # iCF specific files
31 31 icf/cache/*
32 32 !icf/cache/index.html
33   -icf/config/*/database.php
  33 +icf/config/development/database.php
  34 +icf/config/production/database.php
  35 +icf/config/testing/database.php
34 36 icf/config/database.php
  37 +icf/config/development/config.php
  38 +icf/config/production/config.php
  39 +icf/config/testing/config.php
  40 +icf/config/config.php
35 41 icf/logs/*
36 42 !icf/logs/index.html
37 43 icf/controllers/test*
2  icf/config/config.php → icf/config/config.sample.php
@@ -293,7 +293,7 @@
293 293 | 'csrf_cookie_name' = The cookie name
294 294 | 'csrf_expire' = The number in seconds the token should expire.
295 295 */
296   -$config['csrf_protection'] = FALSE;
  296 +$config['csrf_protection'] = TRUE;
297 297 $config['csrf_token_name'] = 'csrf_test_name';
298 298 $config['csrf_cookie_name'] = 'csrf_cookie_name';
299 299 $config['csrf_expire'] = 7200;
69 icf/config/database.php
... ... @@ -1,69 +0,0 @@
1   -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
2   -/*
3   -| -------------------------------------------------------------------
4   -| DATABASE CONNECTIVITY SETTINGS
5   -| -------------------------------------------------------------------
6   -| This file will contain the settings needed to access your database.
7   -|
8   -| For complete instructions please consult the 'Database Connection'
9   -| page of the User Guide.
10   -|
11   -| -------------------------------------------------------------------
12   -| EXPLANATION OF VARIABLES
13   -| -------------------------------------------------------------------
14   -|
15   -| ['hostname'] The hostname of your database server.
16   -| ['username'] The username used to connect to the database
17   -| ['password'] The password used to connect to the database
18   -| ['database'] The name of the database you want to connect to
19   -| ['dbdriver'] The database type. ie: mysql. Currently supported:
20   - mysql, mysqli, postgre, odbc, mssql, sqlite, oci8
21   -| ['dbprefix'] You can add an optional prefix, which will be added
22   -| to the table name when using the Active Record class
23   -| ['pconnect'] TRUE/FALSE - Whether to use a persistent connection
24   -| ['db_debug'] TRUE/FALSE - Whether database errors should be displayed.
25   -| ['cache_on'] TRUE/FALSE - Enables/disables query caching
26   -| ['cachedir'] The path to the folder where cache files should be stored
27   -| ['char_set'] The character set used in communicating with the database
28   -| ['dbcollat'] The character collation used in communicating with the database
29   -| NOTE: For MySQL and MySQLi databases, this setting is only used
30   -| as a backup if your server is running PHP < 5.2.3 or MySQL < 5.0.7
31   -| (and in table creation queries made with DB Forge).
32   -| There is an incompatibility in PHP with mysql_real_escape_string() which
33   -| can make your site vulnerable to SQL injection if you are using a
34   -| multi-byte character set and are running versions lower than these.
35   -| Sites using Latin-1 or UTF-8 database character set and collation are unaffected.
36   -| ['swap_pre'] A default table prefix that should be swapped with the dbprefix
37   -| ['autoinit'] Whether or not to automatically initialize the database.
38   -| ['stricton'] TRUE/FALSE - forces 'Strict Mode' connections
39   -| - good for ensuring strict SQL while developing
40   -|
41   -| The $active_group variable lets you choose which connection group to
42   -| make active. By default there is only one group (the 'default' group).
43   -|
44   -| The $active_record variables lets you determine whether or not to load
45   -| the active record class
46   -*/
47   -
48   -$active_group = 'default';
49   -$active_record = TRUE;
50   -
51   -$db['default']['hostname'] = 'localhost';
52   -$db['default']['username'] = '';
53   -$db['default']['password'] = '';
54   -$db['default']['database'] = '';
55   -$db['default']['dbdriver'] = 'mysql';
56   -$db['default']['dbprefix'] = '';
57   -$db['default']['pconnect'] = TRUE;
58   -$db['default']['db_debug'] = TRUE;
59   -$db['default']['cache_on'] = FALSE;
60   -$db['default']['cachedir'] = '';
61   -$db['default']['char_set'] = 'utf8';
62   -$db['default']['dbcollat'] = 'utf8_general_ci';
63   -$db['default']['swap_pre'] = '';
64   -$db['default']['autoinit'] = TRUE;
65   -$db['default']['stricton'] = FALSE;
66   -
67   -
68   -/* End of file database.php */
69   -/* Location: ./application/config/database.php */
2  icf/config/production/database.php → icf/config/database.sample.php
@@ -66,4 +66,4 @@
66 66
67 67
68 68 /* End of file database.php */
69   -/* Location: ./application/config/production/database.php */
  69 +/* Location: ./application/config/database.php */
376 icf/config/development/config.php
... ... @@ -1,376 +0,0 @@
1   -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
2   -
3   -/*
4   -|--------------------------------------------------------------------------
5   -| Base Site URL
6   -|--------------------------------------------------------------------------
7   -|
8   -| URL to your CodeIgniter root. Typically this will be your base URL,
9   -| WITH a trailing slash:
10   -|
11   -| http://example.com/
12   -|
13   -| If this is not set then CodeIgniter will guess the protocol, domain and
14   -| path to your installation.
15   -|
16   -*/
17   -$config['base_url'] = '';
18   -
19   -/*
20   -|--------------------------------------------------------------------------
21   -| Index File
22   -|--------------------------------------------------------------------------
23   -|
24   -| Typically this will be your index.php file, unless you've renamed it to
25   -| something else. If you are using mod_rewrite to remove the page set this
26   -| variable so that it is blank.
27   -|
28   -*/
29   -$config['index_page'] = 'index.php';
30   -
31   -/*
32   -|--------------------------------------------------------------------------
33   -| URI PROTOCOL
34   -|--------------------------------------------------------------------------
35   -|
36   -| This item determines which server global should be used to retrieve the
37   -| URI string. The default setting of 'AUTO' works for most servers.
38   -| If your links do not seem to work, try one of the other delicious flavors:
39   -|
40   -| 'AUTO' Default - auto detects
41   -| 'PATH_INFO' Uses the PATH_INFO
42   -| 'QUERY_STRING' Uses the QUERY_STRING
43   -| 'REQUEST_URI' Uses the REQUEST_URI
44   -| 'ORIG_PATH_INFO' Uses the ORIG_PATH_INFO
45   -|
46   -*/
47   -$config['uri_protocol'] = 'AUTO';
48   -
49   -/*
50   -|--------------------------------------------------------------------------
51   -| URL suffix
52   -|--------------------------------------------------------------------------
53   -|
54   -| This option allows you to add a suffix to all URLs generated by CodeIgniter.
55   -| For more information please see the user guide:
56   -|
57   -| http://codeigniter.com/user_guide/general/urls.html
58   -*/
59   -
60   -$config['url_suffix'] = '';
61   -
62   -/*
63   -|--------------------------------------------------------------------------
64   -| Default Language
65   -|--------------------------------------------------------------------------
66   -|
67   -| This determines which set of language files should be used. Make sure
68   -| there is an available translation if you intend to use something other
69   -| than english.
70   -|
71   -*/
72   -$config['language'] = 'english';
73   -
74   -/*
75   -|--------------------------------------------------------------------------
76   -| Default Character Set
77   -|--------------------------------------------------------------------------
78   -|
79   -| This determines which character set is used by default in various methods
80   -| that require a character set to be provided.
81   -|
82   -*/
83   -$config['charset'] = 'UTF-8';
84   -
85   -/*
86   -|--------------------------------------------------------------------------
87   -| Enable/Disable System Hooks
88   -|--------------------------------------------------------------------------
89   -|
90   -| If you would like to use the 'hooks' feature you must enable it by
91   -| setting this variable to TRUE (boolean). See the user guide for details.
92   -|
93   -*/
94   -$config['enable_hooks'] = FALSE;
95   -
96   -
97   -/*
98   -|--------------------------------------------------------------------------
99   -| Class Extension Prefix
100   -|--------------------------------------------------------------------------
101   -|
102   -| This item allows you to set the filename/classname prefix when extending
103   -| native libraries. For more information please see the user guide:
104   -|
105   -| http://codeigniter.com/user_guide/general/core_classes.html
106   -| http://codeigniter.com/user_guide/general/creating_libraries.html
107   -|
108   -*/
109   -$config['subclass_prefix'] = 'ICF_';
110   -
111   -
112   -/*
113   -|--------------------------------------------------------------------------
114   -| Allowed URL Characters
115   -|--------------------------------------------------------------------------
116   -|
117   -| This lets you specify with a regular expression which characters are permitted
118   -| within your URLs. When someone tries to submit a URL with disallowed
119   -| characters they will get a warning message.
120   -|
121   -| As a security measure you are STRONGLY encouraged to restrict URLs to
122   -| as few characters as possible. By default only these are allowed: a-z 0-9~%.:_-
123   -|
124   -| Leave blank to allow all characters -- but only if you are insane.
125   -|
126   -| DO NOT CHANGE THIS UNLESS YOU FULLY UNDERSTAND THE REPERCUSSIONS!!
127   -|
128   -*/
129   -$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';
130   -
131   -
132   -/*
133   -|--------------------------------------------------------------------------
134   -| Enable Query Strings
135   -|--------------------------------------------------------------------------
136   -|
137   -| By default CodeIgniter uses search-engine friendly segment based URLs:
138   -| example.com/who/what/where/
139   -|
140   -| By default CodeIgniter enables access to the $_GET array. If for some
141   -| reason you would like to disable it, set 'allow_get_array' to FALSE.
142   -|
143   -| You can optionally enable standard query string based URLs:
144   -| example.com?who=me&what=something&where=here
145   -|
146   -| Options are: TRUE or FALSE (boolean)
147   -|
148   -| The other items let you set the query string 'words' that will
149   -| invoke your controllers and its functions:
150   -| example.com/index.php?c=controller&m=function
151   -|
152   -| Please note that some of the helpers won't work as expected when
153   -| this feature is enabled, since CodeIgniter is designed primarily to
154   -| use segment based URLs.
155   -|
156   -*/
157   -$config['allow_get_array'] = TRUE;
158   -$config['enable_query_strings'] = FALSE;
159   -$config['controller_trigger'] = 'c';
160   -$config['function_trigger'] = 'm';
161   -$config['directory_trigger'] = 'd'; // experimental not currently in use
162   -
163   -/*
164   -|--------------------------------------------------------------------------
165   -| Error Logging Threshold
166   -|--------------------------------------------------------------------------
167   -|
168   -| If you have enabled error logging, you can set an error threshold to
169   -| determine what gets logged. Threshold options are:
170   -| You can enable error logging by setting a threshold over zero. The
171   -| threshold determines what gets logged. Threshold options are:
172   -|
173   -| 0 = Disables logging, Error logging TURNED OFF
174   -| 1 = Error Messages (including PHP errors)
175   -| 2 = Debug Messages
176   -| 3 = Informational Messages
177   -| 4 = All Messages
178   -|
179   -| For a live site you'll usually only enable Errors (1) to be logged otherwise
180   -| your log files will fill up very fast.
181   -|
182   -*/
183   -$config['log_threshold'] = 4;
184   -
185   -/*
186   -|--------------------------------------------------------------------------
187   -| Error Logging Directory Path
188   -|--------------------------------------------------------------------------
189   -|
190   -| Leave this BLANK unless you would like to set something other than the default
191   -| application/logs/ folder. Use a full server path with trailing slash.
192   -|
193   -*/
194   -$config['log_path'] = '';
195   -
196   -/*
197   -|--------------------------------------------------------------------------
198   -| Date Format for Logs
199   -|--------------------------------------------------------------------------
200   -|
201   -| Each item that is logged has an associated date. You can use PHP date
202   -| codes to set your own date formatting
203   -|
204   -*/
205   -$config['log_date_format'] = 'Y-m-d H:i:s';
206   -
207   -/*
208   -|--------------------------------------------------------------------------
209   -| Cache Directory Path
210   -|--------------------------------------------------------------------------
211   -|
212   -| Leave this BLANK unless you would like to set something other than the default
213   -| system/cache/ folder. Use a full server path with trailing slash.
214   -|
215   -*/
216   -$config['cache_path'] = '';
217   -
218   -/*
219   -|--------------------------------------------------------------------------
220   -| Encryption Key
221   -|--------------------------------------------------------------------------
222   -|
223   -| If you use the Encryption class or the Session class you
224   -| MUST set an encryption key. See the user guide for info.
225   -|
226   -*/
227   -$config['encryption_key'] = '';
228   -
229   -/*
230   -|--------------------------------------------------------------------------
231   -| Session Variables
232   -|--------------------------------------------------------------------------
233   -|
234   -| 'sess_cookie_name' = the name you want for the cookie
235   -| 'sess_expiration' = the number of SECONDS you want the session to last.
236   -| by default sessions last 7200 seconds (two hours). Set to zero for no expiration.
237   -| 'sess_expire_on_close' = Whether to cause the session to expire automatically
238   -| when the browser window is closed
239   -| 'sess_encrypt_cookie' = Whether to encrypt the cookie
240   -| 'sess_use_database' = Whether to save the session data to a database
241   -| 'sess_table_name' = The name of the session database table
242   -| 'sess_match_ip' = Whether to match the user's IP address when reading the session data
243   -| 'sess_match_useragent' = Whether to match the User Agent when reading the session data
244   -| 'sess_time_to_update' = how many seconds between CI refreshing Session Information
245   -|
246   -*/
247   -$config['sess_cookie_name'] = 'ci_session';
248   -$config['sess_expiration'] = 7200;
249   -$config['sess_expire_on_close'] = FALSE;
250   -$config['sess_encrypt_cookie'] = TRUE;
251   -$config['sess_use_database'] = TRUE;
252   -$config['sess_table_name'] = 'ci_sessions';
253   -$config['sess_match_ip'] = TRUE;
254   -$config['sess_match_useragent'] = TRUE;
255   -$config['sess_time_to_update'] = 300;
256   -
257   -/*
258   -|--------------------------------------------------------------------------
259   -| Cookie Related Variables
260   -|--------------------------------------------------------------------------
261   -|
262   -| 'cookie_prefix' = Set a prefix if you need to avoid collisions
263   -| 'cookie_domain' = Set to .your-domain.com for site-wide cookies
264   -| 'cookie_path' = Typically will be a forward slash
265   -| 'cookie_secure' = Cookies will only be set if a secure HTTPS connection exists.
266   -|
267   -*/
268   -$config['cookie_prefix'] = "";
269   -$config['cookie_domain'] = "";
270   -$config['cookie_path'] = "/";
271   -$config['cookie_secure'] = FALSE;
272   -
273   -/*
274   -|--------------------------------------------------------------------------
275   -| Global XSS Filtering
276   -|--------------------------------------------------------------------------
277   -|
278   -| Determines whether the XSS filter is always active when GET, POST or
279   -| COOKIE data is encountered
280   -|
281   -*/
282   -$config['global_xss_filtering'] = TRUE;
283   -
284   -/*
285   -|--------------------------------------------------------------------------
286   -| Cross Site Request Forgery
287   -|--------------------------------------------------------------------------
288   -| Enables a CSRF cookie token to be set. When set to TRUE, token will be
289   -| checked on a submitted form. If you are accepting user data, it is strongly
290   -| recommended CSRF protection be enabled.
291   -|
292   -| 'csrf_token_name' = The token name
293   -| 'csrf_cookie_name' = The cookie name
294   -| 'csrf_expire' = The number in seconds the token should expire.
295   -*/
296   -$config['csrf_protection'] = FALSE;
297   -$config['csrf_token_name'] = 'csrf_test_name';
298   -$config['csrf_cookie_name'] = 'csrf_cookie_name';
299   -$config['csrf_expire'] = 7200;
300   -
301   -/*
302   -|--------------------------------------------------------------------------
303   -| Output Compression
304   -|--------------------------------------------------------------------------
305   -|
306   -| Enables Gzip output compression for faster page loads. When enabled,
307   -| the output class will test whether your server supports Gzip.
308   -| Even if it does, however, not all browsers support compression
309   -| so enable only if you are reasonably sure your visitors can handle it.
310   -|
311   -| VERY IMPORTANT: If you are getting a blank page when compression is enabled it
312   -| means you are prematurely outputting something to your browser. It could
313   -| even be a line of whitespace at the end of one of your scripts. For
314   -| compression to work, nothing can be sent before the output buffer is called
315   -| by the output class. Do not 'echo' any values with compression enabled.
316   -|
317   -*/
318   -$config['compress_output'] = FALSE;
319   -
320   -/*
321   -|--------------------------------------------------------------------------
322   -| Master Time Reference
323   -|--------------------------------------------------------------------------
324   -|
325   -| Options are 'local' or 'gmt'. This pref tells the system whether to use
326   -| your server's local time as the master 'now' reference, or convert it to
327   -| GMT. See the 'date helper' page of the user guide for information
328   -| regarding date handling.
329   -|
330   -*/
331   -$config['time_reference'] = 'local';
332   -
333   -
334   -/*
335   -|--------------------------------------------------------------------------
336   -| Rewrite PHP Short Tags
337   -|--------------------------------------------------------------------------
338   -|
339   -| If your PHP installation does not have short tag support enabled CI
340   -| can rewrite the tags on-the-fly, enabling you to utilize that syntax
341   -| in your view files. Options are TRUE or FALSE (boolean)
342   -|
343   -*/
344   -$config['rewrite_short_tags'] = FALSE;
345   -
346   -
347   -/*
348   -|--------------------------------------------------------------------------
349   -| Reverse Proxy IPs
350   -|--------------------------------------------------------------------------
351   -|
352   -| If your server is behind a reverse proxy, you must whitelist the proxy IP
353   -| addresses from which CodeIgniter should trust the HTTP_X_FORWARDED_FOR
354   -| header in order to properly identify the visitor's IP address.
355   -| Comma-delimited, e.g. '10.0.1.200,10.0.1.201'
356   -|
357   -*/
358   -$config['proxy_ips'] = '';
359   -
360   -
361   -/*
362   -|--------------------------------------------------------------------------
363   -| Modules Location Path
364   -|--------------------------------------------------------------------------
365   -|
366   -| Alias and path for every location of modules. First come first serve!
367   -|
368   -*/
369   -$config['modules_locations'] = array(
370   - APPPATH . 'modules/' => '../modules/',
371   - FCPATH . 'modules/' => '../../modules/'
372   - );
373   -
374   -
375   -/* End of file config.php */
376   -/* Location: ./application/config/development/config.php */
69 icf/config/development/database.php
... ... @@ -1,69 +0,0 @@
1   -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
2   -/*
3   -| -------------------------------------------------------------------
4   -| DATABASE CONNECTIVITY SETTINGS
5   -| -------------------------------------------------------------------
6   -| This file will contain the settings needed to access your database.
7   -|
8   -| For complete instructions please consult the 'Database Connection'
9   -| page of the User Guide.
10   -|
11   -| -------------------------------------------------------------------
12   -| EXPLANATION OF VARIABLES
13   -| -------------------------------------------------------------------
14   -|
15   -| ['hostname'] The hostname of your database server.
16   -| ['username'] The username used to connect to the database
17   -| ['password'] The password used to connect to the database
18   -| ['database'] The name of the database you want to connect to
19   -| ['dbdriver'] The database type. ie: mysql. Currently supported:
20   - mysql, mysqli, postgre, odbc, mssql, sqlite, oci8
21   -| ['dbprefix'] You can add an optional prefix, which will be added
22   -| to the table name when using the Active Record class
23   -| ['pconnect'] TRUE/FALSE - Whether to use a persistent connection
24   -| ['db_debug'] TRUE/FALSE - Whether database errors should be displayed.
25   -| ['cache_on'] TRUE/FALSE - Enables/disables query caching
26   -| ['cachedir'] The path to the folder where cache files should be stored
27   -| ['char_set'] The character set used in communicating with the database
28   -| ['dbcollat'] The character collation used in communicating with the database
29   -| NOTE: For MySQL and MySQLi databases, this setting is only used
30   -| as a backup if your server is running PHP < 5.2.3 or MySQL < 5.0.7
31   -| (and in table creation queries made with DB Forge).
32   -| There is an incompatibility in PHP with mysql_real_escape_string() which
33   -| can make your site vulnerable to SQL injection if you are using a
34   -| multi-byte character set and are running versions lower than these.
35   -| Sites using Latin-1 or UTF-8 database character set and collation are unaffected.
36   -| ['swap_pre'] A default table prefix that should be swapped with the dbprefix
37   -| ['autoinit'] Whether or not to automatically initialize the database.
38   -| ['stricton'] TRUE/FALSE - forces 'Strict Mode' connections
39   -| - good for ensuring strict SQL while developing
40   -|
41   -| The $active_group variable lets you choose which connection group to
42   -| make active. By default there is only one group (the 'default' group).
43   -|
44   -| The $active_record variables lets you determine whether or not to load
45   -| the active record class
46   -*/
47   -
48   -$active_group = 'default';
49   -$active_record = TRUE;
50   -
51   -$db['default']['hostname'] = 'localhost';
52   -$db['default']['username'] = '';
53   -$db['default']['password'] = '';
54   -$db['default']['database'] = '';
55   -$db['default']['dbdriver'] = 'mysql';
56   -$db['default']['dbprefix'] = '';
57   -$db['default']['pconnect'] = FALSE;
58   -$db['default']['db_debug'] = TRUE;
59   -$db['default']['cache_on'] = FALSE;
60   -$db['default']['cachedir'] = '';
61   -$db['default']['char_set'] = 'utf8';
62   -$db['default']['dbcollat'] = 'utf8_general_ci';
63   -$db['default']['swap_pre'] = '';
64   -$db['default']['autoinit'] = TRUE;
65   -$db['default']['stricton'] = TRUE;
66   -
67   -
68   -/* End of file database.php */
69   -/* Location: ./application/config/development/database.php */
376 icf/config/production/config.php
... ... @@ -1,376 +0,0 @@
1   -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
2   -
3   -/*
4   -|--------------------------------------------------------------------------
5   -| Base Site URL
6   -|--------------------------------------------------------------------------
7   -|
8   -| URL to your CodeIgniter root. Typically this will be your base URL,
9   -| WITH a trailing slash:
10   -|
11   -| http://example.com/
12   -|
13   -| If this is not set then CodeIgniter will guess the protocol, domain and
14   -| path to your installation.
15   -|
16   -*/
17   -$config['base_url'] = '';
18   -
19   -/*
20   -|--------------------------------------------------------------------------
21   -| Index File
22   -|--------------------------------------------------------------------------
23   -|
24   -| Typically this will be your index.php file, unless you've renamed it to
25   -| something else. If you are using mod_rewrite to remove the page set this
26   -| variable so that it is blank.
27   -|
28   -*/
29   -$config['index_page'] = '';
30   -
31   -/*
32   -|--------------------------------------------------------------------------
33   -| URI PROTOCOL
34   -|--------------------------------------------------------------------------
35   -|
36   -| This item determines which server global should be used to retrieve the
37   -| URI string. The default setting of 'AUTO' works for most servers.
38   -| If your links do not seem to work, try one of the other delicious flavors:
39   -|
40   -| 'AUTO' Default - auto detects
41   -| 'PATH_INFO' Uses the PATH_INFO
42   -| 'QUERY_STRING' Uses the QUERY_STRING
43   -| 'REQUEST_URI' Uses the REQUEST_URI
44   -| 'ORIG_PATH_INFO' Uses the ORIG_PATH_INFO
45   -|
46   -*/
47   -$config['uri_protocol'] = 'AUTO';
48   -
49   -/*
50   -|--------------------------------------------------------------------------
51   -| URL suffix
52   -|--------------------------------------------------------------------------
53   -|
54   -| This option allows you to add a suffix to all URLs generated by CodeIgniter.
55   -| For more information please see the user guide:
56   -|
57   -| http://codeigniter.com/user_guide/general/urls.html
58   -*/
59   -
60   -$config['url_suffix'] = '';
61   -
62   -/*
63   -|--------------------------------------------------------------------------
64   -| Default Language
65   -|--------------------------------------------------------------------------
66   -|
67   -| This determines which set of language files should be used. Make sure
68   -| there is an available translation if you intend to use something other
69   -| than english.
70   -|
71   -*/
72   -$config['language'] = 'english';
73   -
74   -/*
75   -|--------------------------------------------------------------------------
76   -| Default Character Set
77   -|--------------------------------------------------------------------------
78   -|
79   -| This determines which character set is used by default in various methods
80   -| that require a character set to be provided.
81   -|
82   -*/
83   -$config['charset'] = 'UTF-8';
84   -
85   -/*
86   -|--------------------------------------------------------------------------
87   -| Enable/Disable System Hooks
88   -|--------------------------------------------------------------------------
89   -|
90   -| If you would like to use the 'hooks' feature you must enable it by
91   -| setting this variable to TRUE (boolean). See the user guide for details.
92   -|
93   -*/
94   -$config['enable_hooks'] = FALSE;
95   -
96   -
97   -/*
98   -|--------------------------------------------------------------------------
99   -| Class Extension Prefix
100   -|--------------------------------------------------------------------------
101   -|
102   -| This item allows you to set the filename/classname prefix when extending
103   -| native libraries. For more information please see the user guide:
104   -|
105   -| http://codeigniter.com/user_guide/general/core_classes.html
106   -| http://codeigniter.com/user_guide/general/creating_libraries.html
107   -|
108   -*/
109   -$config['subclass_prefix'] = 'ICF_';
110   -
111   -
112   -/*
113   -|--------------------------------------------------------------------------
114   -| Allowed URL Characters
115   -|--------------------------------------------------------------------------
116   -|
117   -| This lets you specify with a regular expression which characters are permitted
118   -| within your URLs. When someone tries to submit a URL with disallowed
119   -| characters they will get a warning message.
120   -|
121   -| As a security measure you are STRONGLY encouraged to restrict URLs to
122   -| as few characters as possible. By default only these are allowed: a-z 0-9~%.:_-
123   -|
124   -| Leave blank to allow all characters -- but only if you are insane.
125   -|
126   -| DO NOT CHANGE THIS UNLESS YOU FULLY UNDERSTAND THE REPERCUSSIONS!!
127   -|
128   -*/
129   -$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';
130   -
131   -
132   -/*
133   -|--------------------------------------------------------------------------
134   -| Enable Query Strings
135   -|--------------------------------------------------------------------------
136   -|
137   -| By default CodeIgniter uses search-engine friendly segment based URLs:
138   -| example.com/who/what/where/
139   -|
140   -| By default CodeIgniter enables access to the $_GET array. If for some
141   -| reason you would like to disable it, set 'allow_get_array' to FALSE.
142   -|
143   -| You can optionally enable standard query string based URLs:
144   -| example.com?who=me&what=something&where=here
145   -|
146   -| Options are: TRUE or FALSE (boolean)
147   -|
148   -| The other items let you set the query string 'words' that will
149   -| invoke your controllers and its functions:
150   -| example.com/index.php?c=controller&m=function
151   -|
152   -| Please note that some of the helpers won't work as expected when
153   -| this feature is enabled, since CodeIgniter is designed primarily to
154   -| use segment based URLs.
155   -|
156   -*/
157   -$config['allow_get_array'] = TRUE;
158   -$config['enable_query_strings'] = FALSE;
159   -$config['controller_trigger'] = 'c';
160   -$config['function_trigger'] = 'm';
161   -$config['directory_trigger'] = 'd'; // experimental not currently in use
162   -
163   -/*
164   -|--------------------------------------------------------------------------
165   -| Error Logging Threshold
166   -|--------------------------------------------------------------------------
167   -|
168   -| If you have enabled error logging, you can set an error threshold to
169   -| determine what gets logged. Threshold options are:
170   -| You can enable error logging by setting a threshold over zero. The
171   -| threshold determines what gets logged. Threshold options are:
172   -|
173   -| 0 = Disables logging, Error logging TURNED OFF
174   -| 1 = Error Messages (including PHP errors)
175   -| 2 = Debug Messages
176   -| 3 = Informational Messages
177   -| 4 = All Messages
178   -|
179   -| For a live site you'll usually only enable Errors (1) to be logged otherwise
180   -| your log files will fill up very fast.
181   -|
182   -*/
183   -$config['log_threshold'] = 0;
184   -
185   -/*
186   -|--------------------------------------------------------------------------
187   -| Error Logging Directory Path
188   -|--------------------------------------------------------------------------
189   -|
190   -| Leave this BLANK unless you would like to set something other than the default
191   -| application/logs/ folder. Use a full server path with trailing slash.
192   -|
193   -*/
194   -$config['log_path'] = '';
195   -
196   -/*
197   -|--------------------------------------------------------------------------
198   -| Date Format for Logs
199   -|--------------------------------------------------------------------------
200   -|
201   -| Each item that is logged has an associated date. You can use PHP date
202   -| codes to set your own date formatting
203   -|
204   -*/
205   -$config['log_date_format'] = 'Y-m-d H:i:s';
206   -
207   -/*
208   -|--------------------------------------------------------------------------
209   -| Cache Directory Path
210   -|--------------------------------------------------------------------------
211   -|
212   -| Leave this BLANK unless you would like to set something other than the default
213   -| system/cache/ folder. Use a full server path with trailing slash.
214   -|
215   -*/
216   -$config['cache_path'] = '';
217   -
218   -/*
219   -|--------------------------------------------------------------------------
220   -| Encryption Key
221   -|--------------------------------------------------------------------------
222   -|
223   -| If you use the Encryption class or the Session class you
224   -| MUST set an encryption key. See the user guide for info.
225   -|
226   -*/
227   -$config['encryption_key'] = '';
228   -
229   -/*
230   -|--------------------------------------------------------------------------
231   -| Session Variables
232   -|--------------------------------------------------------------------------
233   -|
234   -| 'sess_cookie_name' = the name you want for the cookie
235   -| 'sess_expiration' = the number of SECONDS you want the session to last.
236   -| by default sessions last 7200 seconds (two hours). Set to zero for no expiration.
237   -| 'sess_expire_on_close' = Whether to cause the session to expire automatically
238   -| when the browser window is closed
239   -| 'sess_encrypt_cookie' = Whether to encrypt the cookie
240   -| 'sess_use_database' = Whether to save the session data to a database
241   -| 'sess_table_name' = The name of the session database table
242   -| 'sess_match_ip' = Whether to match the user's IP address when reading the session data
243   -| 'sess_match_useragent' = Whether to match the User Agent when reading the session data
244   -| 'sess_time_to_update' = how many seconds between CI refreshing Session Information
245   -|
246   -*/
247   -$config['sess_cookie_name'] = 'ci_session';
248   -$config['sess_expiration'] = 7200;
249   -$config['sess_expire_on_close'] = FALSE;
250   -$config['sess_encrypt_cookie'] = TRUE;
251   -$config['sess_use_database'] = TRUE;
252   -$config['sess_table_name'] = 'ci_sessions';
253   -$config['sess_match_ip'] = TRUE;
254   -$config['sess_match_useragent'] = TRUE;
255   -$config['sess_time_to_update'] = 300;
256   -
257   -/*
258   -|--------------------------------------------------------------------------
259   -| Cookie Related Variables
260   -|--------------------------------------------------------------------------
261   -|
262   -| 'cookie_prefix' = Set a prefix if you need to avoid collisions
263   -| 'cookie_domain' = Set to .your-domain.com for site-wide cookies
264   -| 'cookie_path' = Typically will be a forward slash
265   -| 'cookie_secure' = Cookies will only be set if a secure HTTPS connection exists.
266   -|
267   -*/
268   -$config['cookie_prefix'] = "";
269   -$config['cookie_domain'] = "";
270   -$config['cookie_path'] = "/";
271   -$config['cookie_secure'] = FALSE;
272   -
273   -/*
274   -|--------------------------------------------------------------------------
275   -| Global XSS Filtering
276   -|--------------------------------------------------------------------------
277   -|
278   -| Determines whether the XSS filter is always active when GET, POST or
279   -| COOKIE data is encountered
280   -|
281   -*/
282   -$config['global_xss_filtering'] = TRUE;
283   -
284   -/*
285   -|--------------------------------------------------------------------------
286   -| Cross Site Request Forgery
287   -|--------------------------------------------------------------------------
288   -| Enables a CSRF cookie token to be set. When set to TRUE, token will be
289   -| checked on a submitted form. If you are accepting user data, it is strongly
290   -| recommended CSRF protection be enabled.
291   -|
292   -| 'csrf_token_name' = The token name
293   -| 'csrf_cookie_name' = The cookie name
294   -| 'csrf_expire' = The number in seconds the token should expire.
295   -*/
296   -$config['csrf_protection'] = FALSE;
297   -$config['csrf_token_name'] = 'csrf_test_name';
298   -$config['csrf_cookie_name'] = 'csrf_cookie_name';
299   -$config['csrf_expire'] = 7200;
300   -
301   -/*
302   -|--------------------------------------------------------------------------
303   -| Output Compression
304   -|--------------------------------------------------------------------------
305   -|
306   -| Enables Gzip output compression for faster page loads. When enabled,
307   -| the output class will test whether your server supports Gzip.
308   -| Even if it does, however, not all browsers support compression
309   -| so enable only if you are reasonably sure your visitors can handle it.
310   -|
311   -| VERY IMPORTANT: If you are getting a blank page when compression is enabled it
312   -| means you are prematurely outputting something to your browser. It could
313   -| even be a line of whitespace at the end of one of your scripts. For
314   -| compression to work, nothing can be sent before the output buffer is called
315   -| by the output class. Do not 'echo' any values with compression enabled.
316   -|
317   -*/
318   -$config['compress_output'] = FALSE;
319   -
320   -/*
321   -|--------------------------------------------------------------------------
322   -| Master Time Reference
323   -|--------------------------------------------------------------------------
324   -|
325   -| Options are 'local' or 'gmt'. This pref tells the system whether to use
326   -| your server's local time as the master 'now' reference, or convert it to
327   -| GMT. See the 'date helper' page of the user guide for information
328   -| regarding date handling.
329   -|
330   -*/
331   -$config['time_reference'] = 'local';
332   -
333   -
334   -/*
335   -|--------------------------------------------------------------------------
336   -| Rewrite PHP Short Tags
337   -|--------------------------------------------------------------------------
338   -|
339   -| If your PHP installation does not have short tag support enabled CI
340   -| can rewrite the tags on-the-fly, enabling you to utilize that syntax
341   -| in your view files. Options are TRUE or FALSE (boolean)
342   -|
343   -*/
344   -$config['rewrite_short_tags'] = FALSE;
345   -
346   -
347   -/*
348   -|--------------------------------------------------------------------------
349   -| Reverse Proxy IPs
350   -|--------------------------------------------------------------------------
351   -|
352   -| If your server is behind a reverse proxy, you must whitelist the proxy IP
353   -| addresses from which CodeIgniter should trust the HTTP_X_FORWARDED_FOR
354   -| header in order to properly identify the visitor's IP address.
355   -| Comma-delimited, e.g. '10.0.1.200,10.0.1.201'
356   -|
357   -*/
358   -$config['proxy_ips'] = '';
359   -
360   -
361   -/*
362   -|--------------------------------------------------------------------------
363   -| Modules Location Path
364   -|--------------------------------------------------------------------------
365   -|
366   -| Alias and path for every location of modules. First come first serve!
367   -|
368   -*/
369   -$config['modules_locations'] = array(
370   - APPPATH . 'modules/' => '../modules/',
371   - FCPATH . 'modules/' => '../../modules/'
372   - );
373   -
374   -
375   -/* End of file config.php */
376   -/* Location: ./application/config/production/config.php */
36 icf/core/ICF_Controller.php
@@ -193,14 +193,14 @@ function __construct()
193 193 // $this->load->helper();
194 194
195 195 // Let's make that non-HMVC portable, too
196   - if ( method_exists(&$this->router, 'fetch_module') )
  196 + if ( method_exists(array(&$this->router), 'fetch_module') )
197 197 {
198 198 // Assign the module name to a local variable
199 199 $this->_module = $this->router->fetch_module();
200 200 }
201 201
202 202 // Get the directory, if the controller is within a sub-directory
203   - if ( method_exists(&$this->router, 'format_directory') )
  203 + if ( method_exists(array(&$this->router), 'format_directory') )
204 204 {
205 205 // Assign the directory of the current controller as well
206 206 $this->_directory = $this->router->format_directory();
@@ -335,9 +335,12 @@ protected function _form_validate($role_group = FALSE)
335 335 *
336 336 * @access protected
337 337 *
338   - * @return void
  338 + * @param boolean $template_assign Whether to assign the table class
  339 + * to the template/view/layout as well (variable is named $table). Default = FALSE
  340 + *
  341 + * @return boolean
339 342 */
340   - protected function _load_table_lib()
  343 + protected function _load_table_lib($template_assign = FALSE)
341 344 {
342 345 // Load the table-library
343 346 $this->load->library('table');
@@ -346,7 +349,7 @@ protected function _load_table_lib()
346 349 $possible_locations = array();
347 350
348 351 // If we have HMVC-support, we will first look within our module's location
349   - if ( method_exists(&$this->router, 'fetch_module') )
  352 + if ( method_exists(array(&$this->router), 'fetch_module') )
350 353 {
351 354 // Make life easy and use the functions we get from the modules-helper
352 355 function_exists('modules_path') OR $this->load->helper('modules');
@@ -412,10 +415,29 @@ function_exists('modules_path') OR $this->load->helper('modules');
412 415 }
413 416 }
414 417
  418 + // Log a message that now suitable template was found
  419 + log_message(
  420 + 'debug',
  421 + 'ICF_Controller::' . $this->_class_name(TRUE) . ': Missing table template file for '
  422 + . ( $this->_module ? $this->_module . '/' : '' )
  423 + . ( $this->_directory ? $this->_directory . '/' : '' )
  424 + . $this->_controller
  425 + . '/'
  426 + . $this->_method
  427 + . '. Setting default table template.'
  428 + );
  429 +
415 430 // Set the default template according to the table-library
416 431 $this->table->set_template($this->table->_default_template());
417 432
418   - // Return an success indicator (because we at least loaded the basic-template)
  433 + // Also assign table-class to the template for easier access?
  434 + if ( $template_assign )
  435 + {
  436 + // Name it table
  437 + $this->template->set('table', array(&$this->table));
  438 + }
  439 +
  440 + // Return a success indicator (because at least we loaded the basic-template)
419 441 return TRUE;
420 442 }
421 443
@@ -434,7 +456,7 @@ function_exists('modules_path') OR $this->load->helper('modules');
434 456 */
435 457 protected function _class_name($ucfirst = FALSE)
436 458 {
437   - return ( $ucfirst ? ucfirst(get_class(&$this)) : get_class(&$this) );
  459 + return ( $ucfirst ? ucfirst(get_class(array(&$this))) : get_class(array(&$this)) );
438 460 }
439 461
440 462
34 icf/core/ICF_Model.php
@@ -368,7 +368,7 @@ public function __construct()
368 368 $this->load->database();
369 369
370 370 // Assign these variables for error displaying/logging
371   - if ( method_exists($this->router, 'fetch_module') )
  371 + if ( method_exists(array(&$this->router), 'fetch_module') )
372 372 {
373 373 $this->_module = $this->router->fetch_module();
374 374 }
@@ -814,6 +814,7 @@ public function order_by($field = '', $direction = 'ASC')
814 814 {
815 815 // Shift the direction for the primary key to its real field-name
816 816 $field[$this->_primary['field']] = $field['PRIMARY'];
  817 +
817 818 // Unset the old order so we won't produce errors
818 819 unset($field['PRIMARY']);
819 820 }
@@ -921,6 +922,7 @@ public function free_result()
921 922 */
922 923 public function form_dropdown()
923 924 {
  925 + // Define the default arguments
924 926 $default_args = array(
925 927 'input_name' => '',
926 928 'text' => '',
@@ -928,43 +930,51 @@ public function form_dropdown()
928 930 'args' => array()
929 931 );
930 932
  933 + // Grab all arguments
931 934 $args = prepare_arguments(func_get_args(), $default_args);
932 935
  936 + // Check we have all mandatory arguments
933 937 if ( empty($args['input_name']) && empty($args['text']) && empty($args['value']) && empty($args['args']))
934 938 {
935 939 return 'Wrong parameter count for ' . $this->_class_name(TRUE) . '::form_dropdown()';
936 940 }
937 941
  942 + // Check for a given input-name
938 943 if ( empty($args['input_name']) )
939 944 {
  945 + // None given
940 946 return 'No input name given';
941 947 }
942 948
  949 + // Used our handsome wrapper for the primary-key?
943 950 if ( strtoupper($args['input_name']) == 'PRIMARY' )
944 951 {
  952 + // Then replace it
945 953 $args['input_name'] = $this->_primary['field'];
946 954 }
947 955
  956 + // Check the value-argument
948 957 $args['value'] OR ( $args['value'] = $this->_primary['field'] );
949 958
  959 + // Check the text-argument
950 960 $args['text'] OR ( $args['text'] = $this->_primary['field']);
951 961
952 962 // Check if we are given correct arguments (only applies to 1 and 2 argument
953 963 // count
954 964 if ( empty($args['text']) && empty($args['value']) )
955 965 {
  966 + // We need both, text and value argument before we can procceed
956 967 return "No column for text or name given";
957 968 }
958 969
959 970 // Validate the given field is valid
960 971 $this->_has_field(array($args['text'], $args['value']));
961 972
  973 + // At least wha twill be used as value must be grabbed from the DB
962 974 $fields = array($args['value']);
963 975
964   - if ( $args['value'] != $args['text'] )
965   - {
966   - $fields[] = $args['text'];
967   - }
  976 + // Different text-argument? Then we will need to grab that one too
  977 + ( $args['value'] == $args['text'] ) OR ( $fields[] = $args['text'] );
968 978
969 979 // Select the given fields from the database
970 980 $rows = $this->get(array('fields' => $fields));
@@ -3025,9 +3035,9 @@ protected function _run_before($query_type = FALSE, &$data = array())
3025 3035 }
3026 3036
3027 3037 // If the method is given within our current class, call it
3028   - if ( method_exists(&$this, $method) )
  3038 + if ( method_exists(array(&$this), $method) )
3029 3039 {
3030   - $data = call_user_func_array(array(&$this, $method), array(&$data));
  3040 + $data = call_user_func_array(array(array(&$this), $method), array(&$data));
3031 3041 }
3032 3042 // Method doesn't exist? => Let's give the developer a nice error-message
3033 3043 else
@@ -3093,9 +3103,9 @@ protected function _run_after($query_type = FALSE, &$data = array(), $primary =
3093 3103 }
3094 3104
3095 3105 // If the method is given within our current class, call it
3096   - if ( method_exists(&$this, $method) )
  3106 + if ( method_exists(array(&$this), $method) )
3097 3107 {
3098   - $data = call_user_func_array(array(&$this, $method), array(&$data, $primary));
  3108 + $data = call_user_func_array(array(array(&$this), $method), array(&$data, $primary));
3099 3109 }
3100 3110 // Method doesn't exist? => Let's give the developer a nice error-message
3101 3111 else
@@ -3446,7 +3456,7 @@ protected function _unlock_table()
3446 3456 */
3447 3457 protected function _class_name($ucfirst = FALSE)
3448 3458 {
3449   - return ( $ucfirst ? ucfirst(get_class(&$this)) : get_class(&$this) );
  3459 + return ( $ucfirst ? ucfirst(get_class(array(&$this))) : get_class(array(&$this)) );
3450 3460 }
3451 3461
3452 3462
@@ -3507,9 +3517,9 @@ protected function _class_name($ucfirst = FALSE)
3507 3517 /*
3508 3518 public function __call($method, $args = array())
3509 3519 {
3510   - if ( method_exists(&$this->db, $method))
  3520 + if ( method_exists(array(&$this->db), $method))
3511 3521 {
3512   - return call_user_func_array(array(&$this->db, $method), $args);
  3522 + return call_user_func_array(array(array(&$this->db), $method), $args);
3513 3523 }
3514 3524 else
3515 3525 {
2  icf/core/Nested_set_Model.php
@@ -1699,8 +1699,10 @@ protected function _move_node(/* $node, $direction = FALSE */)
1699 1699 return FALSE;
1700 1700 }
1701 1701
  1702 + // Close the transactions
1702 1703 // $this->db->trans_complete();
1703 1704 //
  1705 +// // Transaction failure?
1704 1706 // if ($this->db->trans_status() === FALSE)
1705 1707 // {
1706 1708 // return FALSE;
76 icf/helpers/ICF_array_helper.php
@@ -219,51 +219,41 @@ function array_key_crop($array, $crop, $where = 'leading')
219 219 switch ($where)
220 220 {
221 221 case 'leading':
222   -// if ( $crop_length[0] > 0 )
  222 + foreach ( $array as $k => $v )
223 223 {
224   - foreach ( $array as $k => $v )
  224 + $new_k = preg_replace('/^' . $crop[0] . '/', '', $k, 1);
  225 +
  226 + $array[$new_k] = $v;
  227 +
  228 + if ( $new_k !== $k )
225 229 {
226   - $new_k = preg_replace('/^' . $crop[0] . '/', '', $k, 1);
227   -
228   - $array[$new_k] = $v;
229   -
230   - if ( $new_k !== $k )
231   - {
232   - unset($array[$k]);
233   - }
  230 + unset($array[$k]);
234 231 }
235   - }
236 232 break;
237 233
238 234 case 'trailing':
239   -// if ( $crop_length[1] > 0 )
240   - {
241 235 foreach ( $array as $k => $v )
  236 + {
  237 + $new_k = preg_replace('/' . $crop[1] . '$/', '', $k, 1);
  238 + $array[$new_k] = $v;
  239 +
  240 + if ( $new_k !== $k )
242 241 {
243   - $new_k = preg_replace('/' . $crop[1] . '$/', '', $k, 1);
244   - $array[$new_k] = $v;
245   -
246   - if ( $new_k !== $k )
247   - {
248   - unset($array[$k]);
249   - }
  242 + unset($array[$k]);
250 243 }
251 244 }
252 245 break;
253 246
254 247 case 'both':
255   -// if ( ( $crop_length[0] > 0 ) && ( $crop_length[1] > 0 ) )
  248 + foreach ( $array as $k => $v )
256 249 {
257   - foreach ( $array as $k => $v )
  250 + $new_k = preg_replace('/' . $crop[1] . '$/', '', preg_replace('/^' . $crop[0] . '/', '', $k, 1), 1);
  251 +
  252 + $array[$new_k] = $v;
  253 +
  254 + if ( $new_k !== $k )
258 255 {
259   - $new_k = preg_replace('/' . $crop[1] . '$/', '', preg_replace('/^' . $crop[0] . '/', '', $k, 1), 1);
260   -
261   - $array[$new_k] = $v;
262   -
263   - if ( $new_k !== $k )
264   - {
265   - unset($array[$k]);
266   - }
  256 + unset($array[$k]);
267 257 }
268 258 }
269 259 break;
@@ -312,6 +302,7 @@ function array_to_formselect()
312 302
313 303 // What we'll be looping over
314 304 $array = array_shift($args);
  305 +
315 306 // What we will use as values for the select field
316 307 $value = array_shift($args);
317 308
@@ -341,8 +332,10 @@ function array_to_formselect()
341 332
342 333 // What we'll be looping over
343 334 $array = array_shift($args);
  335 +
344 336 // The actual select-value when submitted
345 337 $key = array_shift($args);
  338 +
346 339 // What we will use as display-value for the select field
347 340 $value = array_shift($args);
348 341
@@ -399,29 +392,6 @@ function array_to_formselect()
399 392 {
400 393 function is_assoc_array(array $array = array(), $strict = FALSE)
401 394 {
402   -# ksort($array);
403   -
404   - # $keys = array_keys($array);
405   - /*
406   - foreach ( $keys as $k => $_key )
407   - {
408   - if ( ( $k !== $_key ) && ( ! is_string($_key)) )
409   - {
410   - return TRUE;
411   - }
412   - }
413   - */
414   -# function(&$v, &$k) {return is_string($v);}
415   -# array_walk($keys, create_function('$v, $k', is_string(v)));
416   -# $keys = array_map('is_string', $keys);
417   -
418   - /*
419   - if ( $strict )
420   - {
421   - return ( ! in_array(FALSE, array_map('is_string', array_keys($array))));
422   - }
423   - */
424   -
425 395 $result = in_array( ( ! $strict ), array_map('is_string', array_keys($array)));
426 396
427 397 return ( $strict ? ( ! $result ) : $result );

No commit comments for this range

Something went wrong with that request. Please try again.