@@ -644,8 +644,7 @@ discard block |
||
644 | 644 | if ($external_file !== '') |
645 | 645 | { |
646 | 646 | $this->_javascript_location = $external_file; |
647 | - } |
|
648 | - elseif ($this->CI->config->item('javascript_location') !== '') |
|
647 | + } elseif ($this->CI->config->item('javascript_location') !== '') |
|
649 | 648 | { |
650 | 649 | $this->_javascript_location = $this->CI->config->item('javascript_location'); |
651 | 650 | } |
@@ -653,12 +652,10 @@ discard block |
||
653 | 652 | if ($relative === TRUE OR strpos($external_file, 'http://') === 0 OR strpos($external_file, 'https://') === 0) |
654 | 653 | { |
655 | 654 | $str = $this->_open_script($external_file); |
656 | - } |
|
657 | - elseif (strpos($this->_javascript_location, 'http://') !== FALSE) |
|
655 | + } elseif (strpos($this->_javascript_location, 'http://') !== FALSE) |
|
658 | 656 | { |
659 | 657 | $str = $this->_open_script($this->_javascript_location.$external_file); |
660 | - } |
|
661 | - else |
|
658 | + } else |
|
662 | 659 | { |
663 | 660 | $str = $this->_open_script($this->CI->config->slash_item('base_url').$this->_javascript_location.$external_file); |
664 | 661 | } |
@@ -754,17 +751,14 @@ discard block |
||
754 | 751 | if (is_object($result)) |
755 | 752 | { |
756 | 753 | $json_result = is_callable(array($result, 'result_array')) ? $result->result_array() : (array) $result; |
757 | - } |
|
758 | - elseif (is_array($result)) |
|
754 | + } elseif (is_array($result)) |
|
759 | 755 | { |
760 | 756 | $json_result = $result; |
761 | - } |
|
762 | - else |
|
757 | + } else |
|
763 | 758 | { |
764 | 759 | return $this->_prep_args($result); |
765 | 760 | } |
766 | - } |
|
767 | - else |
|
761 | + } else |
|
768 | 762 | { |
769 | 763 | return 'null'; |
770 | 764 | } |
@@ -775,8 +769,7 @@ discard block |
||
775 | 769 | if ( ! is_array($json_result) && empty($json_result)) |
776 | 770 | { |
777 | 771 | show_error('Generate JSON Failed - Illegal key, value pair.'); |
778 | - } |
|
779 | - elseif ($match_array_type) |
|
772 | + } elseif ($match_array_type) |
|
780 | 773 | { |
781 | 774 | $_is_assoc = $this->_is_associative_array($json_result); |
782 | 775 | } |
@@ -786,8 +779,7 @@ discard block |
||
786 | 779 | if ($_is_assoc) |
787 | 780 | { |
788 | 781 | $json[] = $this->_prep_args($k, TRUE).':'.$this->generate_json($v, $match_array_type); |
789 | - } |
|
790 | - else |
|
782 | + } else |
|
791 | 783 | { |
792 | 784 | $json[] = $this->generate_json($v, $match_array_type); |
793 | 785 | } |
@@ -838,16 +830,13 @@ discard block |
||
838 | 830 | if ($result === NULL) |
839 | 831 | { |
840 | 832 | return 'null'; |
841 | - } |
|
842 | - elseif (is_bool($result)) |
|
833 | + } elseif (is_bool($result)) |
|
843 | 834 | { |
844 | 835 | return ($result === TRUE) ? 'true' : 'false'; |
845 | - } |
|
846 | - elseif (is_string($result) OR $is_key) |
|
836 | + } elseif (is_string($result) OR $is_key) |
|
847 | 837 | { |
848 | 838 | return '"'.str_replace(array('\\', "\t", "\n", "\r", '"', '/'), array('\\\\', '\\t', '\\n', "\\r", '\"', '\/'), $result).'"'; |
849 | - } |
|
850 | - elseif (is_scalar($result)) |
|
839 | + } elseif (is_scalar($result)) |
|
851 | 840 | { |
852 | 841 | return $result; |
853 | 842 | } |
@@ -735,8 +735,7 @@ discard block |
||
735 | 735 | if ($this->CI->config->item('javascript_ajax_img') === '') |
736 | 736 | { |
737 | 737 | $loading_notifier = 'Loading...'; |
738 | - } |
|
739 | - else |
|
738 | + } else |
|
740 | 739 | { |
741 | 740 | $loading_notifier = '<img src="'.$this->CI->config->slash_item('base_url').$this->CI->config->item('javascript_ajax_img').'" alt="Loading" />'; |
742 | 741 | } |
@@ -892,8 +891,7 @@ discard block |
||
892 | 891 | $sort_options[] = "\n\t\t".$k.': '.$v; |
893 | 892 | } |
894 | 893 | $sort_options = implode(',', $sort_options); |
895 | - } |
|
896 | - else |
|
894 | + } else |
|
897 | 895 | { |
898 | 896 | $sort_options = ''; |
899 | 897 | } |
@@ -1064,8 +1062,7 @@ discard block |
||
1064 | 1062 | if (in_array($speed, array('slow', 'normal', 'fast'))) |
1065 | 1063 | { |
1066 | 1064 | return '"'.$speed.'"'; |
1067 | - } |
|
1068 | - elseif (preg_match('/[^0-9]/', $speed)) |
|
1065 | + } elseif (preg_match('/[^0-9]/', $speed)) |
|
1069 | 1066 | { |
1070 | 1067 | return ''; |
1071 | 1068 | } |
@@ -201,8 +201,7 @@ discard block |
||
201 | 201 | if ($this->_migration_type === 'sequential') |
202 | 202 | { |
203 | 203 | $target_version = sprintf('%03d', $target_version); |
204 | - } |
|
205 | - else |
|
204 | + } else |
|
206 | 205 | { |
207 | 206 | $target_version = (string) $target_version; |
208 | 207 | } |
@@ -219,8 +218,7 @@ discard block |
||
219 | 218 | { |
220 | 219 | // Moving Up |
221 | 220 | $method = 'up'; |
222 | - } |
|
223 | - else |
|
221 | + } else |
|
224 | 222 | { |
225 | 223 | // Moving Down, apply in reverse order |
226 | 224 | $method = 'down'; |
@@ -430,8 +430,7 @@ discard block |
||
430 | 430 | |
431 | 431 | // Unset the controll, method, old-school routing options |
432 | 432 | unset($get['c'], $get['m'], $get[$this->query_string_segment]); |
433 | - } |
|
434 | - else |
|
433 | + } else |
|
435 | 434 | { |
436 | 435 | $get = array(); |
437 | 436 | } |
@@ -463,8 +462,7 @@ discard block |
||
463 | 462 | // Add the page segment to the end of the query string, where the |
464 | 463 | // page number will be appended. |
465 | 464 | $base_url .= $query_string_sep.http_build_query(array_merge($get, array($this->query_string_segment => ''))); |
466 | - } |
|
467 | - else |
|
465 | + } else |
|
468 | 466 | { |
469 | 467 | // Standard segment mode. |
470 | 468 | // Generate our saved query string to append later after the page number. |
@@ -496,8 +494,7 @@ discard block |
||
496 | 494 | if ($this->page_query_string === TRUE) |
497 | 495 | { |
498 | 496 | $this->cur_page = $this->CI->input->get($this->query_string_segment); |
499 | - } |
|
500 | - else |
|
497 | + } else |
|
501 | 498 | { |
502 | 499 | // Default to the last segment number if one hasn't been defined. |
503 | 500 | if ($this->uri_segment === 0) |
@@ -518,8 +515,7 @@ discard block |
||
518 | 515 | if ( ! ctype_digit($this->cur_page) OR ($this->use_page_numbers && (int) $this->cur_page === 0)) |
519 | 516 | { |
520 | 517 | $this->cur_page = $base_page; |
521 | - } |
|
522 | - else |
|
518 | + } else |
|
523 | 519 | { |
524 | 520 | // Make sure we're using integers for comparisons later. |
525 | 521 | $this->cur_page = (int) $this->cur_page; |
@@ -533,8 +529,7 @@ discard block |
||
533 | 529 | { |
534 | 530 | $this->cur_page = $num_pages; |
535 | 531 | } |
536 | - } |
|
537 | - elseif ($this->cur_page > $this->total_rows) |
|
532 | + } elseif ($this->cur_page > $this->total_rows) |
|
538 | 533 | { |
539 | 534 | $this->cur_page = ($num_pages - 1) * $this->per_page; |
540 | 535 | } |
@@ -578,8 +573,7 @@ discard block |
||
578 | 573 | // First page |
579 | 574 | $output .= $this->prev_tag_open.'<a href="'.$first_url.'"'.$attributes.$this->_attr_rel('prev').'>' |
580 | 575 | .$this->prev_link.'</a>'.$this->prev_tag_close; |
581 | - } |
|
582 | - else |
|
576 | + } else |
|
583 | 577 | { |
584 | 578 | $append = $this->prefix.$i.$this->suffix; |
585 | 579 | $output .= $this->prev_tag_open.'<a href="'.$base_url.$append.'"'.$attributes.$this->_attr_rel('prev').'>' |
@@ -604,14 +598,12 @@ discard block |
||
604 | 598 | { |
605 | 599 | // Current page |
606 | 600 | $output .= $this->cur_tag_open.$loop.$this->cur_tag_close; |
607 | - } |
|
608 | - elseif ($i === $base_page) |
|
601 | + } elseif ($i === $base_page) |
|
609 | 602 | { |
610 | 603 | // First page |
611 | 604 | $output .= $this->num_tag_open.'<a href="'.$first_url.'"'.$attributes.$this->_attr_rel('start').'>' |
612 | 605 | .$loop.'</a>'.$this->num_tag_close; |
613 | - } |
|
614 | - else |
|
606 | + } else |
|
615 | 607 | { |
616 | 608 | $append = $this->prefix.$i.$this->suffix; |
617 | 609 | $output .= $this->num_tag_open.'<a href="'.$base_url.$append.'"'.$attributes.'>' |
@@ -206,8 +206,7 @@ discard block |
||
206 | 206 | if ($cobject instanceof CI_DB) |
207 | 207 | { |
208 | 208 | $dbs[get_class($this->CI).':$'.$name] = $cobject; |
209 | - } |
|
210 | - elseif ($cobject instanceof CI_Model) |
|
209 | + } elseif ($cobject instanceof CI_Model) |
|
211 | 210 | { |
212 | 211 | foreach (get_object_vars($cobject) as $mname => $mobject) |
213 | 212 | { |
@@ -264,8 +263,7 @@ discard block |
||
264 | 263 | { |
265 | 264 | $output .= '<tr><td style="width:100%;color:#0000FF;font-weight:normal;background-color:#eee;padding:5px;">' |
266 | 265 | .$this->CI->lang->line('profiler_no_queries')."</td></tr>\n"; |
267 | - } |
|
268 | - else |
|
266 | + } else |
|
269 | 267 | { |
270 | 268 | foreach ($db->queries as $key => $val) |
271 | 269 | { |
@@ -307,8 +305,7 @@ discard block |
||
307 | 305 | if (count($_GET) === 0) |
308 | 306 | { |
309 | 307 | $output .= '<div style="color:#cd6e00;font-weight:normal;padding:4px 0 4px 0;">'.$this->CI->lang->line('profiler_no_get').'</div>'; |
310 | - } |
|
311 | - else |
|
308 | + } else |
|
312 | 309 | { |
313 | 310 | $output .= "\n\n<table style=\"width:100%;border:none;\">\n"; |
314 | 311 | |
@@ -345,8 +342,7 @@ discard block |
||
345 | 342 | if (count($_POST) === 0 && count($_FILES) === 0) |
346 | 343 | { |
347 | 344 | $output .= '<div style="color:#009900;font-weight:normal;padding:4px 0 4px 0;">'.$this->CI->lang->line('profiler_no_post').'</div>'; |
348 | - } |
|
349 | - else |
|
345 | + } else |
|
350 | 346 | { |
351 | 347 | $output .= "\n\n<table style=\"width:100%;\">\n"; |
352 | 348 | |
@@ -360,8 +356,7 @@ discard block |
||
360 | 356 | if (is_array($val) OR is_object($val)) |
361 | 357 | { |
362 | 358 | $output .= '<pre>'.htmlspecialchars(stripslashes(print_r($val, TRUE))).'</pre>'; |
363 | - } |
|
364 | - else |
|
359 | + } else |
|
365 | 360 | { |
366 | 361 | $output .= htmlspecialchars(stripslashes($val)); |
367 | 362 | } |
@@ -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 | } |
@@ -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 | } |