@@ -2,8 +2,11 @@ discard block |
||
| 2 | 2 | if(!function_exists("isConfigCached")) { |
| 3 | 3 | function isConfigCached() |
| 4 | 4 | { |
| 5 | - if(env("APP_NAME")=="" || env("APP_NAME")==null) return true; |
|
| 6 | - else return false; |
|
| 5 | + if(env("APP_NAME")=="" || env("APP_NAME")==null) { |
|
| 6 | + return true; |
|
| 7 | + } else { |
|
| 8 | + return false; |
|
| 9 | + } |
|
| 7 | 10 | } |
| 8 | 11 | } |
| 9 | 12 | |
@@ -113,7 +116,9 @@ discard block |
||
| 113 | 116 | } |
| 114 | 117 | |
| 115 | 118 | $str = substr($str, 0, -1); |
| 116 | - if (!file_put_contents($envFile, $str)) return false; |
|
| 119 | + if (!file_put_contents($envFile, $str)) { |
|
| 120 | + return false; |
|
| 121 | + } |
|
| 117 | 122 | return true; |
| 118 | 123 | } |
| 119 | 124 | } |
@@ -316,7 +321,7 @@ discard block |
||
| 316 | 321 | $settings = file_get_contents(storage_path('.cbconfig')); |
| 317 | 322 | $settings = decrypt($settings); |
| 318 | 323 | $settings = unserialize($settings); |
| 319 | - }else{ |
|
| 324 | + } else{ |
|
| 320 | 325 | $settings = []; |
| 321 | 326 | } |
| 322 | 327 | |
@@ -341,14 +346,14 @@ discard block |
||
| 341 | 346 | $settings = file_get_contents(storage_path('.cbconfig')); |
| 342 | 347 | $settings = decrypt($settings); |
| 343 | 348 | $settings = unserialize($settings); |
| 344 | - }else{ |
|
| 349 | + } else{ |
|
| 345 | 350 | $settings = []; |
| 346 | 351 | } |
| 347 | 352 | |
| 348 | 353 | if(isset($settings[$key])) { |
| 349 | 354 | \Illuminate\Support\Facades\Cache::forever("setting_".$key, $settings[$key]); |
| 350 | 355 | return $settings[$key]?:$default; |
| 351 | - }else{ |
|
| 356 | + } else{ |
|
| 352 | 357 | return $default; |
| 353 | 358 | } |
| 354 | 359 | } |
@@ -434,7 +439,7 @@ discard block |
||
| 434 | 439 | $url = request($name); |
| 435 | 440 | if(filter_var($url, FILTER_VALIDATE_URL)) { |
| 436 | 441 | return $url; |
| 437 | - }else{ |
|
| 442 | + } else{ |
|
| 438 | 443 | return request()->url(); |
| 439 | 444 | } |
| 440 | 445 | } |
@@ -446,14 +451,14 @@ discard block |
||
| 446 | 451 | $response = request($name); |
| 447 | 452 | if(is_string($response)) { |
| 448 | 453 | $response = sanitizeXSS($response); |
| 449 | - }elseif (is_array($response)) { |
|
| 454 | + } elseif (is_array($response)) { |
|
| 450 | 455 | array_walk_recursive($response, function(&$response) { |
| 451 | 456 | $response = sanitizeXSS($response); |
| 452 | 457 | }); |
| 453 | 458 | } |
| 454 | 459 | |
| 455 | 460 | return $response; |
| 456 | - }else{ |
|
| 461 | + } else{ |
|
| 457 | 462 | return Request::get($name); |
| 458 | 463 | } |
| 459 | 464 | } |
@@ -463,11 +468,13 @@ discard block |
||
| 463 | 468 | function min_var_export($input) { |
| 464 | 469 | if(is_array($input)) { |
| 465 | 470 | $buffer = []; |
| 466 | - foreach($input as $key => $value) |
|
| 467 | - $buffer[] = var_export($key, true)."=>".min_var_export($value); |
|
| 471 | + foreach($input as $key => $value) { |
|
| 472 | + $buffer[] = var_export($key, true)."=>".min_var_export($value); |
|
| 473 | + } |
|
| 468 | 474 | return "[".implode(",",$buffer)."]"; |
| 469 | - } else |
|
| 470 | - return var_export($input, true); |
|
| 475 | + } else { |
|
| 476 | + return var_export($input, true); |
|
| 477 | + } |
|
| 471 | 478 | } |
| 472 | 479 | } |
| 473 | 480 | |
@@ -480,10 +487,11 @@ discard block |
||
| 480 | 487 | $objects = scandir($dir); |
| 481 | 488 | foreach ($objects as $object) { |
| 482 | 489 | if ($object != "." && $object != "..") { |
| 483 | - if (is_dir($dir."/".$object)) |
|
| 484 | - rrmdir($dir."/".$object); |
|
| 485 | - else |
|
| 486 | - unlink($dir."/".$object); |
|
| 490 | + if (is_dir($dir."/".$object)) { |
|
| 491 | + rrmdir($dir."/".$object); |
|
| 492 | + } else { |
|
| 493 | + unlink($dir."/".$object); |
|
| 494 | + } |
|
| 487 | 495 | } |
| 488 | 496 | } |
| 489 | 497 | rmdir($dir); |