Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@
"name": "scriptixru/sypexgeo",
"description": "Supports GeoIP services (sypexgeo.net).",
"keywords": ["laravel", "laravel 5", "geoip", "location", "geolocation"],
"license": "BSD 2-Clause",
"license": "BSD-2-Clause",
"authors": [
{
"name": "Varchak Valery",
"email": "scriptixru@gmail.com"
},
{
"name": "Vitaly Baev",
"email": "hello@vitalybaev.ru"
}
],
"require": {
Expand All @@ -16,10 +20,5 @@
"psr-4": {
"Scriptixru\\SypexGeo\\": "src/Scriptixru/SypexGeo"
}
},
"extra": {
"branch-alias": {
"dev-master": "0.2-dev"
}
}
}
10 changes: 3 additions & 7 deletions src/Scriptixru/SypexGeo/SypexGeoServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,12 @@ public function boot()
public function register()
{
// Register providers.
$this->app['sypexgeo'] = $this->app->share(function($app)
{
$this->app->singleton('sypexgeo', function ($app) {
$sypexConfig = $app['config'];
$sypexConfigType = $sypexConfig->get('sypexgeo.sypexgeo.type', array());
$sypexConfigPath = $sypexConfig->get('sypexgeo.sypexgeo.path', array());

switch ($sypexConfigType){
switch ($sypexConfigType){
case ('database'):
$sypexConfigFile = $sypexConfig->get('sypexgeo.sypexgeo.file', array());
$sxgeo = new SxGeo(base_path().$sypexConfigPath.$sypexConfigFile);
Expand All @@ -51,11 +50,8 @@ public function register()
$sxgeo = new SxGeo(base_path().$sypexConfigPath.$sypexConfigFile);
}

//return new GeoIP($app['config'], $app["session.store"]);


return new SypexGeo($sxgeo, $app['config']);
});
});
}

/**
Expand Down