Skip to content

Commit

Permalink
Adding GLOB_BRACE pattern detection (#142)
Browse files Browse the repository at this point in the history
  • Loading branch information
donportugal authored and rap2hpoutre committed Jun 10, 2018
1 parent 69f2d52 commit 4a594fe
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Rap2hpoutre/LaravelLogViewer/LaravelLogViewer.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ public static function all()
*/
public static function getFiles($basename = false)
{
$files = glob(storage_path() . '/logs/' . (function_exists('config') ? config('logviewer.pattern', '*.log') : '*.log'));
$pattern = function_exists('config') ? config('logviewer.pattern', '*.log') : '*.log';
$files = glob(storage_path() . '/logs/' . $pattern, preg_match('/\{.*?\,.*?\}/i', $pattern) ? GLOB_BRACE : 0);
$files = array_reverse($files);
$files = array_filter($files, 'is_file');
if ($basename && is_array($files)) {
Expand Down

0 comments on commit 4a594fe

Please sign in to comment.