diff --git a/Plugin.php b/Plugin.php index 1fb47ab..36157b3 100644 --- a/Plugin.php +++ b/Plugin.php @@ -139,6 +139,21 @@ class Plugin extends \Mibew\Plugin\AbstractPlugin implements \Mibew\Plugin\Plugi return array(); } + /** + * Returns plugin's system requirements + * + * @return type + */ + public static function getSystemRequirements() + { + if (extension_loaded('gmp')) { + return array('ext-gmp' => '*'); + } + else { + return array('ext-bcmath' => '*'); + } + } + /** * Format locale name using "xx-XX" format. * diff --git a/README.md b/README.md index cac562f..9db811e 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ Provides Geo IP information for other plugins. +*Requires either [GMP (GNU Multiple Precision)](http://php.net/manual/en/book.gmp.php) or [BC Math (BCMath Arbitrary Precision Mathematics)](http://php.net/manual/en/book.bc.php) PHP extension.* ## Installation