Skip to content
Merged
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/vendor
composer.phar
composer.lock
.DS_Store
.DS_Store
.idea/*
14 changes: 12 additions & 2 deletions src/Console/Clear.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,18 @@ class Clear extends Command
*/
protected $description = 'Clear GeoIP cached locations.';

/**
* Execute the console command for Laravel 5.5 and newer.
* @return void
*/
public function handle()
{
$this->fire();
}

/**
* Execute the console command.
* @return void
*/
public function fire()
{
Expand All @@ -40,7 +50,7 @@ public function fire()
protected function isSupported()
{
return empty(app('geoip')->config('cache_tags')) === false
&& in_array(config('cache.default'), ['file', 'database']) === false;
&& in_array(config('cache.default'), ['file', 'database']) === false;
}

/**
Expand All @@ -56,4 +66,4 @@ protected function performFlush()

$this->output->writeln("<info>complete</info>");
}
}
}
16 changes: 12 additions & 4 deletions src/Console/Update.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@ class Update extends Command
*/
protected $description = 'Update GeoIP database files to the latest version';

/**
* Execute the console command for Laravel 5.5 and newer.
* @return void
*/
public function handle()
{
$this->fire();
}

/**
* Execute the console command.
*
Expand All @@ -32,7 +41,7 @@ public function fire()

// Ensure the selected service supports updating
if (method_exists($service, 'update') === false) {
$this->info('The current service "' . get_class($service). '" does not support updating.');
$this->info('The current service "' . get_class($service) . '" does not support updating.');
return;
}

Expand All @@ -41,9 +50,8 @@ public function fire()
// Perform update
if ($result = $service->update()) {
$this->info($result);
}
else {
} else {
$this->error('Update failed!');
}
}
}
}