Skip to content

Commit 40ce6ee

Browse files
authored
Update MaxMindDatabase.php
1 parent 280b838 commit 40ce6ee

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/Services/MaxMindDatabase.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,14 @@ class MaxMindDatabase extends AbstractService
2222
*/
2323
public function boot()
2424
{
25+
$path = $this->config('database_path');
2526
// Copy test database for now
26-
if (file_exists($this->config('database_path')) === false) {
27-
copy(__DIR__ . '/../../resources/geoip.mmdb', $this->config('database_path'));
27+
if (file_exists($path) === false) {
28+
mkdir(str_replace('/geoip.mmdb', '', $path));
29+
copy(__DIR__ . '/../../resources/geoip.mmdb', $path);
2830
}
2931

30-
$this->reader = new Reader(
31-
$this->config('database_path'),
32-
$this->config('locales', ['en'])
33-
);
32+
$this->reader = new Reader( $path, $this->config('locales', ['en']));
3433
}
3534

3635
/**

0 commit comments

Comments
 (0)