mirror of
https://github.com/Mibew/geo-ip-plugin.git
synced 2025-04-20 19:17:25 +03:00
Compare commits
No commits in common. "master" and "v1.0.1" have entirely different histories.
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,6 +1,5 @@
|
|||||||
# 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
|
||||||
|
17
Plugin.php
17
Plugin.php
@ -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.2';
|
return '1.0.1';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -139,21 +139,6 @@ 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.
|
||||||
*
|
*
|
||||||
|
@ -2,11 +2,10 @@
|
|||||||
|
|
||||||
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. 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.
|
2. Untar/unzip the plugin's archive.
|
||||||
|
|
||||||
|
23
gulpfile.js
23
gulpfile.js
@ -9,11 +9,6 @@ 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
|
||||||
@ -24,9 +19,9 @@ gulp.task('get-composer', function(callback) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get installer from the internet
|
// Get installer from the internet
|
||||||
https.get(config.getComposerUrl, function(response) {
|
https.get('https://getcomposer.org/installer', function(response) {
|
||||||
// Run PHP to install Composer
|
// 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);
|
callback(error ? stderr : null);
|
||||||
});
|
});
|
||||||
// Pass installer code to PHP via STDIN
|
// Pass installer code to PHP via STDIN
|
||||||
@ -35,13 +30,13 @@ gulp.task('get-composer', function(callback) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Install Composer dependencies
|
// Install Composer dependencies
|
||||||
gulp.task('composer-install', gulp.series('get-composer', function(callback) {
|
gulp.task('composer-install', ['get-composer'], function(callback) {
|
||||||
exec(config.phpBin + ' composer.phar install --no-dev', function(error, stdout, stderr) {
|
exec('php -d "suhosin.executor.include.whitelist = phar" composer.phar install --no-dev', function(error, stdout, stderr) {
|
||||||
callback(error ? stderr : null);
|
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;
|
var version = require('./package.json').version;
|
||||||
|
|
||||||
return eventStream.merge(
|
return eventStream.merge(
|
||||||
@ -53,10 +48,12 @@ gulp.task('prepare-release', gulp.series('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', 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.
|
* Returns files stream with the plugin sources.
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"version": "1.0.2",
|
"version": "1.0.1",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"gulp": "^4.0.0",
|
"gulp": "~3.8.10",
|
||||||
"event-stream": "~3.1.7",
|
"event-stream": "~3.1.7",
|
||||||
"gulp-zip": "~2.0.2",
|
"gulp-zip": "~2.0.2",
|
||||||
"gulp-tar": "~3.1.0",
|
"gulp-tar": "~1.3.1",
|
||||||
"gulp-gzip": "~0.0.8",
|
"gulp-gzip": "~0.0.8",
|
||||||
"gulp-chmod": "~3.0.0",
|
"gulp-chmod": "~1.2.0",
|
||||||
"gulp-rename": "~1.2.0"
|
"gulp-rename": "~1.2.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user