From dc363c6be51549994920be3488bc516c003ff462 Mon Sep 17 00:00:00 2001 From: Alexander Melihov Date: Sat, 5 Aug 2017 02:54:14 +0300 Subject: [PATCH] fix bug with symbolic links --- src/LaravelLogViewer/LaravelLogViewer.php | 4 ++-- tests/LaravelLogViewerConfigTest.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/LaravelLogViewer/LaravelLogViewer.php b/src/LaravelLogViewer/LaravelLogViewer.php index d9d47d5..7eb0553 100644 --- a/src/LaravelLogViewer/LaravelLogViewer.php +++ b/src/LaravelLogViewer/LaravelLogViewer.php @@ -64,8 +64,8 @@ class LaravelLogViewer */ public function __construct($baseDir, $maxFileSize) { - $this->baseDir = $baseDir; - $this->currentDir = $baseDir; + $this->baseDir = realpath($baseDir); + $this->currentDir = $this->baseDir; $this->maxFileSize = $maxFileSize; } diff --git a/tests/LaravelLogViewerConfigTest.php b/tests/LaravelLogViewerConfigTest.php index 92b9b27..61af364 100644 --- a/tests/LaravelLogViewerConfigTest.php +++ b/tests/LaravelLogViewerConfigTest.php @@ -28,6 +28,6 @@ protected function getEnvironmentSetUp($app) public function testItSetsBaseDirToDefaultLaravelLogsDir() { - $this->assertEquals(storage_path('logs'), \LogViewer::getBaseDirectory()); + $this->assertEquals(realpath(storage_path('logs')), \LogViewer::getBaseDirectory()); } }