@@ -29,7 +29,9 @@ |
||
29 | 29 | * @link http://sprintphp.com |
30 | 30 | * @since Version 1.0 |
31 | 31 | */ |
32 | -if (!defined('BASEPATH')) exit('No direct script access allowed'); |
|
32 | +if (!defined('BASEPATH')) { |
|
33 | + exit('No direct script access allowed'); |
|
34 | +} |
|
33 | 35 | |
34 | 36 | //-------------------------------------------------------------------- |
35 | 37 | // Allowed Environments |
@@ -1636,8 +1636,10 @@ |
||
1636 | 1636 | $r = ($seed * (1 + $key)) % 100; # Pseudo-random function. |
1637 | 1637 | # roughly 10% raw, 45% hex, 45% dec |
1638 | 1638 | # '@' *must* be encoded. I insist. |
1639 | - if ($r > 90 && $char != '@') /* do nothing */ { |
|
1639 | + if ($r > 90 && $char != '@') { |
|
1640 | + /* do nothing */ { |
|
1640 | 1641 | ; |
1642 | + } |
|
1641 | 1643 | } else if ($r < 45) { |
1642 | 1644 | $chars[$key] = '&#x' . dechex($ord) . ';'; |
1643 | 1645 | } else { |
@@ -208,8 +208,7 @@ discard block |
||
208 | 208 | if ($this->_migration_type === 'sequential') |
209 | 209 | { |
210 | 210 | $target_version = sprintf('%03d', $target_version); |
211 | - } |
|
212 | - else |
|
211 | + } else |
|
213 | 212 | { |
214 | 213 | $target_version = (string) $target_version; |
215 | 214 | } |
@@ -226,8 +225,7 @@ discard block |
||
226 | 225 | { |
227 | 226 | // Moving Up |
228 | 227 | $method = 'up'; |
229 | - } |
|
230 | - else |
|
228 | + } else |
|
231 | 229 | { |
232 | 230 | // Moving Down, apply in reverse order |
233 | 231 | $method = 'down'; |
@@ -437,8 +435,7 @@ discard block |
||
437 | 435 | if ($this->_migration_type == 'timestamp') |
438 | 436 | { |
439 | 437 | $prefix = date('YmdHis'); |
440 | - } |
|
441 | - else |
|
438 | + } else |
|
442 | 439 | { |
443 | 440 | $prefix = str_pad($this->get_version() + 1, 3, '0', STR_PAD_LEFT); |
444 | 441 | } |
@@ -203,8 +203,7 @@ discard block |
||
203 | 203 | if ($query->num_rows() == 0) |
204 | 204 | { |
205 | 205 | $this->db->insert('user_meta', $obj); |
206 | - } |
|
207 | - else if ($query->num_rows() > 0) |
|
206 | + } else if ($query->num_rows() > 0) |
|
208 | 207 | { |
209 | 208 | $this->db->where('user_id', $data['id']) |
210 | 209 | ->where('meta_key', $key) |
@@ -304,8 +303,7 @@ discard block |
||
304 | 303 | if (is_array($key)) |
305 | 304 | { |
306 | 305 | $this->db->where_in('meta_key', $key); |
307 | - } |
|
308 | - else |
|
306 | + } else |
|
309 | 307 | { |
310 | 308 | $this->db->where('meta_key', $key); |
311 | 309 | } |
@@ -351,8 +349,7 @@ discard block |
||
351 | 349 | if (is_object($data['fields'])) |
352 | 350 | { |
353 | 351 | $data['fields']->meta = (object)$meta; |
354 | - } |
|
355 | - else |
|
352 | + } else |
|
356 | 353 | { |
357 | 354 | $data['fields']['meta']= $meta; |
358 | 355 | } |
@@ -29,8 +29,9 @@ |
||
29 | 29 | * |
30 | 30 | */ |
31 | 31 | |
32 | -if (!defined("BASEPATH")) |
|
32 | +if (!defined("BASEPATH")) { |
|
33 | 33 | exit("No direct script access allowed"); |
34 | +} |
|
34 | 35 | |
35 | 36 | class HMVC_Loader extends CI_Loader { |
36 | 37 |
@@ -33,8 +33,9 @@ discard block |
||
33 | 33 | * THE SOFTWARE. |
34 | 34 | */ |
35 | 35 | |
36 | -if (!defined("BASEPATH")) |
|
36 | +if (!defined("BASEPATH")) { |
|
37 | 37 | exit("No direct script access allowed"); |
38 | +} |
|
38 | 39 | |
39 | 40 | class HMVC_Router extends CI_Router { |
40 | 41 | |
@@ -169,8 +170,7 @@ discard block |
||
169 | 170 | { |
170 | 171 | $this->set_directory(array_shift($s), TRUE); |
171 | 172 | continue; |
172 | - } |
|
173 | - elseif (file_exists(APPPATH .'controllers/'. $test .'.php')) |
|
173 | + } elseif (file_exists(APPPATH .'controllers/'. $test .'.php')) |
|
174 | 174 | { |
175 | 175 | return $s; |
176 | 176 | } |
@@ -192,8 +192,9 @@ discard block |
||
192 | 192 | array_pop($parts); |
193 | 193 | |
194 | 194 | // Stop iteration if found |
195 | - if ($count) |
|
196 | - break; |
|
195 | + if ($count) { |
|
196 | + break; |
|
197 | + } |
|
197 | 198 | } |
198 | 199 | |
199 | 200 | // Does a module exist? (/modules/xyz/controllers/) |
@@ -258,9 +258,12 @@ discard block |
||
258 | 258 | <?php endforeach; ?> |
259 | 259 | </table> |
260 | 260 | |
261 | - <?php else : ?> |
|
261 | + <?php else { |
|
262 | + : ?> |
|
262 | 263 | |
263 | - <?php echo $sections['console']; ?> |
|
264 | + <?php echo $sections['console']; |
|
265 | +} |
|
266 | +?> |
|
264 | 267 | |
265 | 268 | <?php endif; ?> |
266 | 269 | </div> |
@@ -289,9 +292,12 @@ discard block |
||
289 | 292 | <?php endforeach; ?> |
290 | 293 | </table> |
291 | 294 | |
292 | - <?php else : ?> |
|
295 | + <?php else { |
|
296 | + : ?> |
|
293 | 297 | |
294 | - <?php echo $sections['console']; ?> |
|
298 | + <?php echo $sections['console']; |
|
299 | +} |
|
300 | +?> |
|
295 | 301 | |
296 | 302 | <?php endif; ?> |
297 | 303 | </div> |
@@ -310,9 +316,12 @@ discard block |
||
310 | 316 | <?php endforeach; ?> |
311 | 317 | </table> |
312 | 318 | |
313 | - <?php else : ?> |
|
319 | + <?php else { |
|
320 | + : ?> |
|
314 | 321 | |
315 | - <?php echo $sections['benchmarks']; ?> |
|
322 | + <?php echo $sections['benchmarks']; |
|
323 | +} |
|
324 | +?> |
|
316 | 325 | |
317 | 326 | <?php endif; ?> |
318 | 327 | </div> |
@@ -333,9 +342,12 @@ discard block |
||
333 | 342 | <?php endforeach; ?> |
334 | 343 | </table> |
335 | 344 | |
336 | - <?php else : ?> |
|
345 | + <?php else { |
|
346 | + : ?> |
|
337 | 347 | |
338 | - <?php echo $sections['queries']; ?> |
|
348 | + <?php echo $sections['queries']; |
|
349 | +} |
|
350 | +?> |
|
339 | 351 | |
340 | 352 | <?php endif; ?> |
341 | 353 | </div> |
@@ -395,8 +407,11 @@ discard block |
||
395 | 407 | <?php foreach ($sections[$section] as $key => $val) : ?> |
396 | 408 | <tr><td class="hilight"><?php echo $key ?></td><td><?php echo htmlspecialchars($val) ?></td></tr> |
397 | 409 | <?php endforeach; ?> |
398 | - <?php else : ?> |
|
399 | - <tr><td><?php echo $sections[$section]; ?></td></tr> |
|
410 | + <?php else { |
|
411 | + : ?> |
|
412 | + <tr><td><?php echo $sections[$section]; |
|
413 | +} |
|
414 | +?></td></tr> |
|
400 | 415 | <?php endif; ?> |
401 | 416 | </table> |
402 | 417 | <?php endif; ?> |
@@ -423,20 +438,26 @@ discard block |
||
423 | 438 | <?php endforeach; ?> |
424 | 439 | </table> |
425 | 440 | |
426 | - <?php else : ?> |
|
441 | + <?php else { |
|
442 | + : ?> |
|
427 | 443 | |
428 | - <?php echo $sections['files']; ?> |
|
444 | + <?php echo $sections['files']; |
|
445 | +} |
|
446 | +?> |
|
429 | 447 | |
430 | 448 | <?php endif; ?> |
431 | 449 | </div> |
432 | 450 | <?php endif; ?> |
433 | 451 | |
434 | 452 | |
435 | -<?php else: ?> |
|
453 | +<?php else { |
|
454 | + : ?> |
|
436 | 455 | |
437 | 456 | <p class="ci-profiler-box"><?php echo lang('profiler_no_profiles') ?></p> |
438 | 457 | |
439 | -<?php endif; ?> |
|
458 | +<?php endif; |
|
459 | +} |
|
460 | +?> |
|
440 | 461 | |
441 | 462 | </div> <!-- /codeigniter_profiler --> |
442 | 463 | </div> |
443 | 464 | \ No newline at end of file |
@@ -37,8 +37,7 @@ discard block |
||
37 | 37 | if ( is_dir($source .'/'. $file) ) |
38 | 38 | { |
39 | 39 | $this->copyFolder($source .'/'. $file, $destination .'/'. $file); |
40 | - } |
|
41 | - else { |
|
40 | + } else { |
|
42 | 41 | copy($source .'/'. $file, $destination .'/'. $file); |
43 | 42 | } |
44 | 43 | } |
@@ -87,8 +86,7 @@ discard block |
||
87 | 86 | { |
88 | 87 | $this->cleanFolder($file, $leave_files); |
89 | 88 | rmdir($file); |
90 | - } |
|
91 | - else |
|
89 | + } else |
|
92 | 90 | { |
93 | 91 | unlink($file); |
94 | 92 | } |
@@ -147,22 +145,21 @@ discard block |
||
147 | 145 | $file = str_replace('\\', '/', $file); |
148 | 146 | |
149 | 147 | // Ignore "." and ".." folders |
150 | - if( in_array(substr($file, strrpos($file, '/')+1), array('.', '..', '.DS_Store')) ) |
|
151 | - continue; |
|
148 | + if( in_array(substr($file, strrpos($file, '/')+1), array('.', '..', '.DS_Store')) ) { |
|
149 | + continue; |
|
150 | + } |
|
152 | 151 | |
153 | 152 | $file = realpath($file); |
154 | 153 | |
155 | 154 | if (is_dir($file) === true) |
156 | 155 | { |
157 | 156 | $zip->addEmptyDir(str_replace($source . '/', '', $file . '/')); |
158 | - } |
|
159 | - else if (is_file($file) === true) |
|
157 | + } else if (is_file($file) === true) |
|
160 | 158 | { |
161 | 159 | $zip->addFromString(str_replace($source . '/', '', $file), file_get_contents($file)); |
162 | 160 | } |
163 | 161 | } |
164 | - } |
|
165 | - else if (is_file($source) === true) |
|
162 | + } else if (is_file($source) === true) |
|
166 | 163 | { |
167 | 164 | $zip->addFromString(basename($source), file_get_contents($source)); |
168 | 165 | } |
@@ -68,16 +68,13 @@ discard block |
||
68 | 68 | if (isset($_ENV['TRAVIS'])) |
69 | 69 | { |
70 | 70 | define('ENVIRONMENT', 'travis'); |
71 | - } |
|
72 | - else if (isset($_ENV['TESTING'])) |
|
71 | + } else if (isset($_ENV['TESTING'])) |
|
73 | 72 | { |
74 | 73 | define('ENVIRONMENT', 'testing'); |
75 | - } |
|
76 | - else if (strpos($domain, '.dev') !== false || $domain == 'cli') |
|
74 | + } else if (strpos($domain, '.dev') !== false || $domain == 'cli') |
|
77 | 75 | { |
78 | 76 | define('ENVIRONMENT', 'development'); |
79 | - } |
|
80 | - else { |
|
77 | + } else { |
|
81 | 78 | define('ENVIRONMENT', 'production'); |
82 | 79 | } |
83 | 80 | |
@@ -103,8 +100,7 @@ discard block |
||
103 | 100 | if (version_compare(PHP_VERSION, '5.3', '>=')) |
104 | 101 | { |
105 | 102 | error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED); |
106 | - } |
|
107 | - else |
|
103 | + } else |
|
108 | 104 | { |
109 | 105 | error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_USER_NOTICE); |
110 | 106 | } |
@@ -235,8 +231,7 @@ discard block |
||
235 | 231 | if (($_temp = realpath($system_path)) !== FALSE) |
236 | 232 | { |
237 | 233 | $system_path = $_temp.'/'; |
238 | - } |
|
239 | - else |
|
234 | + } else |
|
240 | 235 | { |
241 | 236 | // Ensure there's a trailing slash |
242 | 237 | $system_path = rtrim($system_path, '/').'/'; |
@@ -279,8 +274,7 @@ discard block |
||
279 | 274 | } |
280 | 275 | |
281 | 276 | define('APPPATH', $application_folder.DIRECTORY_SEPARATOR); |
282 | - } |
|
283 | - else |
|
277 | + } else |
|
284 | 278 | { |
285 | 279 | if ( ! is_dir(BASEPATH.$application_folder.DIRECTORY_SEPARATOR)) |
286 | 280 | { |
@@ -298,14 +292,12 @@ discard block |
||
298 | 292 | if ( ! empty($view_folder) && is_dir(APPPATH.$view_folder.DIRECTORY_SEPARATOR)) |
299 | 293 | { |
300 | 294 | $view_folder = APPPATH.$view_folder; |
301 | - } |
|
302 | - elseif ( ! is_dir(APPPATH.'views'.DIRECTORY_SEPARATOR)) |
|
295 | + } elseif ( ! is_dir(APPPATH.'views'.DIRECTORY_SEPARATOR)) |
|
303 | 296 | { |
304 | 297 | header('HTTP/1.1 503 Service Unavailable.', TRUE, 503); |
305 | 298 | echo 'Your view folder path does not appear to be set correctly. Please open the following file and correct this: '.SELF; |
306 | 299 | exit(3); // EXIT_CONFIG |
307 | - } |
|
308 | - else |
|
300 | + } else |
|
309 | 301 | { |
310 | 302 | $view_folder = APPPATH.'views'; |
311 | 303 | } |
@@ -314,8 +306,7 @@ discard block |
||
314 | 306 | if (($_temp = realpath($view_folder)) !== FALSE) |
315 | 307 | { |
316 | 308 | $view_folder = $_temp.DIRECTORY_SEPARATOR; |
317 | - } |
|
318 | - else |
|
309 | + } else |
|
319 | 310 | { |
320 | 311 | $view_folder = rtrim($view_folder, '/\\').DIRECTORY_SEPARATOR; |
321 | 312 | } |