From ab4dfb4883507005d36e69ac3808e6639a03d5f1 Mon Sep 17 00:00:00 2001 From: Sylvain Jaune Date: Wed, 17 Nov 2021 16:09:18 +0100 Subject: [PATCH] Fix repository path that cannot be loaded within PHAR archive --- src/Lingua/LanguagesRepository.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Lingua/LanguagesRepository.php b/src/Lingua/LanguagesRepository.php index 98a57a4..dacd3d0 100644 --- a/src/Lingua/LanguagesRepository.php +++ b/src/Lingua/LanguagesRepository.php @@ -13,7 +13,7 @@ class LanguagesRepository public function __construct() { - $this->path = realpath(__DIR__ . '/../../languages.php'); + $this->path = __DIR__ . '/../../languages.php'; $this->languages = $this->loadRepository(); } @@ -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); } -} +} \ No newline at end of file