diff --git a/src/ncc/Utilities/Validate.php b/src/ncc/Utilities/Validate.php index 8fa45f3..1ca050d 100644 --- a/src/ncc/Utilities/Validate.php +++ b/src/ncc/Utilities/Validate.php @@ -12,6 +12,41 @@ */ class Validate { + /** + * Determines if the runtime meets the required extensions + * + * @return array + */ + public static function requiredExtensions(): array + { + $requirements = [ + 'zlib', + 'libxml', + 'ctype', + 'json', + 'mbstring', + 'posix', + 'ctype', + 'tokenizer' + ]; + + $results = []; + + foreach($requirements as $ext) + { + if(in_array(strtolower($ext), get_loaded_extensions())) + { + $results[$ext] = true; + } + else + { + $results[$ext] = false; + } + } + + return $results; + } + /** * Validates the version number * diff --git a/tests/utils/runtime_extensions.php b/tests/utils/runtime_extensions.php new file mode 100644 index 0000000..f12006b --- /dev/null +++ b/tests/utils/runtime_extensions.php @@ -0,0 +1,5 @@ +