Compare commits

..

No commits in common. "master" and "v1.0.0" have entirely different histories.

5 changed files with 22 additions and 42 deletions

1
.gitignore vendored
View File

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

View File

@ -103,11 +103,11 @@ class Plugin extends \Mibew\Plugin\AbstractPlugin implements \Mibew\Plugin\Plugi
: $record->city->name;
return array(
'country_name' => $country_name ?: 'Unknown',
'country_code' => $record->country->isoCode ?: false,
'city' => $city ?: 'Unknown',
'latitude' => $record->location->latitude ?: 0,
'longitude' => $record->location->longitude ?: 0,
'country_name' => $country_name,
'country_code' => $record->country->isoCode,
'city' => $city,
'latitude' => $record->location->latitude,
'longitude' => $record->location->longitude,
);
}
@ -126,7 +126,7 @@ class Plugin extends \Mibew\Plugin\AbstractPlugin implements \Mibew\Plugin\Plugi
*/
public static function getVersion()
{
return '1.0.2';
return '1.0.0';
}
/**
@ -139,21 +139,6 @@ 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,11 +2,10 @@
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
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.
1. Get the archive with the plugin sources. At the moment the only option is to build the plugin from sources.
2. Untar/unzip the plugin's archive.

View File

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

View File

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