From b8925abd9a8a8a8182409fff7a80da984a9499b4 Mon Sep 17 00:00:00 2001 From: Richard van Laak Date: Thu, 23 Feb 2017 11:10:07 +0100 Subject: [PATCH] Fix BC break on undefined array index for `maxmind-db` path introduced by #6 --- Composer/ScriptHandler.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Composer/ScriptHandler.php b/Composer/ScriptHandler.php index 7061abd..7f01f8a 100644 --- a/Composer/ScriptHandler.php +++ b/Composer/ScriptHandler.php @@ -1,13 +1,7 @@ $options['maxmind-db-path'])); $command->setContainer(new Container($parameters)); - $input = new StringInput($options['maxmind-db']); + // Allow to provide custom `maxmind-db` database link via `composer.json` extra section + $maxmindDatabaseLink = isset($options['maxmind-db']) + ? $options['maxmind-db'] + : 'http://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.mmdb.gz' + ; + $input = new StringInput($maxmindDatabaseLink); $command->run($input, new ConsoleOutput()); } }