Skip to content

Commit bc482f5

Browse files
committed
try with /
1 parent 3a38d32 commit bc482f5

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

src/LogFile.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ public function __construct(string $path)
3636

3737
// Let's remove the file name because we already know it.
3838
$this->subFolder = str_replace($this->name, '', $path);
39-
$this->subFolder = rtrim($this->subFolder, DIRECTORY_SEPARATOR);
39+
$this->subFolder = rtrim($this->subFolder, '/');
4040

41-
// if (str_starts_with($path, DIRECTORY_SEPARATOR)) {
41+
// if (str_starts_with($path, '/')) {
4242
// $this->absolutePath = pathinfo($path)['dirname'];
4343
// $this->path = pathinfo($path)['basename'];
4444
// }

src/LogFolder.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function files(): LogFileCollection
3636
public function isRoot(): bool
3737
{
3838
return empty($this->path)
39-
|| $this->path === rtrim(LogViewer::basePathForLogs(), DIRECTORY_SEPARATOR);
39+
|| $this->path === rtrim(LogViewer::basePathForLogs(), '/');
4040
}
4141

4242
public function cleanPath(): string
@@ -47,7 +47,7 @@ public function cleanPath(): string
4747

4848
$folder = $this->path;
4949

50-
$folder = str_replace(LogViewer::basePathForLogs(), 'root'.DIRECTORY_SEPARATOR, $folder);
50+
$folder = str_replace(LogViewer::basePathForLogs(), 'root'.'/', $folder);
5151

5252
if ($unixHomePath = getenv('HOME')) {
5353
$folder = str_replace($unixHomePath, '~', $folder);
@@ -64,7 +64,7 @@ public function pathParts(): array
6464
return [];
6565
}
6666

67-
return explode(DIRECTORY_SEPARATOR, $folder);
67+
return explode('/', $folder);
6868
}
6969

7070
public function pathFormatted(): string
@@ -75,7 +75,7 @@ public function pathFormatted(): string
7575
return $folder;
7676
}
7777

78-
return str_replace(DIRECTORY_SEPARATOR, ' '.DIRECTORY_SEPARATOR.' ', $folder);
78+
return str_replace('/', ' '.'/'.' ', $folder);
7979
}
8080

8181
public function earliestTimestamp(): int
@@ -109,7 +109,7 @@ public function download(): BinaryFileResponse
109109

110110
// zip it, and download it.
111111
$zipFileName = $this->downloadFileName();
112-
$zipPath = sys_get_temp_dir().DIRECTORY_SEPARATOR.$zipFileName;
112+
$zipPath = sys_get_temp_dir().'/'.$zipFileName;
113113

114114
// just in case we have created it before.
115115
@unlink($zipPath);

src/LogViewerService.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ protected function getFilePaths(): array
3939

4040
foreach (config('log-viewer.include_files', []) as $pattern) {
4141
$absolute = true;
42-
if (! str_starts_with($pattern, DIRECTORY_SEPARATOR)) {
42+
if (! str_starts_with($pattern, '/')) {
4343
$pattern = $baseDir.$pattern;
4444
$absolute = false;
4545
}
@@ -49,7 +49,7 @@ protected function getFilePaths(): array
4949

5050
foreach (config('log-viewer.exclude_files', []) as $pattern) {
5151
$absolute = true;
52-
if (! str_starts_with($pattern, DIRECTORY_SEPARATOR)) {
52+
if (! str_starts_with($pattern, '/')) {
5353
$pattern = $baseDir.$pattern;
5454
$absolute = false;
5555
}
@@ -77,7 +77,7 @@ protected function getFilePathsMatchingPattern($pattern, $absolute = false): arr
7777
foreach ($scannedFiles as $file) {
7878
if (preg_match(pattern: Glob::toRegex(glob: $pattern), subject: $file)) {
7979
$files[] = isset($dirname)
80-
? $dirname.DIRECTORY_SEPARATOR.$file
80+
? $dirname.'/'.$file
8181
: $file;
8282
}
8383
}
@@ -90,7 +90,7 @@ public function basePathForLogs(): string
9090
$rootFolder = Str::of(config('log-viewer.filesystem.root'));
9191

9292
return ($rootFolder != '')
93-
? $rootFolder->finish(DIRECTORY_SEPARATOR)
93+
? $rootFolder->finish('/')
9494
: $rootFolder;
9595
}
9696

src/LogViewerServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function register()
2323

2424
$this->app['config']['filesystems.disks.log-viewer-local'] = [
2525
'driver' => 'local',
26-
'root' => storage_path('logs'),
26+
'root' => str_replace('\\', '/', storage_path('logs')),
2727
];
2828

2929
$this->app->bind('log-viewer', LogViewerService::class);

0 commit comments

Comments
 (0)