@@ -354,7 +354,7 @@ |
||
354 | 354 | } |
355 | 355 | } |
356 | 356 | |
357 | - $this->userdata =& $_SESSION; |
|
357 | + $this->userdata = & $_SESSION; |
|
358 | 358 | } |
359 | 359 | |
360 | 360 | // ------------------------------------------------------------------------ |
@@ -73,18 +73,15 @@ discard block |
||
73 | 73 | { |
74 | 74 | log_message('debug', 'Session: Initialization under CLI aborted.'); |
75 | 75 | return; |
76 | - } |
|
77 | - elseif ((bool) ini_get('session.auto_start')) |
|
76 | + } elseif ((bool) ini_get('session.auto_start')) |
|
78 | 77 | { |
79 | 78 | log_message('error', 'Session: session.auto_start is enabled in php.ini. Aborting.'); |
80 | 79 | return; |
81 | - } |
|
82 | - elseif ( ! empty($params['driver'])) |
|
80 | + } elseif ( ! empty($params['driver'])) |
|
83 | 81 | { |
84 | 82 | $this->_driver = $params['driver']; |
85 | 83 | unset($params['driver']); |
86 | - } |
|
87 | - elseif ($driver = config_item('sess_driver')) |
|
84 | + } elseif ($driver = config_item('sess_driver')) |
|
88 | 85 | { |
89 | 86 | $this->_driver = $driver; |
90 | 87 | } |
@@ -105,8 +102,7 @@ discard block |
||
105 | 102 | if (is_php('5.4')) |
106 | 103 | { |
107 | 104 | session_set_save_handler($class, TRUE); |
108 | - } |
|
109 | - else |
|
105 | + } else |
|
110 | 106 | { |
111 | 107 | session_set_save_handler( |
112 | 108 | array($class, 'open'), |
@@ -119,8 +115,7 @@ discard block |
||
119 | 115 | |
120 | 116 | register_shutdown_function('session_write_close'); |
121 | 117 | } |
122 | - } |
|
123 | - else |
|
118 | + } else |
|
124 | 119 | { |
125 | 120 | log_message('error', "Session: Driver '".$this->_driver."' doesn't implement SessionHandlerInterface. Aborting."); |
126 | 121 | return; |
@@ -147,8 +142,7 @@ discard block |
||
147 | 142 | if ( ! isset($_SESSION['__ci_last_regenerate'])) |
148 | 143 | { |
149 | 144 | $_SESSION['__ci_last_regenerate'] = time(); |
150 | - } |
|
151 | - elseif ($_SESSION['__ci_last_regenerate'] < (time() - $regenerate_time)) |
|
145 | + } elseif ($_SESSION['__ci_last_regenerate'] < (time() - $regenerate_time)) |
|
152 | 146 | { |
153 | 147 | $this->sess_regenerate((bool) config_item('sess_regenerate_destroy')); |
154 | 148 | } |
@@ -237,8 +231,7 @@ discard block |
||
237 | 231 | if (class_exists($prefix.$class, FALSE)) |
238 | 232 | { |
239 | 233 | return $prefix.$class; |
240 | - } |
|
241 | - else |
|
234 | + } else |
|
242 | 235 | { |
243 | 236 | log_message('debug', 'Session: '.$prefix.$class.".php found but it doesn't declare class ".$prefix.$class.'.'); |
244 | 237 | } |
@@ -264,8 +257,7 @@ discard block |
||
264 | 257 | if (isset($params['cookie_lifetime'])) |
265 | 258 | { |
266 | 259 | $params['cookie_lifetime'] = (int) $params['cookie_lifetime']; |
267 | - } |
|
268 | - else |
|
260 | + } else |
|
269 | 261 | { |
270 | 262 | $params['cookie_lifetime'] = ( ! isset($expiration) && config_item('sess_expire_on_close')) |
271 | 263 | ? 0 : (int) $expiration; |
@@ -275,8 +267,7 @@ discard block |
||
275 | 267 | if (empty($params['cookie_name'])) |
276 | 268 | { |
277 | 269 | $params['cookie_name'] = ini_get('session.name'); |
278 | - } |
|
279 | - else |
|
270 | + } else |
|
280 | 271 | { |
281 | 272 | ini_set('session.name', $params['cookie_name']); |
282 | 273 | } |
@@ -296,8 +287,7 @@ discard block |
||
296 | 287 | if (empty($expiration)) |
297 | 288 | { |
298 | 289 | $params['expiration'] = (int) ini_get('session.gc_maxlifetime'); |
299 | - } |
|
300 | - else |
|
290 | + } else |
|
301 | 291 | { |
302 | 292 | $params['expiration'] = (int) $expiration; |
303 | 293 | ini_set('session.gc_maxlifetime', $expiration); |
@@ -473,8 +463,7 @@ discard block |
||
473 | 463 | { |
474 | 464 | $k = $v; |
475 | 465 | $v = $ttl; |
476 | - } |
|
477 | - else |
|
466 | + } else |
|
478 | 467 | { |
479 | 468 | $v += time(); |
480 | 469 | } |
@@ -572,8 +561,7 @@ discard block |
||
572 | 561 | if (isset($_SESSION[$key])) |
573 | 562 | { |
574 | 563 | return $_SESSION[$key]; |
575 | - } |
|
576 | - elseif ($key === 'session_id') |
|
564 | + } elseif ($key === 'session_id') |
|
577 | 565 | { |
578 | 566 | return session_id(); |
579 | 567 | } |
@@ -654,8 +642,7 @@ discard block |
||
654 | 642 | if (isset($key)) |
655 | 643 | { |
656 | 644 | return isset($_SESSION[$key]) ? $_SESSION[$key] : NULL; |
657 | - } |
|
658 | - elseif (empty($_SESSION)) |
|
645 | + } elseif (empty($_SESSION)) |
|
659 | 646 | { |
660 | 647 | return array(); |
661 | 648 | } |
@@ -711,7 +711,6 @@ discard block |
||
711 | 711 | * |
712 | 712 | * Legacy CI_Session compatibility method |
713 | 713 | * |
714 | - * @param mixed $data Session data key(s) |
|
715 | 714 | * @return void |
716 | 715 | */ |
717 | 716 | public function unset_userdata($key) |
@@ -879,7 +878,6 @@ discard block |
||
879 | 878 | * |
880 | 879 | * Legacy CI_Session compatibility method |
881 | 880 | * |
882 | - * @param mixed $data Session data key(s) |
|
883 | 881 | * @return void |
884 | 882 | */ |
885 | 883 | public function unset_tempdata($key) |
@@ -1,40 +1,40 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * CodeIgniter |
|
4 | - * |
|
5 | - * An open source application development framework for PHP |
|
6 | - * |
|
7 | - * This content is released under the MIT License (MIT) |
|
8 | - * |
|
9 | - * Copyright (c) 2014 - 2015, British Columbia Institute of Technology |
|
10 | - * |
|
11 | - * Permission is hereby granted, free of charge, to any person obtaining a copy |
|
12 | - * of this software and associated documentation files (the "Software"), to deal |
|
13 | - * in the Software without restriction, including without limitation the rights |
|
14 | - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
15 | - * copies of the Software, and to permit persons to whom the Software is |
|
16 | - * furnished to do so, subject to the following conditions: |
|
17 | - * |
|
18 | - * The above copyright notice and this permission notice shall be included in |
|
19 | - * all copies or substantial portions of the Software. |
|
20 | - * |
|
21 | - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|
22 | - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|
23 | - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
|
24 | - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
|
25 | - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
|
26 | - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
|
27 | - * THE SOFTWARE. |
|
28 | - * |
|
29 | - * @package CodeIgniter |
|
30 | - * @author EllisLab Dev Team |
|
31 | - * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/) |
|
32 | - * @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/) |
|
33 | - * @license http://opensource.org/licenses/MIT MIT License |
|
34 | - * @link http://codeigniter.com |
|
35 | - * @since Version 3.0.0 |
|
36 | - * @filesource |
|
37 | - */ |
|
3 | + * CodeIgniter |
|
4 | + * |
|
5 | + * An open source application development framework for PHP |
|
6 | + * |
|
7 | + * This content is released under the MIT License (MIT) |
|
8 | + * |
|
9 | + * Copyright (c) 2014 - 2015, British Columbia Institute of Technology |
|
10 | + * |
|
11 | + * Permission is hereby granted, free of charge, to any person obtaining a copy |
|
12 | + * of this software and associated documentation files (the "Software"), to deal |
|
13 | + * in the Software without restriction, including without limitation the rights |
|
14 | + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
15 | + * copies of the Software, and to permit persons to whom the Software is |
|
16 | + * furnished to do so, subject to the following conditions: |
|
17 | + * |
|
18 | + * The above copyright notice and this permission notice shall be included in |
|
19 | + * all copies or substantial portions of the Software. |
|
20 | + * |
|
21 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|
22 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|
23 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
|
24 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
|
25 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
|
26 | + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
|
27 | + * THE SOFTWARE. |
|
28 | + * |
|
29 | + * @package CodeIgniter |
|
30 | + * @author EllisLab Dev Team |
|
31 | + * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/) |
|
32 | + * @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/) |
|
33 | + * @license http://opensource.org/licenses/MIT MIT License |
|
34 | + * @link http://codeigniter.com |
|
35 | + * @since Version 3.0.0 |
|
36 | + * @filesource |
|
37 | + */ |
|
38 | 38 | defined('BASEPATH') OR exit('No direct script access allowed'); |
39 | 39 | |
40 | 40 | /** |
@@ -84,7 +84,7 @@ |
||
84 | 84 | */ |
85 | 85 | public function __construct(&$params) |
86 | 86 | { |
87 | - $this->_config =& $params; |
|
87 | + $this->_config = & $params; |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | // ------------------------------------------------------------------------ |
@@ -81,7 +81,7 @@ |
||
81 | 81 | { |
82 | 82 | parent::__construct($params); |
83 | 83 | |
84 | - $CI =& get_instance(); |
|
84 | + $CI = & get_instance(); |
|
85 | 85 | isset($CI->db) OR $CI->load->database(); |
86 | 86 | $this->_db = $CI->db; |
87 | 87 |
@@ -88,12 +88,10 @@ discard block |
||
88 | 88 | if ( ! $this->_db instanceof CI_DB_query_builder) |
89 | 89 | { |
90 | 90 | throw new Exception('Query Builder not enabled for the configured database. Aborting.'); |
91 | - } |
|
92 | - elseif ($this->_db->pconnect) |
|
91 | + } elseif ($this->_db->pconnect) |
|
93 | 92 | { |
94 | 93 | throw new Exception('Configured database connection is persistent. Aborting.'); |
95 | - } |
|
96 | - elseif ($this->_db->cache_on) |
|
94 | + } elseif ($this->_db->cache_on) |
|
97 | 95 | { |
98 | 96 | throw new Exception('Configured database connection has cache enabled. Aborting.'); |
99 | 97 | } |
@@ -102,8 +100,7 @@ discard block |
||
102 | 100 | if (strpos($db_driver, 'mysql') !== FALSE) |
103 | 101 | { |
104 | 102 | $this->_platform = 'mysql'; |
105 | - } |
|
106 | - elseif (in_array($db_driver, array('postgre', 'pdo_pgsql'), TRUE)) |
|
103 | + } elseif (in_array($db_driver, array('postgre', 'pdo_pgsql'), TRUE)) |
|
107 | 104 | { |
108 | 105 | $this->_platform = 'postgre'; |
109 | 106 | } |
@@ -206,8 +203,7 @@ discard block |
||
206 | 203 | |
207 | 204 | $this->_row_exists = FALSE; |
208 | 205 | $this->_session_id = $session_id; |
209 | - } |
|
210 | - elseif ($this->_lock === FALSE) |
|
206 | + } elseif ($this->_lock === FALSE) |
|
211 | 207 | { |
212 | 208 | return FALSE; |
213 | 209 | } |
@@ -334,8 +330,7 @@ discard block |
||
334 | 330 | } |
335 | 331 | |
336 | 332 | return FALSE; |
337 | - } |
|
338 | - elseif ($this->_platform === 'postgre') |
|
333 | + } elseif ($this->_platform === 'postgre') |
|
339 | 334 | { |
340 | 335 | $arg = "hashtext('".$session_id."')".($this->_config['match_ip'] ? ", hashtext('".$_SERVER['REMOTE_ADDR']."')" : ''); |
341 | 336 | if ($this->_db->simple_query('SELECT pg_advisory_lock('.$arg.')')) |
@@ -375,8 +370,7 @@ discard block |
||
375 | 370 | } |
376 | 371 | |
377 | 372 | return FALSE; |
378 | - } |
|
379 | - elseif ($this->_platform === 'postgre') |
|
373 | + } elseif ($this->_platform === 'postgre') |
|
380 | 374 | { |
381 | 375 | if ($this->_db->simple_query('SELECT pg_advisory_unlock('.$this->_lock.')')) |
382 | 376 | { |
@@ -92,8 +92,7 @@ discard block |
||
92 | 92 | { |
93 | 93 | $this->_config['save_path'] = rtrim($this->_config['save_path'], '/\\'); |
94 | 94 | ini_set('session.save_path', $this->_config['save_path']); |
95 | - } |
|
96 | - else |
|
95 | + } else |
|
97 | 96 | { |
98 | 97 | $this->_config['save_path'] = rtrim(ini_get('session.save_path'), '/\\'); |
99 | 98 | } |
@@ -118,8 +117,7 @@ discard block |
||
118 | 117 | { |
119 | 118 | throw new Exception("Session: Configured save path '".$this->_config['save_path']."' is not a directory, doesn't exist or cannot be created."); |
120 | 119 | } |
121 | - } |
|
122 | - elseif ( ! is_writable($save_path)) |
|
120 | + } elseif ( ! is_writable($save_path)) |
|
123 | 121 | { |
124 | 122 | throw new Exception("Session: Configured save path '".$this->_config['save_path']."' is not writable by the PHP process."); |
125 | 123 | } |
@@ -158,8 +156,7 @@ discard block |
||
158 | 156 | log_message('error', "Session: File '".$this->_file_path.$session_id."' doesn't exist and cannot be created."); |
159 | 157 | return FALSE; |
160 | 158 | } |
161 | - } |
|
162 | - elseif (($this->_file_handle = fopen($this->_file_path.$session_id, 'r+b')) === FALSE) |
|
159 | + } elseif (($this->_file_handle = fopen($this->_file_path.$session_id, 'r+b')) === FALSE) |
|
163 | 160 | { |
164 | 161 | log_message('error', "Session: Unable to open file '".$this->_file_path.$session_id."'."); |
165 | 162 | return FALSE; |
@@ -188,8 +185,7 @@ discard block |
||
188 | 185 | elseif ($this->_file_handler === FALSE) |
189 | 186 | { |
190 | 187 | return FALSE; |
191 | - } |
|
192 | - else |
|
188 | + } else |
|
193 | 189 | { |
194 | 190 | rewind($this->_file_handle); |
195 | 191 | } |
@@ -232,8 +228,7 @@ discard block |
||
232 | 228 | if ( ! is_resource($this->_file_handle)) |
233 | 229 | { |
234 | 230 | return FALSE; |
235 | - } |
|
236 | - elseif ($this->_fingerprint === md5($session_data)) |
|
231 | + } elseif ($this->_fingerprint === md5($session_data)) |
|
237 | 232 | { |
238 | 233 | return ($this->_file_new) |
239 | 234 | ? TRUE |
@@ -308,8 +303,7 @@ discard block |
||
308 | 303 | return file_exists($this->_file_path.$session_id) |
309 | 304 | ? (unlink($this->_file_path.$session_id) && $this->_cookie_destroy()) |
310 | 305 | : TRUE; |
311 | - } |
|
312 | - elseif ($this->_file_path !== NULL) |
|
306 | + } elseif ($this->_file_path !== NULL) |
|
313 | 307 | { |
314 | 308 | clearstatcache(); |
315 | 309 | return file_exists($this->_file_path.$session_id) |
@@ -84,8 +84,7 @@ discard block |
||
84 | 84 | if (empty($this->_config['save_path'])) |
85 | 85 | { |
86 | 86 | log_message('error', 'Session: No Redis save path configured.'); |
87 | - } |
|
88 | - elseif (preg_match('#(?:tcp://)?([^:?]+)(?:\:(\d+))?(\?.+)?#', $this->_config['save_path'], $matches)) |
|
87 | + } elseif (preg_match('#(?:tcp://)?([^:?]+)(?:\:(\d+))?(\?.+)?#', $this->_config['save_path'], $matches)) |
|
89 | 88 | { |
90 | 89 | isset($matches[3]) OR $matches[3] = ''; // Just to avoid undefined index notices below |
91 | 90 | $this->_config['save_path'] = array( |
@@ -97,8 +96,7 @@ discard block |
||
97 | 96 | ); |
98 | 97 | |
99 | 98 | preg_match('#prefix=([^\s&]+)#', $matches[3], $match) && $this->_key_prefix = $match[1]; |
100 | - } |
|
101 | - else |
|
99 | + } else |
|
102 | 100 | { |
103 | 101 | log_message('error', 'Session: Invalid Redis save path format: '.$this->_config['save_path']); |
104 | 102 | } |
@@ -131,16 +129,13 @@ discard block |
||
131 | 129 | if ( ! $redis->connect($this->_config['save_path']['host'], $this->_config['save_path']['port'], $this->_config['save_path']['timeout'])) |
132 | 130 | { |
133 | 131 | log_message('error', 'Session: Unable to connect to Redis with the configured settings.'); |
134 | - } |
|
135 | - elseif (isset($this->_config['save_path']['password']) && ! $redis->auth($this->_config['save_path']['password'])) |
|
132 | + } elseif (isset($this->_config['save_path']['password']) && ! $redis->auth($this->_config['save_path']['password'])) |
|
136 | 133 | { |
137 | 134 | log_message('error', 'Session: Unable to authenticate to Redis instance.'); |
138 | - } |
|
139 | - elseif (isset($this->_config['save_path']['database']) && ! $redis->select($this->_config['save_path']['database'])) |
|
135 | + } elseif (isset($this->_config['save_path']['database']) && ! $redis->select($this->_config['save_path']['database'])) |
|
140 | 136 | { |
141 | 137 | log_message('error', 'Session: Unable to select Redis database with index '.$this->_config['save_path']['database']); |
142 | - } |
|
143 | - else |
|
138 | + } else |
|
144 | 139 | { |
145 | 140 | $this->_redis = $redis; |
146 | 141 | return TRUE; |
@@ -245,8 +240,7 @@ discard block |
||
245 | 240 | return FALSE; |
246 | 241 | } |
247 | 242 | } |
248 | - } |
|
249 | - catch (RedisException $e) |
|
243 | + } catch (RedisException $e) |
|
250 | 244 | { |
251 | 245 | log_message('error', 'Session: Got RedisException on close(): '.$e->getMessage()); |
252 | 246 | } |
@@ -342,8 +336,7 @@ discard block |
||
342 | 336 | { |
343 | 337 | log_message('error', 'Session: Unable to obtain lock for '.$this->_key_prefix.$session_id.' after 30 attempts, aborting.'); |
344 | 338 | return FALSE; |
345 | - } |
|
346 | - elseif ($ttl === -1) |
|
339 | + } elseif ($ttl === -1) |
|
347 | 340 | { |
348 | 341 | log_message('debug', 'Session: Lock for '.$this->_key_prefix.$session_id.' had no TTL, overriding.'); |
349 | 342 | } |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | * |
61 | 61 | * @var string |
62 | 62 | */ |
63 | - public $skip_elements = 'p|pre|ol|ul|dl|object|table|h\d'; |
|
63 | + public $skip_elements = 'p|pre|ol|ul|dl|object|table|h\d'; |
|
64 | 64 | |
65 | 65 | /** |
66 | 66 | * Tags we want the parser to completely ignore when splitting the string. |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | * Etc... |
168 | 168 | * } |
169 | 169 | */ |
170 | - $chunks = preg_split('/(<(?:[^<>]+(?:"[^"]*"|\'[^\']*\')?)+>)/', $str, -1, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY); |
|
170 | + $chunks = preg_split('/(<(?:[^<>]+(?:"[^"]*"|\'[^\']*\')?)+>)/', $str, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); |
|
171 | 171 | |
172 | 172 | // Build our finalized string. We cycle through the array, skipping tags, and processing the contained text |
173 | 173 | $str = ''; |
@@ -372,7 +372,7 @@ discard block |
||
372 | 372 | // We trim off the right-side new line so that the closing </p> tag |
373 | 373 | // will be positioned immediately following the string, matching |
374 | 374 | // the behavior of the opening <p> tag |
375 | - $str = '<p>'.rtrim($str).'</p>'; |
|
375 | + $str = '<p>'.rtrim($str).'</p>'; |
|
376 | 376 | } |
377 | 377 | |
378 | 378 | // Remove empty paragraphs if they are on the first line, as this |
@@ -395,7 +395,7 @@ discard block |
||
395 | 395 | */ |
396 | 396 | protected function _protect_characters($match) |
397 | 397 | { |
398 | - return str_replace(array("'",'"','--',' '), array('{@SQ}', '{@DQ}', '{@DD}', '{@NBS}'), $match[0]); |
|
398 | + return str_replace(array("'", '"', '--', ' '), array('{@SQ}', '{@DQ}', '{@DD}', '{@NBS}'), $match[0]); |
|
399 | 399 | } |
400 | 400 | |
401 | 401 | // -------------------------------------------------------------------- |
@@ -266,8 +266,7 @@ |
||
266 | 266 | if ($reduce_linebreaks === TRUE) |
267 | 267 | { |
268 | 268 | $table['#<p>\n*</p>#'] = ''; |
269 | - } |
|
270 | - else |
|
269 | + } else |
|
271 | 270 | { |
272 | 271 | // If we have empty paragraph tags we add a non-breaking space |
273 | 272 | // otherwise most browsers won't treat them as true paragraphs |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | * |
93 | 93 | * @var array |
94 | 94 | */ |
95 | - protected $_test_items_visible = array( |
|
95 | + protected $_test_items_visible = array( |
|
96 | 96 | 'test_name', |
97 | 97 | 'test_datatype', |
98 | 98 | 'res_datatype', |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | |
167 | 167 | $back = $this->_backtrace(); |
168 | 168 | |
169 | - $report = array ( |
|
169 | + $report = array( |
|
170 | 170 | 'test_name' => $test_name, |
171 | 171 | 'test_datatype' => gettype($test), |
172 | 172 | 'res_datatype' => $extype, |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | $result = $this->result(); |
199 | 199 | } |
200 | 200 | |
201 | - $CI =& get_instance(); |
|
201 | + $CI = & get_instance(); |
|
202 | 202 | $CI->load->language('unit_test'); |
203 | 203 | |
204 | 204 | $this->_parse_template(); |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | */ |
274 | 274 | public function result($results = array()) |
275 | 275 | { |
276 | - $CI =& get_instance(); |
|
276 | + $CI = & get_instance(); |
|
277 | 277 | $CI->load->language('unit_test'); |
278 | 278 | |
279 | 279 | if (count($results) === 0) |
@@ -157,8 +157,7 @@ discard block |
||
157 | 157 | $expected = str_replace('is_double', 'is_float', $expected); |
158 | 158 | $result = $expected($test); |
159 | 159 | $extype = str_replace(array('true', 'false'), 'bool', str_replace('is_', '', $expected)); |
160 | - } |
|
161 | - else |
|
160 | + } else |
|
162 | 161 | { |
163 | 162 | $result = ($this->strict === TRUE) ? ($test === $expected) : ($test == $expected); |
164 | 163 | $extype = gettype($expected); |
@@ -215,8 +214,7 @@ discard block |
||
215 | 214 | if ($val === $CI->lang->line('ut_passed')) |
216 | 215 | { |
217 | 216 | $val = '<span style="color: #0C0;">'.$val.'</span>'; |
218 | - } |
|
219 | - elseif ($val === $CI->lang->line('ut_failed')) |
|
217 | + } elseif ($val === $CI->lang->line('ut_failed')) |
|
220 | 218 | { |
221 | 219 | $val = '<span style="color: #C00;">'.$val.'</span>'; |
222 | 220 | } |
@@ -290,8 +288,7 @@ discard block |
||
290 | 288 | if ( ! in_array($key, $this->_test_items_visible)) |
291 | 289 | { |
292 | 290 | continue; |
293 | - } |
|
294 | - elseif (in_array($key, array('test_name', 'test_datatype', 'test_res_datatype', 'result'), TRUE)) |
|
291 | + } elseif (in_array($key, array('test_name', 'test_datatype', 'test_res_datatype', 'result'), TRUE)) |
|
295 | 292 | { |
296 | 293 | if (FALSE !== ($line = $CI->lang->line(strtolower('ut_'.$val), FALSE))) |
297 | 294 | { |
@@ -16,10 +16,10 @@ |
||
16 | 16 | |
17 | 17 | <ul class="nav navbar-nav navbar-right"> |
18 | 18 | <li> |
19 | - <?php if (! empty($_SESSION['logged_in']) ) : ?> |
|
20 | - <a href="<?= site_url( \Myth\Route::named('logout') ) ?>">Logout</a> |
|
19 | + <?php if ( ! empty($_SESSION['logged_in'])) : ?> |
|
20 | + <a href="<?= site_url(\Myth\Route::named('logout')) ?>">Logout</a> |
|
21 | 21 | <?php else : ?> |
22 | - <a href="<?= site_url( \Myth\Route::named('login') ) ?>">Login</a> |
|
22 | + <a href="<?= site_url(\Myth\Route::named('login')) ?>">Login</a> |
|
23 | 23 | <?php endif; ?> |
24 | 24 | </li> |
25 | 25 | </ul> |
@@ -18,9 +18,12 @@ |
||
18 | 18 | <li> |
19 | 19 | <?php if (! empty($_SESSION['logged_in']) ) : ?> |
20 | 20 | <a href="<?= site_url( \Myth\Route::named('logout') ) ?>">Logout</a> |
21 | - <?php else : ?> |
|
21 | + <?php else { |
|
22 | + : ?> |
|
22 | 23 | <a href="<?= site_url( \Myth\Route::named('login') ) ?>">Login</a> |
23 | - <?php endif; ?> |
|
24 | + <?php endif; |
|
25 | +} |
|
26 | +?> |
|
24 | 27 | </li> |
25 | 28 | </ul> |
26 | 29 | </div> |
@@ -1,10 +1,10 @@ |
||
1 | 1 | <?php |
2 | - if (empty($navbar_style)) $themer->set('navbar_style', 'navbar-static'); |
|
3 | - if (empty($containerClass)) |
|
4 | - { |
|
5 | - $themer->set('containerClass', 'container'); |
|
6 | - $containerClass = 'container'; |
|
7 | - } |
|
2 | + if (empty($navbar_style)) $themer->set('navbar_style', 'navbar-static'); |
|
3 | + if (empty($containerClass)) |
|
4 | + { |
|
5 | + $themer->set('containerClass', 'container'); |
|
6 | + $containerClass = 'container'; |
|
7 | + } |
|
8 | 8 | ?> |
9 | 9 | |
10 | 10 | <?= $themer->display('bootstrap:fragments/head') ?> |
@@ -1,5 +1,7 @@ |
||
1 | 1 | <?php |
2 | - if (empty($navbar_style)) $themer->set('navbar_style', 'navbar-static'); |
|
2 | + if (empty($navbar_style)) { |
|
3 | + $themer->set('navbar_style', 'navbar-static'); |
|
4 | + } |
|
3 | 5 | if (empty($containerClass)) |
4 | 6 | { |
5 | 7 | $themer->set('containerClass', 'container'); |