@@ -147,8 +147,7 @@ discard block |
||
| 147 | 147 | if ( ! is_array($val)) |
| 148 | 148 | { |
| 149 | 149 | $out .= $val; |
| 150 | - } |
|
| 151 | - else |
|
| 150 | + } else |
|
| 152 | 151 | { |
| 153 | 152 | $out .= $_last_list_item."\n"._list($type, $val, '', $depth + 4).str_repeat(' ', $depth + 2); |
| 154 | 153 | } |
@@ -197,13 +196,11 @@ discard block |
||
| 197 | 196 | if ($index_page === TRUE) |
| 198 | 197 | { |
| 199 | 198 | $img .= ' src="'.get_instance()->config->site_url($v).'"'; |
| 200 | - } |
|
| 201 | - else |
|
| 199 | + } else |
|
| 202 | 200 | { |
| 203 | 201 | $img .= ' src="'.get_instance()->config->slash_item('base_url').$v.'"'; |
| 204 | 202 | } |
| 205 | - } |
|
| 206 | - else |
|
| 203 | + } else |
|
| 207 | 204 | { |
| 208 | 205 | $img .= ' '.$k.'="'.$v.'"'; |
| 209 | 206 | } |
@@ -289,29 +286,24 @@ discard block |
||
| 289 | 286 | if ($index_page === TRUE) |
| 290 | 287 | { |
| 291 | 288 | $link .= 'href="'.$CI->config->site_url($v).'" '; |
| 292 | - } |
|
| 293 | - else |
|
| 289 | + } else |
|
| 294 | 290 | { |
| 295 | 291 | $link .= 'href="'.$CI->config->slash_item('base_url').$v.'" '; |
| 296 | 292 | } |
| 297 | - } |
|
| 298 | - else |
|
| 293 | + } else |
|
| 299 | 294 | { |
| 300 | 295 | $link .= $k.'="'.$v.'" '; |
| 301 | 296 | } |
| 302 | 297 | } |
| 303 | - } |
|
| 304 | - else |
|
| 298 | + } else |
|
| 305 | 299 | { |
| 306 | 300 | if (preg_match('#^([a-z]+:)?//#i', $href)) |
| 307 | 301 | { |
| 308 | 302 | $link .= 'href="'.$href.'" '; |
| 309 | - } |
|
| 310 | - elseif ($index_page === TRUE) |
|
| 303 | + } elseif ($index_page === TRUE) |
|
| 311 | 304 | { |
| 312 | 305 | $link .= 'href="'.$CI->config->site_url($href).'" '; |
| 313 | - } |
|
| 314 | - else |
|
| 306 | + } else |
|
| 315 | 307 | { |
| 316 | 308 | $link .= 'href="'.$CI->config->slash_item('base_url').$href.'" '; |
| 317 | 309 | } |
@@ -353,8 +345,7 @@ discard block |
||
| 353 | 345 | if ( ! is_array($name)) |
| 354 | 346 | { |
| 355 | 347 | $name = array(array('name' => $name, 'content' => $content, 'type' => $type, 'newline' => $newline)); |
| 356 | - } |
|
| 357 | - elseif (isset($name['name'])) |
|
| 348 | + } elseif (isset($name['name'])) |
|
| 358 | 349 | { |
| 359 | 350 | // Turn single array into multidimensional |
| 360 | 351 | $name = array($name); |
@@ -67,23 +67,19 @@ |
||
| 67 | 67 | { |
| 68 | 68 | $num = round($num / 1099511627776, $precision); |
| 69 | 69 | $unit = $CI->lang->line('terabyte_abbr'); |
| 70 | - } |
|
| 71 | - elseif ($num >= 1000000000) |
|
| 70 | + } elseif ($num >= 1000000000) |
|
| 72 | 71 | { |
| 73 | 72 | $num = round($num / 1073741824, $precision); |
| 74 | 73 | $unit = $CI->lang->line('gigabyte_abbr'); |
| 75 | - } |
|
| 76 | - elseif ($num >= 1000000) |
|
| 74 | + } elseif ($num >= 1000000) |
|
| 77 | 75 | { |
| 78 | 76 | $num = round($num / 1048576, $precision); |
| 79 | 77 | $unit = $CI->lang->line('megabyte_abbr'); |
| 80 | - } |
|
| 81 | - elseif ($num >= 1000) |
|
| 78 | + } elseif ($num >= 1000) |
|
| 82 | 79 | { |
| 83 | 80 | $num = round($num / 1024, $precision); |
| 84 | 81 | $unit = $CI->lang->line('kilobyte_abbr'); |
| 85 | - } |
|
| 86 | - else |
|
| 82 | + } else |
|
| 87 | 83 | { |
| 88 | 84 | $unit = $CI->lang->line('bytes'); |
| 89 | 85 | return number_format($num).' '.$unit; |
@@ -70,8 +70,7 @@ |
||
| 70 | 70 | if (realpath($path) !== FALSE) |
| 71 | 71 | { |
| 72 | 72 | $path = realpath($path); |
| 73 | - } |
|
| 74 | - elseif ($check_existance && ! is_dir($path) && ! is_file($path)) |
|
| 73 | + } elseif ($check_existance && ! is_dir($path) && ! is_file($path)) |
|
| 75 | 74 | { |
| 76 | 75 | show_error('Not a valid path: '.$path); |
| 77 | 76 | } |
@@ -117,8 +117,7 @@ discard block |
||
| 117 | 117 | } |
| 118 | 118 | } |
| 119 | 119 | EOF; |
| 120 | - } |
|
| 121 | - elseif (is_array($alias)) |
|
| 120 | + } elseif (is_array($alias)) |
|
| 122 | 121 | { |
| 123 | 122 | foreach ($alias as $name => $id) |
| 124 | 123 | { |
@@ -152,8 +151,7 @@ discard block |
||
| 152 | 151 | if (is_array($alias)) |
| 153 | 152 | { |
| 154 | 153 | $smileys = $alias; |
| 155 | - } |
|
| 156 | - elseif (FALSE === ($smileys = _get_smiley_array())) |
|
| 154 | + } elseif (FALSE === ($smileys = _get_smiley_array())) |
|
| 157 | 155 | { |
| 158 | 156 | return FALSE; |
| 159 | 157 | } |
@@ -155,8 +155,7 @@ discard block |
||
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | $out .= $str[$i]; |
| 158 | - } |
|
| 159 | - else |
|
| 158 | + } else |
|
| 160 | 159 | { |
| 161 | 160 | if (count($temp) === 0) |
| 162 | 161 | { |
@@ -213,12 +212,10 @@ discard block |
||
| 213 | 212 | { |
| 214 | 213 | $out .= chr($digits); |
| 215 | 214 | |
| 216 | - } |
|
| 217 | - elseif ($digits < 2048) |
|
| 215 | + } elseif ($digits < 2048) |
|
| 218 | 216 | { |
| 219 | 217 | $out .= chr(192 + (($digits - ($digits % 64)) / 64)).chr(128 + ($digits % 64)); |
| 220 | - } |
|
| 221 | - else |
|
| 218 | + } else |
|
| 222 | 219 | { |
| 223 | 220 | $out .= chr(224 + (($digits - ($digits % 4096)) / 4096)) |
| 224 | 221 | .chr(128 + ((($digits % 4096) - ($digits % 64)) / 64)) |
@@ -278,8 +275,7 @@ discard block |
||
| 278 | 275 | if ($replacement !== '') |
| 279 | 276 | { |
| 280 | 277 | $str = preg_replace("/({$delim})(".str_replace('\*', '\w*?', preg_quote($badword, '/')).")({$delim})/i", "\\1{$replacement}\\3", $str); |
| 281 | - } |
|
| 282 | - else |
|
| 278 | + } else |
|
| 283 | 279 | { |
| 284 | 280 | $str = preg_replace("/({$delim})(".str_replace('\*', '\w*?', preg_quote($badword, '/')).")({$delim})/ie", "'\\1'.str_repeat('#', strlen('\\2')).'\\3'", $str); |
| 285 | 281 | } |
@@ -486,8 +482,7 @@ discard block |
||
| 486 | 482 | if ($temp !== '') |
| 487 | 483 | { |
| 488 | 484 | $output .= $temp."\n".$line."\n"; |
| 489 | - } |
|
| 490 | - else |
|
| 485 | + } else |
|
| 491 | 486 | { |
| 492 | 487 | $output .= $line."\n"; |
| 493 | 488 | } |
@@ -538,8 +533,7 @@ discard block |
||
| 538 | 533 | if ($position === 1) |
| 539 | 534 | { |
| 540 | 535 | $end = mb_substr($str, 0, -($max_length - mb_strlen($beg))); |
| 541 | - } |
|
| 542 | - else |
|
| 536 | + } else |
|
| 543 | 537 | { |
| 544 | 538 | $end = mb_substr($str, -($max_length - mb_strlen($beg))); |
| 545 | 539 | } |
@@ -213,13 +213,11 @@ discard block |
||
| 213 | 213 | |
| 214 | 214 | // Ref: http://www.w3schools.com/jsref/met_win_open.asp |
| 215 | 215 | $window_name = '_blank'; |
| 216 | - } |
|
| 217 | - elseif ( ! empty($attributes['window_name'])) |
|
| 216 | + } elseif ( ! empty($attributes['window_name'])) |
|
| 218 | 217 | { |
| 219 | 218 | $window_name = $attributes['window_name']; |
| 220 | 219 | unset($attributes['window_name']); |
| 221 | - } |
|
| 222 | - else |
|
| 220 | + } else |
|
| 223 | 221 | { |
| 224 | 222 | $window_name = '_blank'; |
| 225 | 223 | } |
@@ -308,8 +306,7 @@ discard block |
||
| 308 | 306 | } |
| 309 | 307 | $x[] = '"'; |
| 310 | 308 | } |
| 311 | - } |
|
| 312 | - else |
|
| 309 | + } else |
|
| 313 | 310 | { |
| 314 | 311 | for ($i = 0, $l = strlen($attributes); $i < $l; $i++) |
| 315 | 312 | { |
@@ -328,8 +325,7 @@ discard block |
||
| 328 | 325 | if ($ordinal < 128) |
| 329 | 326 | { |
| 330 | 327 | $x[] = '|'.$ordinal; |
| 331 | - } |
|
| 332 | - else |
|
| 328 | + } else |
|
| 333 | 329 | { |
| 334 | 330 | if (count($temp) === 0) |
| 335 | 331 | { |
@@ -482,8 +478,7 @@ discard block |
||
| 482 | 478 | if ($separator === 'dash') |
| 483 | 479 | { |
| 484 | 480 | $separator = '-'; |
| 485 | - } |
|
| 486 | - elseif ($separator === 'underscore') |
|
| 481 | + } elseif ($separator === 'underscore') |
|
| 487 | 482 | { |
| 488 | 483 | $separator = '_'; |
| 489 | 484 | } |
@@ -540,16 +535,14 @@ discard block |
||
| 540 | 535 | if ($method === 'auto' && isset($_SERVER['SERVER_SOFTWARE']) && strpos($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS') !== FALSE) |
| 541 | 536 | { |
| 542 | 537 | $method = 'refresh'; |
| 543 | - } |
|
| 544 | - elseif ($method !== 'refresh' && (empty($code) OR ! is_numeric($code))) |
|
| 538 | + } elseif ($method !== 'refresh' && (empty($code) OR ! is_numeric($code))) |
|
| 545 | 539 | { |
| 546 | 540 | if (isset($_SERVER['SERVER_PROTOCOL'], $_SERVER['REQUEST_METHOD']) && $_SERVER['SERVER_PROTOCOL'] === 'HTTP/1.1') |
| 547 | 541 | { |
| 548 | 542 | $code = ($_SERVER['REQUEST_METHOD'] !== 'GET') |
| 549 | 543 | ? 303 // reference: http://en.wikipedia.org/wiki/Post/Redirect/Get |
| 550 | 544 | : 307; |
| 551 | - } |
|
| 552 | - else |
|
| 545 | + } else |
|
| 553 | 546 | { |
| 554 | 547 | $code = 302; |
| 555 | 548 | } |
@@ -139,8 +139,7 @@ discard block |
||
| 139 | 139 | if ($data === FALSE) |
| 140 | 140 | { |
| 141 | 141 | $data = array('data' => 0, 'ttl' => 60); |
| 142 | - } |
|
| 143 | - elseif ( ! is_int($data['data'])) |
|
| 142 | + } elseif ( ! is_int($data['data'])) |
|
| 144 | 143 | { |
| 145 | 144 | return FALSE; |
| 146 | 145 | } |
@@ -167,8 +166,7 @@ discard block |
||
| 167 | 166 | if ($data === FALSE) |
| 168 | 167 | { |
| 169 | 168 | $data = array('data' => 0, 'ttl' => 60); |
| 170 | - } |
|
| 171 | - elseif ( ! is_int($data['data'])) |
|
| 169 | + } elseif ( ! is_int($data['data'])) |
|
| 172 | 170 | { |
| 173 | 171 | return FALSE; |
| 174 | 172 | } |
@@ -99,12 +99,10 @@ discard block |
||
| 99 | 99 | if (class_exists('Memcached', FALSE)) |
| 100 | 100 | { |
| 101 | 101 | $this->_memcached = new Memcached(); |
| 102 | - } |
|
| 103 | - elseif (class_exists('Memcache', FALSE)) |
|
| 102 | + } elseif (class_exists('Memcache', FALSE)) |
|
| 104 | 103 | { |
| 105 | 104 | $this->_memcached = new Memcache(); |
| 106 | - } |
|
| 107 | - else |
|
| 105 | + } else |
|
| 108 | 106 | { |
| 109 | 107 | log_message('error', 'Cache: Failed to create Memcache(d) object; extension not loaded?'); |
| 110 | 108 | } |
@@ -124,8 +122,7 @@ discard block |
||
| 124 | 122 | TRUE, |
| 125 | 123 | $cache_server['weight'] |
| 126 | 124 | ); |
| 127 | - } |
|
| 128 | - else |
|
| 125 | + } else |
|
| 129 | 126 | { |
| 130 | 127 | $this->_memcached->addServer( |
| 131 | 128 | $cache_server['hostname'], |
@@ -172,8 +169,7 @@ discard block |
||
| 172 | 169 | if (get_class($this->_memcached) === 'Memcached') |
| 173 | 170 | { |
| 174 | 171 | return $this->_memcached->set($id, $data, $ttl); |
| 175 | - } |
|
| 176 | - elseif (get_class($this->_memcached) === 'Memcache') |
|
| 172 | + } elseif (get_class($this->_memcached) === 'Memcache') |
|
| 177 | 173 | { |
| 178 | 174 | return $this->_memcached->set($id, $data, 0, $ttl); |
| 179 | 175 | } |
@@ -107,8 +107,7 @@ discard block |
||
| 107 | 107 | if ($config['socket_type'] === 'unix') |
| 108 | 108 | { |
| 109 | 109 | $success = $this->_redis->connect($config['socket']); |
| 110 | - } |
|
| 111 | - else // tcp socket |
|
| 110 | + } else // tcp socket |
|
| 112 | 111 | { |
| 113 | 112 | $success = $this->_redis->connect($config['host'], $config['port'], $config['timeout']); |
| 114 | 113 | } |
@@ -122,8 +121,7 @@ discard block |
||
| 122 | 121 | { |
| 123 | 122 | log_message('error', 'Cache: Redis authentication failed.'); |
| 124 | 123 | } |
| 125 | - } |
|
| 126 | - catch (RedisException $e) |
|
| 124 | + } catch (RedisException $e) |
|
| 127 | 125 | { |
| 128 | 126 | log_message('error', 'Cache: Redis connection refused ('.$e->getMessage().')'); |
| 129 | 127 | } |
@@ -175,8 +173,7 @@ discard block |
||
| 175 | 173 | |
| 176 | 174 | isset($this->_serialized[$id]) OR $this->_serialized[$id] = TRUE; |
| 177 | 175 | $data = serialize($data); |
| 178 | - } |
|
| 179 | - elseif (isset($this->_serialized[$id])) |
|
| 176 | + } elseif (isset($this->_serialized[$id])) |
|
| 180 | 177 | { |
| 181 | 178 | $this->_serialized[$id] = NULL; |
| 182 | 179 | $this->_redis->sRemove('_ci_redis_serialized', $id); |