Commit 6b77b66 1 parent 71fce78 commit 6b77b66 Copy full SHA for 6b77b66
File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 1
1
<?php
2
2
3
3
// check for username
4
- if (empty ( $ _ENV [ 'username ' ] )) {
4
+ if (false === getenv ( 'username ' )) {
5
5
echo json_encode ([
6
6
'items ' => [[
7
7
"arg " => "https://www.alfredapp.com/help/workflows/advanced/variables/ " ,
13
13
exit (1 );
14
14
}
15
15
16
- $ cache_path = $ _ENV [ 'alfred_workflow_cache ' ] ;
16
+ $ cache_path = getenv ( 'alfred_workflow_cache ' ) ;
17
17
$ cache_response = $ cache_path . '/cache.json ' ;
18
18
$ cache_icons = $ cache_path . '/icons/ ' ;
19
19
25
25
mkdir ($ cache_icons );
26
26
}
27
27
28
- $ username = trim ($ _ENV [ 'username ' ] ); // set inside workflow variables
29
- $ token = trim ($ _ENV [ 'token ' ] ); // set inside workflow variables
28
+ $ username = trim (getenv ( 'username ' ) ); // set inside workflow variables
29
+ $ token = trim (getenv ( 'token ' ) ); // set inside workflow variables
30
30
$ starred_url = sprintf ('https://api.github.com/users/%s/starred ' , $ username );
31
- $ cache_ttl = (empty ( $ _ENV [ 'cache_ttl ' ] )) ? 3600 * 24 : (int ) $ _ENV [ 'cache_ttl ' ] ; // in seconds
31
+ $ cache_ttl = (false === getenv ( 'cache_ttl ' )) ? 3600 * 24 : (int ) getenv ( 'cache_ttl ' ) ; // in seconds
32
32
$ query = trim ($ argv [1 ]); // optional text search
33
33
$ http_status = 200 ; // default status code, so when using cache it doesn't run into error handling
34
34
You can’t perform that action at this time.
0 commit comments