Define system requirements (bcmath or gmp PHP extention)

Fixes #5
This commit is contained in:
Fedor A. Fetisov 2018-09-24 16:58:38 +03:00
parent 079b9e8686
commit 001cb3598f
2 changed files with 16 additions and 0 deletions

View File

@ -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.
*

View File

@ -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