Skip to content

Commit

Permalink
Fix bug in Alfred 4 using getenv() (#15)
Browse files Browse the repository at this point in the history
* Replace $_ENV with getenv();

* Update README

* Update README.md

* support older PHP versions

`getenv('alfred_theme_subtext') ?? '0'` would be ideal, but let's KISS

Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
  • Loading branch information
jamesbellnet and tillkruss authored May 1, 2020
1 parent e8a37cf commit 91c27a3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Laravel Docs Workflow for Alfred

An ultra-fast Laravel docs search workflow for [Alfred 3](https://www.alfredapp.com).
An ultra-fast Laravel docs search workflow for [Alfred 3+](https://www.alfredapp.com).

![Screenshot](screenshot.png)

Expand Down
8 changes: 6 additions & 2 deletions laravel.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,18 @@
$branch = $matches[1];
$query = $matches[2];
} else {
$branch = $_ENV['branch'];
$branch = getenv('branch');
}

if ($branch === 'latest') {
$branch = null;
}

$subtext = empty($_ENV['alfred_theme_subtext']) ? '0' : $_ENV['alfred_theme_subtext'];
$subtext = getenv('alfred_theme_subtext');

if (empty($subtext)) {
$subtext = '0';
}

$workflow = new Workflow;
$parsedown = new Parsedown;
Expand Down

0 comments on commit 91c27a3

Please # to comment.