Skip to content

Commit

Permalink
Merge pull request #7 from sjaune/fix/repository-from-phar
Browse files Browse the repository at this point in the history
Fix repository path that cannot be loaded within PHAR archive
  • Loading branch information
toonvandenbos authored Nov 25, 2021
2 parents a1c8df7 + ab4dfb4 commit db5e8a2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Lingua/LanguagesRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class LanguagesRepository

public function __construct()
{
$this->path = realpath(__DIR__ . '/../../languages.php');
$this->path = __DIR__ . '/../../languages.php';
$this->languages = $this->loadRepository();
}

Expand Down Expand Up @@ -56,9 +56,9 @@ public static function register(array $definition)

protected function loadRepository()
{
if(!$this->path) {
if(false === @file_get_contents($this->path)) {
throw new \Exception('Lingua\'s languages repository could not be loaded');
}
return include($this->path);
}
}
}

0 comments on commit db5e8a2

Please sign in to comment.