Skip to content

Commit

Permalink
Debug option to display all PHP errors in Alfred workflow debug window
Browse files Browse the repository at this point in the history
  • Loading branch information
vdesabou committed Nov 27, 2022
1 parent 9417d3f commit 337e3b5
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions spotify-mini-player/src/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,23 @@

function main($argv) {
// $begin_time = computeTime();
// Report all PHP errors
//error_reporting(E_ALL);
error_reporting(0);
$w = new Workflows('com.vdesabou.spotify.mini.player');

$is_alfred_playlist_active = getSetting($w, 'is_alfred_playlist_active');
$now_playing_notifications = getSetting($w, 'now_playing_notifications');
$alfred_playlist_uri = getSetting($w, 'alfred_playlist_uri');
$alfred_playlist_name = getSetting($w, 'alfred_playlist_name');
$country_code = getSetting($w, 'country_code');
$last_check_update_time = getSetting($w, 'last_check_update_time');
$userid = getSetting($w, 'userid');
$debug = getSetting($w, 'debug');
if($debug) {
// Report all PHP errors
error_reporting(E_ALL);
} else {
error_reporting(0);
}

$query = escapeQuery($argv[1]);

// check for library update in progress
Expand Down Expand Up @@ -74,17 +86,6 @@ function main($argv) {
}
}




$is_alfred_playlist_active = getSetting($w,'is_alfred_playlist_active');
$now_playing_notifications = getSetting($w,'now_playing_notifications');
$alfred_playlist_uri = getSetting($w,'alfred_playlist_uri');
$alfred_playlist_name = getSetting($w,'alfred_playlist_name');
$country_code = getSetting($w,'country_code');
$last_check_update_time = getSetting($w,'last_check_update_time');
$userid = getSetting($w,'userid');

// Check that user is logged
oAuthChecks($w, $query, $update_in_progress);

Expand Down

0 comments on commit 337e3b5

Please sign in to comment.