@@ -2,7 +2,9 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | # Check PHP version |
| 4 | 4 | |
| 5 | -if (version_compare(PHP_VERSION, '7.0.0') < 0) exit('PHP version 7 or higher is required.'); |
|
| 5 | +if (version_compare(PHP_VERSION, '7.0.0') < 0) { |
|
| 6 | + exit('PHP version 7 or higher is required.'); |
|
| 7 | +} |
|
| 6 | 8 | |
| 7 | 9 | # Set error reporting |
| 8 | 10 | |
@@ -37,9 +39,11 @@ discard block |
||
| 37 | 39 | |
| 38 | 40 | # Require class file |
| 39 | 41 | |
| 40 | - if (@file_exists($file_name = ($path . '.php')) && @is_file($file_name)) require_once $file_name; |
|
| 41 | - |
|
| 42 | - else if (@file_exists($file_name = ($path . '/' . $last . '.php')) && @is_file($file_name)) require_once $file_name; |
|
| 42 | + if (@file_exists($file_name = ($path . '.php')) && @is_file($file_name)) { |
|
| 43 | + require_once $file_name; |
|
| 44 | + } else if (@file_exists($file_name = ($path . '/' . $last . '.php')) && @is_file($file_name)) { |
|
| 45 | + require_once $file_name; |
|
| 46 | + } |
|
| 43 | 47 | |
| 44 | 48 | # Check if class exists |
| 45 | 49 | |
@@ -50,5 +54,7 @@ discard block |
||
| 50 | 54 | |
| 51 | 55 | # Call autoload method |
| 52 | 56 | |
| 53 | - if (method_exists($class_name, '__autoload')) $class_name::__autoload(); |
|
| 54 | -}); |
|
| 57 | + if (method_exists($class_name, '__autoload')) { |
|
| 58 | + $class_name::__autoload(); |
|
| 59 | + } |
|
| 60 | + }); |
|