Compare commits

...

7 Commits

5 changed files with 37 additions and 17 deletions

1
.gitignore vendored
View File

@ -1,5 +1,6 @@
# Do not index node.js modules that are used for building # Do not index node.js modules that are used for building
node_modules node_modules
package-lock.json
# Do not index composer components # Do not index composer components
vendor vendor

View File

@ -126,7 +126,7 @@ class Plugin extends \Mibew\Plugin\AbstractPlugin implements \Mibew\Plugin\Plugi
*/ */
public static function getVersion() public static function getVersion()
{ {
return '1.0.1'; return '1.0.2';
} }
/** /**
@ -139,6 +139,21 @@ class Plugin extends \Mibew\Plugin\AbstractPlugin implements \Mibew\Plugin\Plugi
return array(); 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. * Format locale name using "xx-XX" format.
* *

View File

@ -2,10 +2,11 @@
Provides Geo IP information for other plugins. 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 ## Installation
1. Get the archive with the plugin sources. At the moment the only option is to build the plugin from sources. 1. Get the archive with the plugin sources. You can download it from the [official site](https://mibew.org/plugins#mibew-geoip) or build the plugin from sources.
2. Untar/unzip the plugin's archive. 2. Untar/unzip the plugin's archive.

View File

@ -9,6 +9,11 @@ var fs = require('fs'),
gzip = require('gulp-gzip'), gzip = require('gulp-gzip'),
rename = require('gulp-rename'); rename = require('gulp-rename');
var config = {
getComposerUrl: 'https://getcomposer.org/installer',
phpBin: 'php -d "suhosin.executor.include.whitelist = phar" -d "memory_limit=512M"'
}
// Get and install PHP Composer // Get and install PHP Composer
gulp.task('get-composer', function(callback) { gulp.task('get-composer', function(callback) {
// Check if Composer already in place // Check if Composer already in place
@ -19,9 +24,9 @@ gulp.task('get-composer', function(callback) {
} }
// Get installer from the internet // Get installer from the internet
https.get('https://getcomposer.org/installer', function(response) { https.get(config.getComposerUrl, function(response) {
// Run PHP to install Composer // Run PHP to install Composer
var php = exec('php', function(error, stdout, stderr) { var php = exec(config.phpBin, function(error, stdout, stderr) {
callback(error ? stderr : null); callback(error ? stderr : null);
}); });
// Pass installer code to PHP via STDIN // Pass installer code to PHP via STDIN
@ -30,13 +35,13 @@ gulp.task('get-composer', function(callback) {
}); });
// Install Composer dependencies // Install Composer dependencies
gulp.task('composer-install', ['get-composer'], function(callback) { gulp.task('composer-install', gulp.series('get-composer', function(callback) {
exec('php -d "suhosin.executor.include.whitelist = phar" composer.phar install --no-dev', function(error, stdout, stderr) { exec(config.phpBin + ' composer.phar install --no-dev', function(error, stdout, stderr) {
callback(error ? stderr : null); callback(error ? stderr : null);
}); });
}); }));
gulp.task('prepare-release', ['composer-install'], function() { gulp.task('prepare-release', gulp.series('composer-install', function() {
var version = require('./package.json').version; var version = require('./package.json').version;
return eventStream.merge( return eventStream.merge(
@ -48,12 +53,10 @@ gulp.task('prepare-release', ['composer-install'], function() {
) )
.pipe(chmod(0644)) .pipe(chmod(0644))
.pipe(gulp.dest('release')); .pipe(gulp.dest('release'));
}); }));
// Builds and packs plugins sources // Builds and packs plugins sources
gulp.task('default', ['prepare-release'], function() { gulp.task('default', gulp.series('prepare-release'));
// The "default" task is just an alias for "prepare-release" task.
});
/** /**
* Returns files stream with the plugin sources. * Returns files stream with the plugin sources.

View File

@ -1,12 +1,12 @@
{ {
"version": "1.0.1", "version": "1.0.2",
"devDependencies": { "devDependencies": {
"gulp": "~3.8.10", "gulp": "^4.0.0",
"event-stream": "~3.1.7", "event-stream": "~3.1.7",
"gulp-zip": "~2.0.2", "gulp-zip": "~2.0.2",
"gulp-tar": "~1.3.1", "gulp-tar": "~3.1.0",
"gulp-gzip": "~0.0.8", "gulp-gzip": "~0.0.8",
"gulp-chmod": "~1.2.0", "gulp-chmod": "~3.0.0",
"gulp-rename": "~1.2.0" "gulp-rename": "~1.2.0"
} }
} }