@@ -79,8 +79,7 @@ discard block |
||
| 79 | 79 | if ( $quiet === false ) |
| 80 | 80 | { |
| 81 | 81 | $this->collectOptions( $name, $options ); |
| 82 | - } |
|
| 83 | - else |
|
| 82 | + } else |
|
| 84 | 83 | { |
| 85 | 84 | $this->quietSetOptions( $name, $options ); |
| 86 | 85 | } |
@@ -219,8 +218,7 @@ discard block |
||
| 219 | 218 | } |
| 220 | 219 | |
| 221 | 220 | $fields = $this->parseFieldString($options['fields']); |
| 222 | - } |
|
| 223 | - else |
|
| 221 | + } else |
|
| 224 | 222 | { |
| 225 | 223 | $fields = $this->db->field_data( $table_name ); |
| 226 | 224 | } |
@@ -169,12 +169,10 @@ discard block |
||
| 169 | 169 | file_exists(APPPATH.'vendor/autoload.php') |
| 170 | 170 | ? require_once(APPPATH.'vendor/autoload.php') |
| 171 | 171 | : log_message('error', '$config[\'composer_autoload\'] is set to TRUE but '.APPPATH.'vendor/autoload.php was not found.'); |
| 172 | - } |
|
| 173 | - elseif (file_exists($composer_autoload)) |
|
| 172 | + } elseif (file_exists($composer_autoload)) |
|
| 174 | 173 | { |
| 175 | 174 | require_once($composer_autoload); |
| 176 | - } |
|
| 177 | - else |
|
| 175 | + } else |
|
| 178 | 176 | { |
| 179 | 177 | log_message('error', 'Could not find the specified $config[\'composer_autoload\'] path: '.$composer_autoload); |
| 180 | 178 | } |
@@ -250,8 +248,7 @@ discard block |
||
| 250 | 248 | // This is required for mb_convert_encoding() to strip invalid characters. |
| 251 | 249 | // That's utilized by CI_Utf8, but it's also done for consistency with iconv. |
| 252 | 250 | mb_substitute_character('none'); |
| 253 | - } |
|
| 254 | - else |
|
| 251 | + } else |
|
| 255 | 252 | { |
| 256 | 253 | define('MB_ENABLED', FALSE); |
| 257 | 254 | } |
@@ -264,8 +261,7 @@ discard block |
||
| 264 | 261 | // iconv.internal_encoding is deprecated starting with PHP 5.6 |
| 265 | 262 | // and it's usage triggers E_DEPRECATED messages. |
| 266 | 263 | @ini_set('iconv.internal_encoding', $charset); |
| 267 | - } |
|
| 268 | - else |
|
| 264 | + } else |
|
| 269 | 265 | { |
| 270 | 266 | define('ICONV_ENABLED', FALSE); |
| 271 | 267 | } |
@@ -402,16 +398,14 @@ discard block |
||
| 402 | 398 | if (empty($class) OR ! file_exists(APPPATH.'controllers/'.$RTR->directory.$class.'.php')) |
| 403 | 399 | { |
| 404 | 400 | $e404 = TRUE; |
| 405 | - } |
|
| 406 | - else |
|
| 401 | + } else |
|
| 407 | 402 | { |
| 408 | 403 | require_once(APPPATH.'controllers/'.$RTR->directory.$class.'.php'); |
| 409 | 404 | |
| 410 | 405 | if ( ! class_exists($class, FALSE) OR $method[0] === '_' OR method_exists('CI_Controller', $method)) |
| 411 | 406 | { |
| 412 | 407 | $e404 = TRUE; |
| 413 | - } |
|
| 414 | - elseif (method_exists($class, '_remap')) |
|
| 408 | + } elseif (method_exists($class, '_remap')) |
|
| 415 | 409 | { |
| 416 | 410 | $params = array($method, array_slice($URI->rsegments, 2)); |
| 417 | 411 | $method = '_remap'; |
@@ -453,8 +447,7 @@ discard block |
||
| 453 | 447 | $RTR->directory = ''; |
| 454 | 448 | } |
| 455 | 449 | } |
| 456 | - } |
|
| 457 | - else |
|
| 450 | + } else |
|
| 458 | 451 | { |
| 459 | 452 | $e404 = FALSE; |
| 460 | 453 | } |
@@ -470,8 +463,7 @@ discard block |
||
| 470 | 463 | 1 => $class, |
| 471 | 464 | 2 => $method |
| 472 | 465 | ); |
| 473 | - } |
|
| 474 | - else |
|
| 466 | + } else |
|
| 475 | 467 | { |
| 476 | 468 | show_404($RTR->directory.$class.'/'.$method); |
| 477 | 469 | } |
@@ -111,8 +111,7 @@ discard block |
||
| 111 | 111 | @chmod($file, 0777); |
| 112 | 112 | @unlink($file); |
| 113 | 113 | return TRUE; |
| 114 | - } |
|
| 115 | - elseif ( ! is_file($file) OR ($fp = @fopen($file, 'ab')) === FALSE) |
|
| 114 | + } elseif ( ! is_file($file) OR ($fp = @fopen($file, 'ab')) === FALSE) |
|
| 116 | 115 | { |
| 117 | 116 | return FALSE; |
| 118 | 117 | } |
@@ -253,8 +252,7 @@ discard block |
||
| 253 | 252 | if (file_exists($file_path = APPPATH.'config/'.ENVIRONMENT.'/config.php')) |
| 254 | 253 | { |
| 255 | 254 | require($file_path); |
| 256 | - } |
|
| 257 | - elseif ( ! $found) |
|
| 255 | + } elseif ( ! $found) |
|
| 258 | 256 | { |
| 259 | 257 | set_status_header(503); |
| 260 | 258 | echo 'The configuration file does not exist.'; |
@@ -322,12 +320,10 @@ discard block |
||
| 322 | 320 | if (file_exists(APPPATH.'config/'.ENVIRONMENT.'/mimes.php')) |
| 323 | 321 | { |
| 324 | 322 | $_mimes = include(APPPATH.'config/'.ENVIRONMENT.'/mimes.php'); |
| 325 | - } |
|
| 326 | - elseif (file_exists(APPPATH.'config/mimes.php')) |
|
| 323 | + } elseif (file_exists(APPPATH.'config/mimes.php')) |
|
| 327 | 324 | { |
| 328 | 325 | $_mimes = include(APPPATH.'config/mimes.php'); |
| 329 | - } |
|
| 330 | - else |
|
| 326 | + } else |
|
| 331 | 327 | { |
| 332 | 328 | $_mimes = array(); |
| 333 | 329 | } |
@@ -354,12 +350,10 @@ discard block |
||
| 354 | 350 | if ( ! empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) !== 'off') |
| 355 | 351 | { |
| 356 | 352 | return TRUE; |
| 357 | - } |
|
| 358 | - elseif (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') |
|
| 353 | + } elseif (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') |
|
| 359 | 354 | { |
| 360 | 355 | return TRUE; |
| 361 | - } |
|
| 362 | - elseif ( ! empty($_SERVER['HTTP_FRONT_END_HTTPS']) && strtolower($_SERVER['HTTP_FRONT_END_HTTPS']) !== 'off') |
|
| 356 | + } elseif ( ! empty($_SERVER['HTTP_FRONT_END_HTTPS']) && strtolower($_SERVER['HTTP_FRONT_END_HTTPS']) !== 'off') |
|
| 363 | 357 | { |
| 364 | 358 | return TRUE; |
| 365 | 359 | } |
@@ -410,14 +404,16 @@ discard block |
||
| 410 | 404 | if ($status_code < 100) |
| 411 | 405 | { |
| 412 | 406 | $exit_status = $status_code + 9; // 9 is EXIT__AUTO_MIN |
| 413 | - if ($exit_status > 125) // 125 is EXIT__AUTO_MAX |
|
| 407 | + if ($exit_status > 125) { |
|
| 408 | + // 125 is EXIT__AUTO_MAX |
|
| 414 | 409 | { |
| 415 | - $exit_status = 1; // EXIT_ERROR |
|
| 410 | + $exit_status = 1; |
|
| 411 | + } |
|
| 412 | + // EXIT_ERROR |
|
| 416 | 413 | } |
| 417 | 414 | |
| 418 | 415 | $status_code = 500; |
| 419 | - } |
|
| 420 | - else |
|
| 416 | + } else |
|
| 421 | 417 | { |
| 422 | 418 | $exit_status = 1; // EXIT_ERROR |
| 423 | 419 | } |
@@ -556,8 +552,7 @@ discard block |
||
| 556 | 552 | if (isset($stati[$code])) |
| 557 | 553 | { |
| 558 | 554 | $text = $stati[$code]; |
| 559 | - } |
|
| 560 | - else |
|
| 555 | + } else |
|
| 561 | 556 | { |
| 562 | 557 | show_error('No status text available. Please check your status code number or supply your own message text.', 500); |
| 563 | 558 | } |
@@ -566,8 +561,7 @@ discard block |
||
| 566 | 561 | if (strpos(PHP_SAPI, 'cgi') === 0) |
| 567 | 562 | { |
| 568 | 563 | header('Status: '.$code.' '.$text, TRUE); |
| 569 | - } |
|
| 570 | - else |
|
| 564 | + } else |
|
| 571 | 565 | { |
| 572 | 566 | $server_protocol = isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.1'; |
| 573 | 567 | header($server_protocol.' '.$code.' '.$text, TRUE, $code); |
@@ -93,16 +93,14 @@ discard block |
||
| 93 | 93 | if (strpos($_SERVER['SERVER_ADDR'], ':') !== FALSE) |
| 94 | 94 | { |
| 95 | 95 | $server_addr = '['.$_SERVER['SERVER_ADDR'].']'; |
| 96 | - } |
|
| 97 | - else |
|
| 96 | + } else |
|
| 98 | 97 | { |
| 99 | 98 | $server_addr = $_SERVER['SERVER_ADDR']; |
| 100 | 99 | } |
| 101 | 100 | |
| 102 | 101 | $base_url = (is_https() ? 'https' : 'http').'://'.$server_addr |
| 103 | 102 | .substr($_SERVER['SCRIPT_NAME'], 0, strpos($_SERVER['SCRIPT_NAME'], basename($_SERVER['SCRIPT_FILENAME']))); |
| 104 | - } |
|
| 105 | - else |
|
| 103 | + } else |
|
| 106 | 104 | { |
| 107 | 105 | $base_url = 'http://localhost/'; |
| 108 | 106 | } |
@@ -160,8 +158,7 @@ discard block |
||
| 160 | 158 | $this->config[$file] = isset($this->config[$file]) |
| 161 | 159 | ? array_merge($this->config[$file], $config) |
| 162 | 160 | : $config; |
| 163 | - } |
|
| 164 | - else |
|
| 161 | + } else |
|
| 165 | 162 | { |
| 166 | 163 | $this->config = array_merge($this->config, $config); |
| 167 | 164 | } |
@@ -176,8 +173,7 @@ discard block |
||
| 176 | 173 | if ($loaded === TRUE) |
| 177 | 174 | { |
| 178 | 175 | return TRUE; |
| 179 | - } |
|
| 180 | - elseif ($fail_gracefully === TRUE) |
|
| 176 | + } elseif ($fail_gracefully === TRUE) |
|
| 181 | 177 | { |
| 182 | 178 | return FALSE; |
| 183 | 179 | } |
@@ -217,8 +213,7 @@ discard block |
||
| 217 | 213 | if ( ! isset($this->config[$item])) |
| 218 | 214 | { |
| 219 | 215 | return NULL; |
| 220 | - } |
|
| 221 | - elseif (trim($this->config[$item]) === '') |
|
| 216 | + } elseif (trim($this->config[$item]) === '') |
|
| 222 | 217 | { |
| 223 | 218 | return ''; |
| 224 | 219 | } |
@@ -249,8 +244,7 @@ discard block |
||
| 249 | 244 | if ($protocol === '') |
| 250 | 245 | { |
| 251 | 246 | $base_url = substr($base_url, strpos($base_url, '//')); |
| 252 | - } |
|
| 253 | - else |
|
| 247 | + } else |
|
| 254 | 248 | { |
| 255 | 249 | $base_url = $protocol.substr($base_url, strpos($base_url, '://')); |
| 256 | 250 | } |
@@ -272,16 +266,14 @@ discard block |
||
| 272 | 266 | if (($offset = strpos($uri, '?')) !== FALSE) |
| 273 | 267 | { |
| 274 | 268 | $uri = substr($uri, 0, $offset).$suffix.substr($uri, $offset); |
| 275 | - } |
|
| 276 | - else |
|
| 269 | + } else |
|
| 277 | 270 | { |
| 278 | 271 | $uri .= $suffix; |
| 279 | 272 | } |
| 280 | 273 | } |
| 281 | 274 | |
| 282 | 275 | return $base_url.$this->slash_item('index_page').$uri; |
| 283 | - } |
|
| 284 | - elseif (strpos($uri, '?') === FALSE) |
|
| 276 | + } elseif (strpos($uri, '?') === FALSE) |
|
| 285 | 277 | { |
| 286 | 278 | $uri = '?'.$uri; |
| 287 | 279 | } |
@@ -312,8 +304,7 @@ discard block |
||
| 312 | 304 | if ($protocol === '') |
| 313 | 305 | { |
| 314 | 306 | $base_url = substr($base_url, strpos($base_url, '//')); |
| 315 | - } |
|
| 316 | - else |
|
| 307 | + } else |
|
| 317 | 308 | { |
| 318 | 309 | $base_url = $protocol.substr($base_url, strpos($base_url, '://')); |
| 319 | 310 | } |
@@ -342,8 +333,7 @@ discard block |
||
| 342 | 333 | $uri = implode('/', $uri); |
| 343 | 334 | } |
| 344 | 335 | return trim($uri, '/'); |
| 345 | - } |
|
| 346 | - elseif (is_array($uri)) |
|
| 336 | + } elseif (is_array($uri)) |
|
| 347 | 337 | { |
| 348 | 338 | return http_build_query($uri); |
| 349 | 339 | } |
@@ -122,8 +122,7 @@ discard block |
||
| 122 | 122 | { |
| 123 | 123 | $heading = 'Not Found'; |
| 124 | 124 | $message = 'The controller/method pair you requested was not found.'; |
| 125 | - } |
|
| 126 | - else |
|
| 125 | + } else |
|
| 127 | 126 | { |
| 128 | 127 | $heading = '404 Page Not Found'; |
| 129 | 128 | $message = 'The page you requested was not found.'; |
@@ -166,8 +165,7 @@ discard block |
||
| 166 | 165 | { |
| 167 | 166 | $message = "\t".(is_array($message) ? implode("\n\t", $message) : $message); |
| 168 | 167 | $template = 'cli'.DIRECTORY_SEPARATOR.$template; |
| 169 | - } |
|
| 170 | - else |
|
| 168 | + } else |
|
| 171 | 169 | { |
| 172 | 170 | set_status_header($status_code); |
| 173 | 171 | $message = '<p>'.(is_array($message) ? implode('</p><p>', $message) : $message).'</p>'; |
@@ -204,8 +202,7 @@ discard block |
||
| 204 | 202 | if (is_cli()) |
| 205 | 203 | { |
| 206 | 204 | $templates_path .= 'cli'.DIRECTORY_SEPARATOR; |
| 207 | - } |
|
| 208 | - else |
|
| 205 | + } else |
|
| 209 | 206 | { |
| 210 | 207 | set_status_header(500); |
| 211 | 208 | $templates_path .= 'html'.DIRECTORY_SEPARATOR; |
@@ -255,8 +252,7 @@ discard block |
||
| 255 | 252 | } |
| 256 | 253 | |
| 257 | 254 | $template = 'html'.DIRECTORY_SEPARATOR.'error_php'; |
| 258 | - } |
|
| 259 | - else |
|
| 255 | + } else |
|
| 260 | 256 | { |
| 261 | 257 | $template = 'cli'.DIRECTORY_SEPARATOR.'error_php'; |
| 262 | 258 | } |
@@ -143,8 +143,7 @@ discard block |
||
| 143 | 143 | { |
| 144 | 144 | $this->_run_hook($val); |
| 145 | 145 | } |
| 146 | - } |
|
| 147 | - else |
|
| 146 | + } else |
|
| 148 | 147 | { |
| 149 | 148 | $this->_run_hook($this->hooks[$which]); |
| 150 | 149 | } |
@@ -172,8 +171,7 @@ discard block |
||
| 172 | 171 | : $data(); |
| 173 | 172 | |
| 174 | 173 | return TRUE; |
| 175 | - } |
|
| 176 | - elseif ( ! is_array($data)) |
|
| 174 | + } elseif ( ! is_array($data)) |
|
| 177 | 175 | { |
| 178 | 176 | return FALSE; |
| 179 | 177 | } |
@@ -227,13 +225,11 @@ discard block |
||
| 227 | 225 | if (method_exists($this->_objects[$class], $function)) |
| 228 | 226 | { |
| 229 | 227 | $this->_objects[$class]->$function($params); |
| 230 | - } |
|
| 231 | - else |
|
| 228 | + } else |
|
| 232 | 229 | { |
| 233 | 230 | return $this->_in_progress = FALSE; |
| 234 | 231 | } |
| 235 | - } |
|
| 236 | - else |
|
| 232 | + } else |
|
| 237 | 233 | { |
| 238 | 234 | class_exists($class, FALSE) OR require_once($filepath); |
| 239 | 235 | |
@@ -246,8 +242,7 @@ discard block |
||
| 246 | 242 | $this->_objects[$class] = new $class(); |
| 247 | 243 | $this->_objects[$class]->$function($params); |
| 248 | 244 | } |
| 249 | - } |
|
| 250 | - else |
|
| 245 | + } else |
|
| 251 | 246 | { |
| 252 | 247 | function_exists($function) OR require_once($filepath); |
| 253 | 248 | |
@@ -196,29 +196,30 @@ discard block |
||
| 196 | 196 | if (isset($array[$index])) |
| 197 | 197 | { |
| 198 | 198 | $value = $array[$index]; |
| 199 | - } |
|
| 200 | - elseif (($count = preg_match_all('/(?:^[^\[]+)|\[[^]]*\]/', $index, $matches)) > 1) // Does the index contain array notation |
|
| 199 | + } elseif (($count = preg_match_all('/(?:^[^\[]+)|\[[^]]*\]/', $index, $matches)) > 1) { |
|
| 200 | + // Does the index contain array notation |
|
| 201 | 201 | { |
| 202 | 202 | $value = $array; |
| 203 | + } |
|
| 203 | 204 | for ($i = 0; $i < $count; $i++) |
| 204 | 205 | { |
| 205 | 206 | $key = trim($matches[0][$i], '[]'); |
| 206 | - if ($key === '') // Empty notation will return the value as array |
|
| 207 | + if ($key === '') { |
|
| 208 | + // Empty notation will return the value as array |
|
| 207 | 209 | { |
| 208 | 210 | break; |
| 209 | 211 | } |
| 212 | + } |
|
| 210 | 213 | |
| 211 | 214 | if (isset($value[$key])) |
| 212 | 215 | { |
| 213 | 216 | $value = $value[$key]; |
| 214 | - } |
|
| 215 | - else |
|
| 217 | + } else |
|
| 216 | 218 | { |
| 217 | 219 | return NULL; |
| 218 | 220 | } |
| 219 | 221 | } |
| 220 | - } |
|
| 221 | - else |
|
| 222 | + } else |
|
| 222 | 223 | { |
| 223 | 224 | return NULL; |
| 224 | 225 | } |
@@ -401,8 +402,7 @@ discard block |
||
| 401 | 402 | if ( ! is_numeric($expire)) |
| 402 | 403 | { |
| 403 | 404 | $expire = time() - 86500; |
| 404 | - } |
|
| 405 | - else |
|
| 405 | + } else |
|
| 406 | 406 | { |
| 407 | 407 | $expire = ($expire > 0) ? time() + $expire : 0; |
| 408 | 408 | } |
@@ -448,8 +448,7 @@ discard block |
||
| 448 | 448 | if ( ! $this->valid_ip($spoof)) |
| 449 | 449 | { |
| 450 | 450 | $spoof = NULL; |
| 451 | - } |
|
| 452 | - else |
|
| 451 | + } else |
|
| 453 | 452 | { |
| 454 | 453 | break; |
| 455 | 454 | } |
@@ -502,8 +501,7 @@ discard block |
||
| 502 | 501 | } |
| 503 | 502 | |
| 504 | 503 | $sprintf = '%016b%016b%016b%016b%016b%016b%016b%016b'; |
| 505 | - } |
|
| 506 | - else |
|
| 504 | + } else |
|
| 507 | 505 | { |
| 508 | 506 | $ip = explode('.', $this->ip_address); |
| 509 | 507 | $sprintf = '%08b%08b%08b%08b'; |
@@ -523,8 +521,7 @@ discard block |
||
| 523 | 521 | { |
| 524 | 522 | $netaddr[$i] = intval($netaddr[$i], 16); |
| 525 | 523 | } |
| 526 | - } |
|
| 527 | - else |
|
| 524 | + } else |
|
| 528 | 525 | { |
| 529 | 526 | $netaddr = explode('.', $netaddr); |
| 530 | 527 | } |
@@ -605,8 +602,7 @@ discard block |
||
| 605 | 602 | if ($this->_allow_get_array === FALSE) |
| 606 | 603 | { |
| 607 | 604 | $_GET = array(); |
| 608 | - } |
|
| 609 | - elseif (is_array($_GET)) |
|
| 605 | + } elseif (is_array($_GET)) |
|
| 610 | 606 | { |
| 611 | 607 | foreach ($_GET as $key => $val) |
| 612 | 608 | { |
@@ -642,8 +638,7 @@ discard block |
||
| 642 | 638 | if (($cookie_key = $this->_clean_input_keys($key)) !== FALSE) |
| 643 | 639 | { |
| 644 | 640 | $_COOKIE[$cookie_key] = $this->_clean_input_data($val); |
| 645 | - } |
|
| 646 | - else |
|
| 641 | + } else |
|
| 647 | 642 | { |
| 648 | 643 | unset($_COOKIE[$key]); |
| 649 | 644 | } |
@@ -729,8 +724,7 @@ discard block |
||
| 729 | 724 | if ($fatal === TRUE) |
| 730 | 725 | { |
| 731 | 726 | return FALSE; |
| 732 | - } |
|
| 733 | - else |
|
| 727 | + } else |
|
| 734 | 728 | { |
| 735 | 729 | set_status_header(503); |
| 736 | 730 | echo 'Disallowed Key Characters.'; |
@@ -885,8 +879,7 @@ discard block |
||
| 885 | 879 | { |
| 886 | 880 | isset($this->_raw_input_stream) OR $this->_raw_input_stream = file_get_contents('php://input'); |
| 887 | 881 | return $this->_raw_input_stream; |
| 888 | - } |
|
| 889 | - elseif ($name === 'ip_address') |
|
| 882 | + } elseif ($name === 'ip_address') |
|
| 890 | 883 | { |
| 891 | 884 | return $this->ip_address; |
| 892 | 885 | } |
@@ -129,8 +129,7 @@ discard block |
||
| 129 | 129 | if (is_numeric($config['log_threshold'])) |
| 130 | 130 | { |
| 131 | 131 | $this->_threshold = (int) $config['log_threshold']; |
| 132 | - } |
|
| 133 | - elseif (is_array($config['log_threshold'])) |
|
| 132 | + } elseif (is_array($config['log_threshold'])) |
|
| 134 | 133 | { |
| 135 | 134 | $this->_threshold = 0; |
| 136 | 135 | $this->_threshold_array = array_flip($config['log_threshold']); |
@@ -198,8 +197,7 @@ discard block |
||
| 198 | 197 | $microtime_short = sprintf("%06d", ($microtime_full - floor($microtime_full)) * 1000000); |
| 199 | 198 | $date = new DateTime(date('Y-m-d H:i:s.'.$microtime_short, $microtime_full)); |
| 200 | 199 | $date = $date->format($this->_date_fmt); |
| 201 | - } |
|
| 202 | - else |
|
| 200 | + } else |
|
| 203 | 201 | { |
| 204 | 202 | $date = date($this->_date_fmt); |
| 205 | 203 | } |
@@ -481,8 +481,7 @@ discard block |
||
| 481 | 481 | { |
| 482 | 482 | header('Content-Encoding: gzip'); |
| 483 | 483 | header('Content-Length: '.strlen($output)); |
| 484 | - } |
|
| 485 | - else |
|
| 484 | + } else |
|
| 486 | 485 | { |
| 487 | 486 | // User agent doesn't support gzip compression, |
| 488 | 487 | // so we'll have to decompress our cache |
@@ -522,8 +521,7 @@ discard block |
||
| 522 | 521 | if (method_exists($CI, '_output')) |
| 523 | 522 | { |
| 524 | 523 | $CI->_output($output); |
| 525 | - } |
|
| 526 | - else |
|
| 524 | + } else |
|
| 527 | 525 | { |
| 528 | 526 | echo $output; // Send it to the browser! |
| 529 | 527 | } |
@@ -561,8 +559,7 @@ discard block |
||
| 561 | 559 | if (is_array($cache_query_string)) |
| 562 | 560 | { |
| 563 | 561 | $uri .= '?'.http_build_query(array_intersect_key($_GET, array_flip($cache_query_string))); |
| 564 | - } |
|
| 565 | - else |
|
| 562 | + } else |
|
| 566 | 563 | { |
| 567 | 564 | $uri .= '?'.$_SERVER['QUERY_STRING']; |
| 568 | 565 | } |
@@ -610,8 +607,7 @@ discard block |
||
| 610 | 607 | } |
| 611 | 608 | |
| 612 | 609 | flock($fp, LOCK_UN); |
| 613 | - } |
|
| 614 | - else |
|
| 610 | + } else |
|
| 615 | 611 | { |
| 616 | 612 | log_message('error', 'Unable to secure a file lock for file at: '.$cache_path); |
| 617 | 613 | return; |
@@ -626,8 +622,7 @@ discard block |
||
| 626 | 622 | |
| 627 | 623 | // Send HTTP cache-control headers to browser to match file cache settings. |
| 628 | 624 | $this->set_cache_header($_SERVER['REQUEST_TIME'], $expire); |
| 629 | - } |
|
| 630 | - else |
|
| 625 | + } else |
|
| 631 | 626 | { |
| 632 | 627 | @unlink($cache_path); |
| 633 | 628 | log_message('error', 'Unable to write the complete cache content at: '.$cache_path); |
@@ -658,8 +653,7 @@ discard block |
||
| 658 | 653 | if (is_array($cache_query_string)) |
| 659 | 654 | { |
| 660 | 655 | $uri .= '?'.http_build_query(array_intersect_key($_GET, array_flip($cache_query_string))); |
| 661 | - } |
|
| 662 | - else |
|
| 656 | + } else |
|
| 663 | 657 | { |
| 664 | 658 | $uri .= '?'.$_SERVER['QUERY_STRING']; |
| 665 | 659 | } |
@@ -697,8 +691,7 @@ discard block |
||
| 697 | 691 | @unlink($filepath); |
| 698 | 692 | log_message('debug', 'Cache file has expired. File deleted.'); |
| 699 | 693 | return FALSE; |
| 700 | - } |
|
| 701 | - else |
|
| 694 | + } else |
|
| 702 | 695 | { |
| 703 | 696 | // Or else send the HTTP cache control headers. |
| 704 | 697 | $this->set_cache_header($last_modified, $expire); |
@@ -748,8 +741,7 @@ discard block |
||
| 748 | 741 | if (is_array($cache_query_string)) |
| 749 | 742 | { |
| 750 | 743 | $uri .= '?'.http_build_query(array_intersect_key($_GET, array_flip($cache_query_string))); |
| 751 | - } |
|
| 752 | - else |
|
| 744 | + } else |
|
| 753 | 745 | { |
| 754 | 746 | $uri .= '?'.$_SERVER['QUERY_STRING']; |
| 755 | 747 | } |
@@ -787,8 +779,7 @@ discard block |
||
| 787 | 779 | { |
| 788 | 780 | $this->set_status_header(304); |
| 789 | 781 | exit; |
| 790 | - } |
|
| 791 | - else |
|
| 782 | + } else |
|
| 792 | 783 | { |
| 793 | 784 | header('Pragma: public'); |
| 794 | 785 | header('Cache-Control: max-age='.$max_age.', public'); |