Completed
Push — v3.0 ( 23635d...e28df5 )
by Samir
23s
created
web_interface/astpp/index.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -193,8 +193,7 @@
 block discarded – undo
193 193
 	if (is_dir($application_folder))
194 194
 	{
195 195
 		define('APPPATH', $application_folder.'/');
196
-	}
197
-	else
196
+	} else
198 197
 	{
199 198
 		if ( ! is_dir(BASEPATH.$application_folder.'/'))
200 199
 		{
Please login to merge, or discard this patch.
web_interface/astpp/system/core/Output.php 1 patch
Braces   +8 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@  discard block
 block discarded – undo
1
-<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
1
+<?php  if ( ! defined('BASEPATH')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /**
3 5
  * CodeIgniter
4 6
  *
@@ -97,8 +99,7 @@  discard block
 block discarded – undo
97 99
 		if (defined('ENVIRONMENT') AND file_exists(APPPATH.'config/'.ENVIRONMENT.'/mimes.php'))
98 100
 		{
99 101
 		    include APPPATH.'config/'.ENVIRONMENT.'/mimes.php';
100
-		}
101
-		else
102
+		} else
102 103
 		{
103 104
 			include APPPATH.'config/mimes.php';
104 105
 		}
@@ -158,8 +159,7 @@  discard block
 block discarded – undo
158 159
 		if ($this->final_output == '')
159 160
 		{
160 161
 			$this->final_output = $output;
161
-		}
162
-		else
162
+		} else
163 163
 		{
164 164
 			$this->final_output .= $output;
165 165
 		}
@@ -425,8 +425,7 @@  discard block
 block discarded – undo
425 425
 				$output  = preg_replace("|</body>.*?</html>|is", '', $output);
426 426
 				$output .= $CI->profiler->run();
427 427
 				$output .= '</body></html>';
428
-			}
429
-			else
428
+			} else
430 429
 			{
431 430
 				$output .= $CI->profiler->run();
432 431
 			}
@@ -439,8 +438,7 @@  discard block
 block discarded – undo
439 438
 		if (method_exists($CI, '_output'))
440 439
 		{
441 440
 			$CI->_output($output);
442
-		}
443
-		else
441
+		} else
444 442
 		{
445 443
 			echo $output;  // Send it to the browser!
446 444
 		}
@@ -489,8 +487,7 @@  discard block
 block discarded – undo
489 487
 		{
490 488
 			fwrite($fp, $expire.'TS--->'.$output);
491 489
 			flock($fp, LOCK_UN);
492
-		}
493
-		else
490
+		} else
494 491
 		{
495 492
 			log_message('error', "Unable to secure a file lock for file at: ".$cache_path);
496 493
 			return;
Please login to merge, or discard this patch.
web_interface/astpp/system/core/Config.php 1 patch
Braces   +9 added lines, -14 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@  discard block
 block discarded – undo
1
-<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
1
+<?php  if ( ! defined('BASEPATH')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /**
3 5
  * CodeIgniter
4 6
  *
@@ -71,9 +73,7 @@  discard block
 block discarded – undo
71 73
 				$base_url = isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) !== 'off' ? 'https' : 'http';
72 74
 				$base_url .= '://'. $_SERVER['HTTP_HOST'];
73 75
 				$base_url .= str_replace(basename($_SERVER['SCRIPT_NAME']), '', $_SERVER['SCRIPT_NAME']);
74
-			}
75
-
76
-			else
76
+			} else
77 77
 			{
78 78
 				$base_url = 'http://localhost/';
79 79
 			}
@@ -143,13 +143,11 @@  discard block
 block discarded – undo
143 143
 				if (isset($this->config[$file]))
144 144
 				{
145 145
 					$this->config[$file] = array_merge($this->config[$file], $config);
146
-				}
147
-				else
146
+				} else
148 147
 				{
149 148
 					$this->config[$file] = $config;
150 149
 				}
151
-			}
152
-			else
150
+			} else
153 151
 			{
154 152
 				$this->config = array_merge($this->config, $config);
155 153
 			}
@@ -196,8 +194,7 @@  discard block
 block discarded – undo
196 194
 			}
197 195
 
198 196
 			$pref = $this->config[$item];
199
-		}
200
-		else
197
+		} else
201 198
 		{
202 199
 			if ( ! isset($this->config[$index]))
203 200
 			{
@@ -260,8 +257,7 @@  discard block
 block discarded – undo
260 257
 		{
261 258
 			$suffix = ($this->item('url_suffix') == FALSE) ? '' : $this->item('url_suffix');
262 259
 			return $this->slash_item('base_url').$this->slash_item('index_page').$this->_uri_string($uri).$suffix;
263
-		}
264
-		else
260
+		} else
265 261
 		{
266 262
 			return $this->slash_item('base_url').$this->item('index_page').'?'.$this->_uri_string($uri);
267 263
 		}
@@ -300,8 +296,7 @@  discard block
 block discarded – undo
300 296
 				$uri = implode('/', $uri);
301 297
 			}
302 298
 			$uri = trim($uri, '/');
303
-		}
304
-		else
299
+		} else
305 300
 		{
306 301
 			if (is_array($uri))
307 302
 			{
Please login to merge, or discard this patch.
web_interface/astpp/system/core/CodeIgniter.php 1 patch
Braces   +7 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@  discard block
 block discarded – undo
1
-<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
1
+<?php  if ( ! defined('BASEPATH')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /**
3 5
  * CodeIgniter
4 6
  *
@@ -58,8 +60,7 @@  discard block
 block discarded – undo
58 60
 	if (defined('ENVIRONMENT') AND file_exists(APPPATH.'config/'.ENVIRONMENT.'/constants.php'))
59 61
 	{
60 62
 		require(APPPATH.'config/'.ENVIRONMENT.'/constants.php');
61
-	}
62
-	else
63
+	} else
63 64
 	{
64 65
 		require(APPPATH.'config/constants.php');
65 66
 	}
@@ -283,8 +284,7 @@  discard block
 block discarded – undo
283 284
 
284 285
 				include_once(APPPATH.'controllers/'.$class.'.php');
285 286
 			}
286
-		}
287
-		else
287
+		} else
288 288
 		{
289 289
 			show_404("{$class}/{$method}");
290 290
 		}
@@ -323,8 +323,7 @@  discard block
 block discarded – undo
323 323
 	if (method_exists($CI, '_remap'))
324 324
 	{
325 325
 		$CI->_remap($method, array_slice($URI->rsegments, 2));
326
-	}
327
-	else
326
+	} else
328 327
 	{
329 328
 		// is_callable() returns TRUE on some versions of PHP 5 for private and protected
330 329
 		// methods, so we'll use this workaround for consistent behavior
@@ -347,8 +346,7 @@  discard block
 block discarded – undo
347 346
 					unset($CI);
348 347
 					$CI = new $class();
349 348
 				}
350
-			}
351
-			else
349
+			} else
352 350
 			{
353 351
 				show_404("{$class}/{$method}");
354 352
 			}
Please login to merge, or discard this patch.
web_interface/astpp/system/core/Common.php 1 patch
Braces   +7 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@  discard block
 block discarded – undo
1
-<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
1
+<?php  if ( ! defined('BASEPATH')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /**
3 5
  * CodeIgniter
4 6
  *
@@ -92,8 +94,7 @@  discard block
 block discarded – undo
92 94
 			@chmod($file, DIR_WRITE_MODE);
93 95
 			@unlink($file);
94 96
 			return TRUE;
95
-		}
96
-		elseif ( ! is_file($file) OR ($fp = @fopen($file, FOPEN_WRITE_CREATE)) === FALSE)
97
+		} elseif ( ! is_file($file) OR ($fp = @fopen($file, FOPEN_WRITE_CREATE)) === FALSE)
97 98
 		{
98 99
 			return FALSE;
99 100
 		}
@@ -437,12 +438,10 @@  discard block
 block discarded – undo
437 438
 		if (substr(php_sapi_name(), 0, 3) == 'cgi')
438 439
 		{
439 440
 			header("Status: {$code} {$text}", TRUE);
440
-		}
441
-		elseif ($server_protocol == 'HTTP/1.1' OR $server_protocol == 'HTTP/1.0')
441
+		} elseif ($server_protocol == 'HTTP/1.1' OR $server_protocol == 'HTTP/1.0')
442 442
 		{
443 443
 			header($server_protocol." {$code} {$text}", TRUE, $code);
444
-		}
445
-		else
444
+		} else
446 445
 		{
447 446
 			header("HTTP/1.1 {$code} {$text}", TRUE, $code);
448 447
 		}
@@ -553,8 +552,7 @@  discard block
 block discarded – undo
553 552
 		if (is_array($var))
554 553
 		{
555 554
 			return array_map('html_escape', $var);
556
-		}
557
-		else
555
+		} else
558 556
 		{
559 557
 			return htmlspecialchars($var, ENT_QUOTES, config_item('charset'));
560 558
 		}
Please login to merge, or discard this patch.
web_interface/astpp/system/core/Input.php 1 patch
Braces   +12 added lines, -19 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@  discard block
 block discarded – undo
1
-<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
1
+<?php  if ( ! defined('BASEPATH')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /**
3 5
  * CodeIgniter
4 6
  *
@@ -203,8 +205,7 @@  discard block
 block discarded – undo
203 205
 		if ( ! isset($_POST[$index]) )
204 206
 		{
205 207
 			return $this->get($index, $xss_clean);
206
-		}
207
-		else
208
+		} else
208 209
 		{
209 210
 			return $this->post($index, $xss_clean);
210 211
 		}
@@ -277,8 +278,7 @@  discard block
 block discarded – undo
277 278
 		if ( ! is_numeric($expire))
278 279
 		{
279 280
 			$expire = time() - 86500;
280
-		}
281
-		else
281
+		} else
282 282
 		{
283 283
 			$expire = ($expire > 0) ? time() + $expire : 0;
284 284
 		}
@@ -322,20 +322,16 @@  discard block
 block discarded – undo
322 322
 			$proxies = is_array($proxies) ? $proxies : array($proxies);
323 323
 
324 324
 			$this->ip_address = in_array($_SERVER['REMOTE_ADDR'], $proxies) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'];
325
-		}
326
-		elseif ($this->server('REMOTE_ADDR') AND $this->server('HTTP_CLIENT_IP'))
325
+		} elseif ($this->server('REMOTE_ADDR') AND $this->server('HTTP_CLIENT_IP'))
327 326
 		{
328 327
 			$this->ip_address = $_SERVER['HTTP_CLIENT_IP'];
329
-		}
330
-		elseif ($this->server('REMOTE_ADDR'))
328
+		} elseif ($this->server('REMOTE_ADDR'))
331 329
 		{
332 330
 			$this->ip_address = $_SERVER['REMOTE_ADDR'];
333
-		}
334
-		elseif ($this->server('HTTP_CLIENT_IP'))
331
+		} elseif ($this->server('HTTP_CLIENT_IP'))
335 332
 		{
336 333
 			$this->ip_address = $_SERVER['HTTP_CLIENT_IP'];
337
-		}
338
-		elseif ($this->server('HTTP_X_FORWARDED_FOR'))
334
+		} elseif ($this->server('HTTP_X_FORWARDED_FOR'))
339 335
 		{
340 336
 			$this->ip_address = $_SERVER['HTTP_X_FORWARDED_FOR'];
341 337
 		}
@@ -454,8 +450,7 @@  discard block
 block discarded – undo
454 450
 					global $$global;
455 451
 					$$global = NULL;
456 452
 				}
457
-			}
458
-			else
453
+			} else
459 454
 			{
460 455
 				foreach ($global as $key => $val)
461 456
 				{
@@ -472,8 +467,7 @@  discard block
 block discarded – undo
472 467
 		if ($this->_allow_get_array == FALSE)
473 468
 		{
474 469
 			$_GET = array();
475
-		}
476
-		else
470
+		} else
477 471
 		{
478 472
 			if (is_array($_GET) AND count($_GET) > 0)
479 473
 			{
@@ -631,8 +625,7 @@  discard block
 block discarded – undo
631 625
 		if (function_exists('apache_request_headers'))
632 626
 		{
633 627
 			$headers = apache_request_headers();
634
-		}
635
-		else
628
+		} else
636 629
 		{
637 630
 			$headers['Content-Type'] = (isset($_SERVER['CONTENT_TYPE'])) ? $_SERVER['CONTENT_TYPE'] : @getenv('CONTENT_TYPE');
638 631
 
Please login to merge, or discard this patch.
web_interface/astpp/system/core/Hooks.php 1 patch
Braces   +6 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@  discard block
 block discarded – undo
1
-<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
1
+<?php  if ( ! defined('BASEPATH')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /**
3 5
  * CodeIgniter
4 6
  *
@@ -83,8 +85,7 @@  discard block
 block discarded – undo
83 85
 		if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/hooks.php'))
84 86
 		{
85 87
 		    include(APPPATH.'config/'.ENVIRONMENT.'/hooks.php');
86
-		}
87
-		elseif (is_file(APPPATH.'config/hooks.php'))
88
+		} elseif (is_file(APPPATH.'config/hooks.php'))
88 89
 		{
89 90
 			include(APPPATH.'config/hooks.php');
90 91
 		}
@@ -123,8 +124,7 @@  discard block
 block discarded – undo
123 124
 			{
124 125
 				$this->_run_hook($val);
125 126
 			}
126
-		}
127
-		else
127
+		} else
128 128
 		{
129 129
 			$this->_run_hook($this->hooks[$which]);
130 130
 		}
@@ -225,8 +225,7 @@  discard block
 block discarded – undo
225 225
 
226 226
 			$HOOK = new $class;
227 227
 			$HOOK->$function($params);
228
-		}
229
-		else
228
+		} else
230 229
 		{
231 230
 			if ( ! function_exists($function))
232 231
 			{
Please login to merge, or discard this patch.
web_interface/astpp/system/core/Router.php 1 patch
Braces   +9 added lines, -13 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@  discard block
 block discarded – undo
1
-<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
1
+<?php  if ( ! defined('BASEPATH')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /**
3 5
  * CodeIgniter
4 6
  *
@@ -132,8 +134,7 @@  discard block
 block discarded – undo
132 134
 		if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/routes.php'))
133 135
 		{
134 136
 			include(APPPATH.'config/'.ENVIRONMENT.'/routes.php');
135
-		}
136
-		elseif (is_file(APPPATH.'config/routes.php'))
137
+		} elseif (is_file(APPPATH.'config/routes.php'))
137 138
 		{
138 139
 			include(APPPATH.'config/routes.php');
139 140
 		}
@@ -195,8 +196,7 @@  discard block
 block discarded – undo
195 196
 			$this->set_class($x[0]);
196 197
 			$this->set_method($x[1]);
197 198
 			$this->_set_request($x);
198
-		}
199
-		else
199
+		} else
200 200
 		{
201 201
 			$this->set_class($this->default_controller);
202 202
 			$this->set_method('index');
@@ -237,8 +237,7 @@  discard block
 block discarded – undo
237 237
 		{
238 238
 			// A standard method request
239 239
 			$this->set_method($segments[1]);
240
-		}
241
-		else
240
+		} else
242 241
 		{
243 242
 			// This lets the "routed" segment array identify that the default
244 243
 			// index method is being used.
@@ -295,14 +294,12 @@  discard block
 block discarded – undo
295 294
 						$this->set_method(isset($x[1]) ? $x[1] : 'index');
296 295
 
297 296
 						return $x;
298
-					}
299
-					else
297
+					} else
300 298
 					{
301 299
 						show_404($this->fetch_directory().$segments[0]);
302 300
 					}
303 301
 				}
304
-			}
305
-			else
302
+			} else
306 303
 			{
307 304
 				// Is the method being specified in the route?
308 305
 				if (strpos($this->default_controller, '/') !== FALSE)
@@ -311,8 +308,7 @@  discard block
 block discarded – undo
311 308
 
312 309
 					$this->set_class($x[0]);
313 310
 					$this->set_method($x[1]);
314
-				}
315
-				else
311
+				} else
316 312
 				{
317 313
 					$this->set_class($this->default_controller);
318 314
 					$this->set_method('index');
Please login to merge, or discard this patch.
web_interface/astpp/system/core/URI.php 1 patch
Braces   +10 added lines, -14 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@  discard block
 block discarded – undo
1
-<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
1
+<?php  if ( ! defined('BASEPATH')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /**
3 5
  * CodeIgniter
4 6
  *
@@ -135,8 +137,7 @@  discard block
 block discarded – undo
135 137
 		{
136 138
 			$this->_set_uri_string($this->_detect_uri());
137 139
 			return;
138
-		}
139
-		elseif ($uri == 'CLI')
140
+		} elseif ($uri == 'CLI')
140 141
 		{
141 142
 			$this->_set_uri_string($this->_parse_cli_args());
142 143
 			return;
@@ -163,7 +164,7 @@  discard block
 block discarded – undo
163 164
   $pos = strpos($str, "_json");
164 165
  if($pos > 0 && !isset($_SERVER['HTTP_X_REQUESTED_WITH'])){
165 166
        $this->uri_string = str_replace('_json', '', trim($str, '/'));
166
- }else{
167
+ } else{
167 168
 		// If the URI contains only a slash we'll kill it
168 169
 		$this->uri_string = ($str == '/') ? '' : $str;
169 170
 }
@@ -192,8 +193,7 @@  discard block
 block discarded – undo
192 193
 		if (strpos($uri, $_SERVER['SCRIPT_NAME']) === 0)
193 194
 		{
194 195
 			$uri = substr($uri, strlen($_SERVER['SCRIPT_NAME']));
195
-		}
196
-		elseif (strpos($uri, dirname($_SERVER['SCRIPT_NAME'])) === 0)
196
+		} elseif (strpos($uri, dirname($_SERVER['SCRIPT_NAME'])) === 0)
197 197
 		{
198 198
 			$uri = substr($uri, strlen(dirname($_SERVER['SCRIPT_NAME'])));
199 199
 		}
@@ -210,8 +210,7 @@  discard block
 block discarded – undo
210 210
 		{
211 211
 			$_SERVER['QUERY_STRING'] = $parts[1];
212 212
 			parse_str($_SERVER['QUERY_STRING'], $_GET);
213
-		}
214
-		else
213
+		} else
215 214
 		{
216 215
 			$_SERVER['QUERY_STRING'] = '';
217 216
 			$_GET = array();
@@ -426,8 +425,7 @@  discard block
 block discarded – undo
426 425
 		{
427 426
 			$total_segments = 'total_segments';
428 427
 			$segment_array = 'segment_array';
429
-		}
430
-		else
428
+		} else
431 429
 		{
432 430
 			$total_segments = 'total_rsegments';
433 431
 			$segment_array = 'rsegment_array';
@@ -468,8 +466,7 @@  discard block
 block discarded – undo
468 466
 			if ($i % 2)
469 467
 			{
470 468
 				$retval[$lastval] = $seg;
471
-			}
472
-			else
469
+			} else
473 470
 			{
474 471
 				$retval[$seg] = FALSE;
475 472
 				$lastval = $seg;
@@ -565,8 +562,7 @@  discard block
 block discarded – undo
565 562
 		if ($where == 'trailing')
566 563
 		{
567 564
 			$leading	= '';
568
-		}
569
-		elseif ($where == 'leading')
565
+		} elseif ($where == 'leading')
570 566
 		{
571 567
 			$trailing	= '';
572 568
 		}
Please login to merge, or discard this patch.