From a058c1251ec507e98ba4b2454c232311cce5228c Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Wed, 21 Sep 2016 09:52:12 -0500 Subject: [PATCH] remove logs method --- cli/Valet/Site.php | 23 ----------------------- cli/valet.php | 17 ----------------- tests/SiteTest.php | 8 -------- 3 files changed, 48 deletions(-) diff --git a/cli/Valet/Site.php b/cli/Valet/Site.php index bdc85cc..9ac6ccf 100644 --- a/cli/Valet/Site.php +++ b/cli/Valet/Site.php @@ -235,29 +235,6 @@ function unsecure($url) } } - /** - * Get all of the log files for all sites. - * - * @param array $paths - * @return array - */ - function logs($paths) - { - $files = collect(); - - foreach ($paths as $path) { - $files = $files->merge(collect($this->files->scandir($path))->map(function ($directory) use ($path) { - $logPath = $path.'/'.$directory.'/storage/logs/laravel.log'; - - if ($this->files->isDir(dirname($logPath))) { - return $this->files->touchAsUser($logPath); - } - })->filter()); - } - - return $files->values()->all(); - } - /** * Get the path to the linked Valet sites. * diff --git a/cli/valet.php b/cli/valet.php index 3244662..c2dd459 100755 --- a/cli/valet.php +++ b/cli/valet.php @@ -158,23 +158,6 @@ } })->descriptions('Determine which Valet driver serves the current working directory'); -/** - * Stream all of the logs for all sites. - */ -$app->command('logs', function () { - $files = Site::logs(Configuration::read()['paths']); - - $args = collect($files)->map(function ($file) { - return escapeshellarg($file); - })->implode(' '); - - if (count($files) > 0) { - passthru("tail -f {$args}"); - } else { - warning('No log files were found.'); - } -})->descriptions('Stream all of the logs for all Laravel sites registered with Valet'); - /** * Stream the Caddy access and error logs. */ diff --git a/tests/SiteTest.php b/tests/SiteTest.php index 5b6d87d..f0e7316 100644 --- a/tests/SiteTest.php +++ b/tests/SiteTest.php @@ -64,14 +64,6 @@ public function test_prune_links_removes_broken_symlinks_in_sites_path() $site->pruneLinks(); $this->assertFileNotExists(__DIR__.'/output/link'); } - - - public function test_logs_method_returns_array_of_log_files() - { - $logs = resolve(Site::class)->logs([__DIR__.'/test-directory-for-logs']); - $this->assertSame(__DIR__.'/test-directory-for-logs/project/storage/logs/laravel.log', $logs[0]); - unlink(__DIR__.'/test-directory-for-logs/project/storage/logs/laravel.log'); - } }